]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:22:49 +0000 (10:22 +0200)
commit20393baf4664de49876c33d24dfc196d0f863ebf
tree593d6870108a68d482d1a45fc141fa00d204afdc
parent8156d153d44a20276e7b5c662e58623d6ebbabbd
media: hantro: Empty encoder capture buffers by default

[ Upstream commit 1d52a492e44e86db57379cd18af9aae646c3fd18 ]

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: 6ef699ea68bb ("media: add Rockchip VPU JPEG encoder driver")
Fixes: cc52ee20011b ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/media/hantro/hantro_v4l2.c