msm: vidc: Force nominal for high bitrate decode usecases

Force the clocks to NOM if bitrate nears or exceeds maximum
supported for VP9 usecases.

Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>

Change-Id: I917b0f6c624837403fd9f1499a68812acb00b568
This commit is contained in:
Chinmay Sawarkar 2020-09-17 14:35:54 -07:00
commit 2efb0193b3

View file

@ -679,6 +679,7 @@ static unsigned long msm_vidc_calc_freq_iris2(struct msm_vidc_inst *inst,
u32 operating_rate, vsp_factor_num = 1, vsp_factor_den = 1;
u32 base_cycles = 0;
u32 codec = 0;
u64 bitrate = 0;
core = inst->core;
dcvs = &inst->clk_data;
@ -768,7 +769,8 @@ static unsigned long msm_vidc_calc_freq_iris2(struct msm_vidc_inst *inst,
codec = get_v4l2_codec(inst);
base_cycles = inst->has_bframe ?
80 : inst->clk_data.entry->vsp_cycles;
vsp_cycles = fps * filled_len * 8;
bitrate = fps * filled_len * 8;
vsp_cycles = bitrate;
if (codec == V4L2_PIX_FMT_VP9) {
vsp_cycles = div_u64(vsp_cycles * 170, 100);
@ -786,6 +788,11 @@ static unsigned long msm_vidc_calc_freq_iris2(struct msm_vidc_inst *inst,
vsp_cycles += mbs_per_second * base_cycles;
if (codec == V4L2_PIX_FMT_VP9 &&
inst->clk_data.work_mode == HFI_WORKMODE_2 &&
inst->clk_data.work_route == 4 &&
bitrate > 90000000)
vsp_cycles = msm_vidc_max_freq(inst->core, inst->sid);
} else {
s_vpr_e(inst->sid, "%s: Unknown session type\n", __func__);
return msm_vidc_max_freq(inst->core, inst->sid);