From: Stanimir Varbanov Date: Wed, 11 Nov 2020 14:37:51 +0000 (+0100) Subject: media: venus: helpers: Calculate properly compressed buffer size X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=ddd1fc49b60822b29d476564a4b8509565cc51ab;p=linux.git media: venus: helpers: Calculate properly compressed buffer size 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 Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index c2a82cf433610..11f35e36149b7 100644 --- a/drivers/media/platform/qcom/venus/helpers.c +++ b/drivers/media/platform/qcom/venus/helpers.c @@ -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); }