media: hantro: Implement support for encoder commands
authorChen-Yu Tsai <wenst@chromium.org>
Thu, 31 Mar 2022 09:16:28 +0000 (10:16 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sun, 24 Apr 2022 07:52:26 +0000 (08:52 +0100)
commitdaf3999c12dcef14151710052fca9adfbc3967bc
tree47d6d79dc7916550e6b0720a988e8993ce4b05c4
parentacd134bca2ac4390eb4920d54bdfeecc7fe47bcb
media: hantro: Implement support for encoder commands

The V4L2 stateful encoder uAPI specification requires that drivers
support the ENCODER_CMD ioctl to allow draining of buffers. This
however was not implemented, and causes issues for some userspace
applications.

Implement support for the ENCODER_CMD ioctl using v4l2-mem2mem helpers.
This is entirely based on existing code found in the vicodec test
driver.

Fixes: 775fec69008d ("media: add Rockchip VPU JPEG encoder driver")
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_drv.c
drivers/staging/media/hantro/hantro_v4l2.c