media: amphion: reinit vpu if reqbufs output 0
authorMing Qian <ming.qian@nxp.com>
Tue, 13 Jun 2023 07:48:46 +0000 (15:48 +0800)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Tue, 25 Jul 2023 07:31:48 +0000 (09:31 +0200)
commit73e3f09292a0492a3fe0f87a8170a74f12624c5e
tree27fccea86e1270a792703503776a4f88e6d79e58
parentc62b089163ce89c7c0c471854ca01763c13813dd
media: amphion: reinit vpu if reqbufs output 0

according to v4l2 stateful decoder document 4.5.1.3. State Machine,
the state should change from seek to initialization
if call VIDIOC_REQBUFS(OUTPUT, 0).

so reinit the vpu decoder if reqbufs output 0

Fixes: 6de8d628df6e ("media: amphion: add v4l2 m2m vpu decoder stateful driver")
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Tested-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/platform/amphion/vdec.c
drivers/media/platform/amphion/vpu_v4l2.c