OSDN Git Service

media: venus: helpers: Calculate properly compressed buffer size
authorStanimir Varbanov <stanimir.varbanov@linaro.org>
Wed, 11 Nov 2020 14:37:51 +0000 (15:37 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 13 Jan 2021 08:08:53 +0000 (09:08 +0100)
For resolutions below 720p the size of the compressed buffer must
be bigger. Correct this by checking the resolution when calculating
buffer size and multiply by eight.

Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/qcom/venus/helpers.c

index c2a82cf..11f35e3 100644 (file)
@@ -986,6 +986,8 @@ u32 venus_helper_get_framesz(u32 v4l2_fmt, u32 width, u32 height)
 
        if (compressed) {
                sz = ALIGN(height, 32) * ALIGN(width, 32) * 3 / 2 / 2;
+               if (width < 1280 || height < 720)
+                       sz *= 8;
                return ALIGN(sz, SZ_4K);
        }