diff --git a/msm/vidc/msm_venc.c b/msm/vidc/msm_venc.c index ef75cc28987e..cf7b502ce8f5 100644 --- a/msm/vidc/msm_venc.c +++ b/msm/vidc/msm_venc.c @@ -4607,6 +4607,12 @@ int msm_venc_set_cvp_skipratio(struct msm_vidc_inst *inst) d_vpr_e("%s: invalid params %pK\n", __func__, inst); return -EINVAL; } + + if (!is_cvp_supported(inst)) { + s_vpr_h(inst->sid, "%s cvp is not supported", __func__); + return rc; + } + if (!msm_vidc_cvp_usage) return 0; diff --git a/msm/vidc/msm_vidc.c b/msm/vidc/msm_vidc.c index 3f789a4afe46..d0d6b128983a 100644 --- a/msm/vidc/msm_vidc.c +++ b/msm/vidc/msm_vidc.c @@ -794,6 +794,11 @@ static bool msm_vidc_set_cvp_metadata(struct msm_vidc_inst *inst) { return false; } + if (!is_cvp_supported(inst)) { + s_vpr_h(inst->sid, "%s cvp is not supported", __func__); + return true; + } + if (inst->prop.extradata_ctrls & EXTRADATA_ENC_INPUT_CVP) value = 0x1; diff --git a/msm/vidc/msm_vidc_common.h b/msm/vidc/msm_vidc_common.h index 98287b8570e7..7be37c5cb70f 100644 --- a/msm/vidc/msm_vidc_common.h +++ b/msm/vidc/msm_vidc_common.h @@ -59,6 +59,11 @@ static inline bool is_low_power_session(struct msm_vidc_inst *inst) return !!(inst->flags & VIDC_LOW_POWER); } +static inline bool is_cvp_supported(struct msm_vidc_inst *inst) +{ + return inst->core && !inst->core->resources.no_cvp; +} + static inline struct v4l2_ctrl *get_ctrl(struct msm_vidc_inst *inst, u32 id) { diff --git a/msm/vidc/msm_vidc_platform.c b/msm/vidc/msm_vidc_platform.c index f5ea2f69e633..473c3e934208 100644 --- a/msm/vidc/msm_vidc_platform.c +++ b/msm/vidc/msm_vidc_platform.c @@ -1398,6 +1398,10 @@ static struct msm_vidc_common_data holi_common_data[] = { .key = "qcom,fw-vpp-cycles", .value = 225975, }, + { + .key = "qcom,no-cvp", + .value = 1, + }, }; static struct msm_vidc_efuse_data shima_efuse_data[] = { diff --git a/msm/vidc/msm_vidc_res_parse.c b/msm/vidc/msm_vidc_res_parse.c index 0e14602d8f3d..1e17830ff333 100644 --- a/msm/vidc/msm_vidc_res_parse.c +++ b/msm/vidc/msm_vidc_res_parse.c @@ -813,6 +813,8 @@ int read_platform_resources_from_drv_data( "qcom,vpp_delay_supported"); res->enc_auto_dynamic_fps = find_key_value(platform_data, "qcom,enc_auto_dynamic_fps"); + res->no_cvp = find_key_value(platform_data, + "qcom,no-cvp"); res->csc_coeff_data = &platform_data->csc_data; diff --git a/msm/vidc/msm_vidc_resources.h b/msm/vidc/msm_vidc_resources.h index d7c8ee88b887..5add5ec54373 100644 --- a/msm/vidc/msm_vidc_resources.h +++ b/msm/vidc/msm_vidc_resources.h @@ -206,6 +206,7 @@ struct msm_vidc_platform_resources { uint32_t ubwc_stats_in_fbd; uint32_t has_vpp_delay; bool enc_auto_dynamic_fps; + bool no_cvp; }; static inline bool is_iommu_present(struct msm_vidc_platform_resources *res)