media: venus: pm_helpers: Check instance state when calculate instance frequency

Skip calculating instance frequency if it is not in running state.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Stanimir Varbanov 2020-11-11 15:37:52 +01:00 committed by Mauro Carvalho Chehab
parent ddd1fc49b6
commit d33a94412e
1 changed files with 3 additions and 0 deletions

View File

@ -939,6 +939,9 @@ static unsigned long calculate_inst_freq(struct venus_inst *inst,
mbs_per_sec = load_per_instance(inst);
if (inst->state != INST_START)
return 0;
vpp_freq = mbs_per_sec * inst->clk_data.codec_freq_data->vpp_freq;
/* 21 / 20 is overhead factor */
vpp_freq += vpp_freq / 20;