msm: vidc: check for cvp support

check for cvp support before any cvp
related operation.

CRs-Fixed: 2741030
Change-Id: I7a457608321f0aa5b93b6f62d7ceb76c0b00fb93
Signed-off-by: Manikanta Kanamarlapudi <kmanikan@codeaurora.org>
This commit is contained in:
Manikanta Kanamarlapudi 2020-07-15 22:55:12 +05:30
commit 7ae805aa63
6 changed files with 23 additions and 0 deletions

View file

@ -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;

View file

@ -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;

View file

@ -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)
{

View file

@ -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[] = {

View file

@ -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;

View file

@ -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)