From ddd1fc49b60822b29d476564a4b8509565cc51ab Mon Sep 17 00:00:00 2001 From: Stanimir Varbanov Date: Wed, 11 Nov 2020 15:37:51 +0100 Subject: [PATCH] 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 --- drivers/media/platform/qcom/venus/helpers.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/media/platform/qcom/venus/helpers.c b/drivers/media/platform/qcom/venus/helpers.c index c2a82cf43361..11f35e36149b 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); } -- 2.11.0