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 <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Stanimir Varbanov 2020-11-11 15:37:51 +01:00 committed by Mauro Carvalho Chehab
parent e922a33e02
commit ddd1fc49b6
1 changed files with 2 additions and 0 deletions

View 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);
}