media: hantro: Empty encoder capture buffers by default
authorChen-Yu Tsai <wenst@chromium.org>
Thu, 31 Mar 2022 08:49:06 +0000 (09:49 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sun, 24 Apr 2022 07:52:45 +0000 (08:52 +0100)
commit309373a3571ef7175bd9da0c9b13476a718e8478
treedd669965bab203c8f087aa1f34ea3773c29e4c2b
parentdaf3999c12dcef14151710052fca9adfbc3967bc
media: hantro: Empty encoder capture buffers by default

The payload size for encoder capture buffers is set by the driver upon
finishing encoding each frame, based on the encoded length returned from
hardware, and whatever header and padding length used. Setting a
non-zero default serves no real purpose, and also causes issues if the
capture buffer is returned to userspace unused, confusing the
application.

Instead, always set the payload size to 0 for encoder capture buffers
when preparing them.

Fixes: 775fec69008d ("media: add Rockchip VPU JPEG encoder driver")
Fixes: 082aaecff35f ("media: hantro: Fix .buf_prepare")
Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/staging/media/hantro/hantro_v4l2.c