Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cf8d616f authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Revert "msm: vidc: Check image encode capabilities""

parents bd667e13 0983afa8
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -1606,7 +1606,6 @@ int msm_venc_s_ctrl(struct msm_vidc_inst *inst, struct v4l2_ctrl *ctrl)
				V4L2_CID_MPEG_VIDC_VIDEO_HEVC_TIER_LEVEL,
				temp_ctrl->val);
		pdata = &profile_level;
		inst->profile = profile_level.profile;
		break;
	case V4L2_CID_MPEG_VIDC_VIDEO_HEVC_TIER_LEVEL:
		temp_ctrl = TRY_GET_CTRL(V4L2_CID_MPEG_VIDC_VIDEO_HEVC_PROFILE);
+0 −64
Original line number Diff line number Diff line
@@ -5643,65 +5643,6 @@ int msm_vidc_check_scaling_supported(struct msm_vidc_inst *inst)
	return 0;
}

static bool is_image_session(struct msm_vidc_inst *inst)
{
	if (inst->session_type == MSM_VIDC_ENCODER &&
		get_hal_codec(inst->fmts[CAPTURE_PORT].fourcc) ==
			HAL_VIDEO_CODEC_HEVC)
		return (inst->profile == HAL_HEVC_PROFILE_MAIN_STILL_PIC ||
				inst->grid_enable);
	else
		return false;
}

static int msm_vidc_check_image_session_capabilities(struct msm_vidc_inst *inst)
{
	int rc = 0;
	struct msm_vidc_image_capability *capability = NULL;

	u32 output_height = ALIGN(inst->prop.height[CAPTURE_PORT], 512);
	u32 output_width = ALIGN(inst->prop.width[CAPTURE_PORT], 512);

	if (inst->grid_enable)
		capability = inst->core->platform_data->heic_image_capability;
	else
		capability = inst->core->platform_data->hevc_image_capability;

	if (!capability)
		return -EINVAL;

	if (output_width < capability->width.min ||
		output_height < capability->height.min) {
		dprintk(VIDC_ERR,
			"HEIC Unsupported WxH = (%u)x(%u), min supported is - (%u)x(%u)\n",
			output_width,
			output_height,
			capability->width.min,
			capability->height.min);
		rc = -ENOTSUPP;
	}
	if (!rc && (output_width > capability->width.max ||
		output_height > capability->height.max)) {
		dprintk(VIDC_ERR,
			"HEIC Unsupported WxH = (%u)x(%u), max supported is - (%u)x(%u)\n",
			output_width,
			output_height,
			capability->width.max,
			capability->height.max);
		rc = -ENOTSUPP;
	}
	if (!rc && output_height * output_width >
		capability->width.max * capability->height.max) {
		dprintk(VIDC_ERR,
		"HEIC Unsupported WxH = (%u)x(%u), max supported is - (%u)x(%u)\n",
		output_width, output_height,
		capability->width.max, capability->height.max);
		rc = -ENOTSUPP;
	}

	return rc;
}

int msm_vidc_check_session_supported(struct msm_vidc_inst *inst)
{
	struct msm_vidc_capability *capability;
@@ -5747,11 +5688,6 @@ int msm_vidc_check_session_supported(struct msm_vidc_inst *inst)
		rc = -ENOTSUPP;
	}

	if (is_image_session(inst)) {
		rc = msm_vidc_check_image_session_capabilities(inst);
		return rc;
	}

	output_height = ALIGN(inst->prop.height[CAPTURE_PORT], 16);
	output_width = ALIGN(inst->prop.width[CAPTURE_PORT], 16);

+0 −12
Original line number Diff line number Diff line
@@ -232,16 +232,6 @@ struct msm_vidc_efuse_data {
	enum efuse_purpose purpose;
};

struct msm_vidc_capability_range {
	u32 min;
	u32 max;
};

struct msm_vidc_image_capability {
	struct msm_vidc_capability_range width;
	struct msm_vidc_capability_range height;
};

