]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: venus: helpers: keep max bandwidth when mbps exceeds the supported range
authorVikash Garodia <vgarodia@codeaurora.org>
Wed, 31 Mar 2021 09:28:22 +0000 (11:28 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 15 Apr 2021 11:13:23 +0000 (13:13 +0200)
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 <vgarodia@codeaurora.org>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/qcom/venus/pm_helpers.c

index abb4b69783b23e87f6f45ed22a3d64bf78438e4c..c7e1ebec47eeaab164d3f101d387a0cfde6c6ac4 100644 (file)
@@ -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) {