media: hantro: postproc: Fix buffer size calculation
authorJernej Skrabec <jernej.skrabec@gmail.com>
Wed, 6 Jul 2022 18:28:57 +0000 (19:28 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sun, 17 Jul 2022 10:00:05 +0000 (11:00 +0100)
commitb273deab2bac4edc5db6314e7b5f9a16a7e73440
tree51335df51ee0bd78af27c067bf308bfeb8366b91
parent8d03c2ab881b3d891380629f4be83cb2a9f66964
media: hantro: postproc: Fix buffer size calculation

When allocating aux buffers for postprocessing, it's assumed that base
buffer size is the same as that of output. Coincidentally, that's true
most of the time, but not always. 10-bit source also needs aux buffer
size which is appropriate for 10-bit native format, even if the output
format is 8-bit. Similarly, mv sizes and other extra buffer size also
depends on source width/height, not destination.

Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Tested-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/hantro/hantro_postproc.c
drivers/staging/media/hantro/hantro_v4l2.c
drivers/staging/media/hantro/hantro_v4l2.h