enum vpu_version {
	VPU_VERSION_4 = 1,
	VPU_VERSION_5,
@@ -263,8 +253,6 @@ struct msm_vidc_platform_data {
	unsigned int efuse_data_length;
	struct msm_vidc_ubwc_config *ubwc_config;
	unsigned int ubwc_config_length;
	struct msm_vidc_image_capability *heic_image_capability;
	struct msm_vidc_image_capability *hevc_image_capability;
	unsigned int sku_version;
	uint32_t vpu_ver;
};
+0 −22
Original line number Diff line number Diff line
@@ -674,14 +674,6 @@ static struct msm_vidc_ubwc_config trinket_ubwc_data[] = {
	UBWC_CONFIG(0, 1, 0, 0, 0, 64, 0, 0),
};

static struct msm_vidc_image_capability default_heic_image_capability = {
	{512, 8192}, {512, 8192}
};

static struct msm_vidc_image_capability default_hevc_image_capability = {
	{512, 512}, {512, 512}
};

static struct msm_vidc_platform_data default_data = {
	.codec_data = default_codec_data,
	.codec_data_length =  ARRAY_SIZE(default_codec_data),
@@ -694,8 +686,6 @@ static struct msm_vidc_platform_data default_data = {
	.csc_data.vpe_csc_custom_limit_coeff = vpe_csc_custom_limit_coeff,
	.efuse_data = NULL,
	.efuse_data_length = 0,
	.heic_image_capability = &default_heic_image_capability,
	.hevc_image_capability = &default_hevc_image_capability,
	.sku_version = 0,
	.vpu_ver = VPU_VERSION_5,
};
@@ -712,8 +702,6 @@ static struct msm_vidc_platform_data sm6150_data = {
	.csc_data.vpe_csc_custom_limit_coeff = vpe_csc_custom_limit_coeff,
	.efuse_data = NULL,
	.efuse_data_length = 0,
	.heic_image_capability = NULL,
	.hevc_image_capability = NULL,
	.sku_version = 0,
	.vpu_ver = VPU_VERSION_4,
};
@@ -730,8 +718,6 @@ static struct msm_vidc_platform_data trinket_data = {
	.csc_data.vpe_csc_custom_limit_coeff = vpe_csc_custom_limit_coeff,
	.efuse_data = NULL,
	.efuse_data_length = 0,
	.heic_image_capability = &default_heic_image_capability,
	.hevc_image_capability = &default_hevc_image_capability,
	.sku_version = 0,
	.vpu_ver = VPU_VERSION_4,
};
@@ -748,8 +734,6 @@ static struct msm_vidc_platform_data sm8150_data = {
	.csc_data.vpe_csc_custom_limit_coeff = vpe_csc_custom_limit_coeff,
	.efuse_data = NULL,
	.efuse_data_length = 0,
	.heic_image_capability = &default_heic_image_capability,
	.hevc_image_capability = &default_hevc_image_capability,
	.sku_version = 0,
	.vpu_ver = VPU_VERSION_5,
};
@@ -766,8 +750,6 @@ static struct msm_vidc_platform_data sdmmagpie_data = {
	.csc_data.vpe_csc_custom_limit_coeff = vpe_csc_custom_limit_coeff,
	.efuse_data = sdmmagpie_efuse_data,
	.efuse_data_length = ARRAY_SIZE(sdmmagpie_efuse_data),
	.heic_image_capability = &default_heic_image_capability,
	.hevc_image_capability = &default_hevc_image_capability,
	.sku_version = 0,
	.vpu_ver = VPU_VERSION_5,
};
@@ -784,8 +766,6 @@ static struct msm_vidc_platform_data sdm845_data = {
	.csc_data.vpe_csc_custom_limit_coeff = vpe_csc_custom_limit_coeff,
	.efuse_data = NULL,
	.efuse_data_length = 0,
	.heic_image_capability = NULL,
	.hevc_image_capability = NULL,
	.sku_version = 0,
	.vpu_ver = VPU_VERSION_4,
};
@@ -802,8 +782,6 @@ static struct msm_vidc_platform_data sdm670_data = {
	.csc_data.vpe_csc_custom_limit_coeff = vpe_csc_custom_limit_coeff,
	.efuse_data = sdm670_efuse_data,
	.efuse_data_length = ARRAY_SIZE(sdm670_efuse_data),
	.heic_image_capability = NULL,
	.hevc_image_capability = NULL,
	.sku_version = 0,
	.vpu_ver = VPU_VERSION_4,
};