From: Vikash Garodia Date: Wed, 31 Mar 2021 09:28:22 +0000 (+0200) Subject: media: venus: helpers: keep max bandwidth when mbps exceeds the supported range X-Git-Tag: v5.13-rc1~124^2~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7bf28a2153ea3cc8362d78a76e1bccf06ce7805d;p=thirdparty%2Fkernel%2Flinux.git media: venus: helpers: keep max bandwidth when mbps exceeds the supported range When the video usecase have macro blocks per sec which is more than supported, keep the required bus bandwidth as the maximum supported. Signed-off-by: Vikash Garodia Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/qcom/venus/pm_helpers.c b/drivers/media/platform/qcom/venus/pm_helpers.c index abb4b69783b23..c7e1ebec47eea 100644 --- a/drivers/media/platform/qcom/venus/pm_helpers.c +++ b/drivers/media/platform/qcom/venus/pm_helpers.c @@ -201,7 +201,7 @@ static void mbs_to_bw(struct venus_inst *inst, u32 mbs, u32 *avg, u32 *peak) return; for (i = 0; i < num_rows; i++) { - if (mbs > bw_tbl[i].mbs_per_sec) + if (i != 0 && mbs > bw_tbl[i].mbs_per_sec) break; if (inst->dpb_fmt & HFI_COLOR_FORMAT_10_BIT_BASE) {