From: Stanimir Varbanov Date: Wed, 11 Nov 2020 14:37:52 +0000 (+0100) Subject: media: venus: pm_helpers: Check instance state when calculate instance frequency X-Git-Tag: v5.10.237~81 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=024fe3ea24b7330519562eca44ca5773b658ad0f;p=thirdparty%2Fkernel%2Fstable.git media: venus: pm_helpers: Check instance state when calculate instance frequency [ Upstream commit d33a94412ed1081f30d904cab54faea7c7b839fc ] Skip calculating instance frequency if it is not in running state. Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab Stable-dep-of: 9edaaa8e3e15 ("media: venus: hfi_parser: refactor hfi packet parsing logic") Signed-off-by: Sasha Levin --- diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index fd55352d743ee..12c5811fefdf9 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -937,6 +937,9 @@ static unsigned long calculate_inst_freq(struct venus_inst *inst, mbs_per_sec = load_per_instance(inst) / fps; + 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;