Skip to content

Commit

Permalink
media: venus: fix vpp frequency calculation for decoder
Browse files Browse the repository at this point in the history
In existing video driver implementation vpp frequency calculation in
calculate_inst_freq() is always zero because the value of vpp_freq_per_mb
is always zero for decoder.

Fixed this by correcting the calculating the vpp frequency calculation for
decoder.

Fixes: 3cfe581 ("media: venus: Enable low power setting for encoder")
Signed-off-by: Mansur Alisha Shaik <mansur@codeaurora.org>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
  • Loading branch information
Mansur Alisha Shaik authored and Mauro Carvalho Chehab committed Oct 8, 2021
1 parent 8c404eb commit 1444232
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/media/platform/qcom/venus/pm_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -1085,12 +1085,16 @@ static unsigned long calculate_inst_freq(struct venus_inst *inst,
if (inst->state != INST_START)
return 0;

if (inst->session_type == VIDC_SESSION_TYPE_ENC)
if (inst->session_type == VIDC_SESSION_TYPE_ENC) {
vpp_freq_per_mb = inst->flags & VENUS_LOW_POWER ?
inst->clk_data.low_power_freq :
inst->clk_data.vpp_freq;

vpp_freq = mbs_per_sec * vpp_freq_per_mb;
vpp_freq = mbs_per_sec * vpp_freq_per_mb;
} else {
vpp_freq = mbs_per_sec * inst->clk_data.vpp_freq;
}

/* 21 / 20 is overhead factor */
vpp_freq += vpp_freq / 20;
vsp_freq = mbs_per_sec * inst->clk_data.vsp_freq;
Expand Down

0 comments on commit 1444232

Please sign in to comment.