]> git.baikalelectronics.ru Git - kernel.git/commit
media: amphion: defer setting last_buffer_dequeued until resolution changes are processed
authorMing Qian <ming.qian@nxp.com>
Tue, 28 Jun 2022 05:21:12 +0000 (06:21 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Fri, 8 Jul 2022 17:13:03 +0000 (18:13 +0100)
commitc029433d190d7f4272a09c085732b2d5137d6bf2
treeab8b0edd80933806384e34443a03e84f1337884c
parent83e696daed42533aabe4d106bcc4d2c50e3553a9
media: amphion: defer setting last_buffer_dequeued until resolution changes are processed

Don't set last_buffer_dequeued during dynamic resolution change,
otherwise it may be cleared in handling resolution change,
as streamoff may be called in dynamic resolution change.

Normally, this does not happen.
But we encounter a special testcase,
User issue V4L2_DEC_CMD_STOP after enqueue one buffer
that only contains codec config header, but not any frame data.
So VPU report the parsed resolution, then report the eos event.

So driver should notify user to handle resolution change first,
after it's handled, set the last_buffer_dequeued.
then the user can exit decoding normally.

Otherwise the user may be stalled.

Fixes: 60bbaa0b159d2 ("media: amphion: add v4l2 m2m vpu decoder stateful driver")
Signed-off-by: Ming Qian <ming.qian@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/platform/amphion/vdec.c
drivers/media/platform/amphion/vpu_v4l2.c