Loading drivers/media/platform/msm/vidc/msm_venc.c +1 −0 Original line number Diff line number Diff line Loading @@ -1607,6 +1607,7 @@ 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); Loading drivers/media/platform/msm/vidc/msm_vidc_common.c +64 −0 Original line number Diff line number Diff line Loading @@ -5646,6 +5646,65 @@ 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; Loading Loading @@ -5691,6 +5750,11 @@ 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); Loading drivers/media/platform/msm/vidc/msm_vidc_internal.h +12 −0 Original line number Diff line number Diff line Loading @@ -231,6 +231,16 @@ 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, Loading @@ -252,6 +262,8 @@ 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; }; Loading drivers/media/platform/msm/vidc/msm_vidc_platform.c +24 −0 Original line number Diff line number Diff line Loading @@ -753,6 +753,14 @@ static struct msm_vidc_ubwc_config sdmshrike_ubwc_data[] = { HFI_PROPERTY_SYS_UBWC_CONFIG, 1, 0, 1, 0, 8, 0, 16, 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), Loading @@ -765,6 +773,8 @@ 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, }; Loading @@ -781,6 +791,8 @@ static struct msm_vidc_platform_data atoll_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, }; Loading @@ -797,6 +809,8 @@ 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, }; Loading @@ -813,6 +827,8 @@ 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, }; Loading @@ -829,6 +845,8 @@ 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, }; Loading Loading @@ -861,6 +879,8 @@ 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, }; Loading @@ -877,6 +897,8 @@ 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, }; Loading @@ -893,6 +915,8 @@ 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, }; Loading Loading
drivers/media/platform/msm/vidc/msm_venc.c +1 −0 Original line number Diff line number Diff line Loading @@ -1607,6 +1607,7 @@ 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); Loading
drivers/media/platform/msm/vidc/msm_vidc_common.c +64 −0 Original line number Diff line number Diff line Loading @@ -5646,6 +5646,65 @@ 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; Loading Loading @@ -5691,6 +5750,11 @@ 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); Loading
drivers/media/platform/msm/vidc/msm_vidc_internal.h +12 −0 Original line number Diff line number Diff line Loading @@ -231,6 +231,16 @@ 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, Loading @@ -252,6 +262,8 @@ 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; }; Loading
drivers/media/platform/msm/vidc/msm_vidc_platform.c +24 −0 Original line number Diff line number Diff line Loading @@ -753,6 +753,14 @@ static struct msm_vidc_ubwc_config sdmshrike_ubwc_data[] = { HFI_PROPERTY_SYS_UBWC_CONFIG, 1, 0, 1, 0, 8, 0, 16, 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), Loading @@ -765,6 +773,8 @@ 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, }; Loading @@ -781,6 +791,8 @@ static struct msm_vidc_platform_data atoll_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, }; Loading @@ -797,6 +809,8 @@ 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, }; Loading @@ -813,6 +827,8 @@ 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, }; Loading @@ -829,6 +845,8 @@ 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, }; Loading Loading @@ -861,6 +879,8 @@ 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, }; Loading @@ -877,6 +897,8 @@ 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, }; Loading @@ -893,6 +915,8 @@ 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, }; Loading