summaryrefslogtreecommitdiff
path: root/drivers/media/platform/amphion/vpu_v4l2.c
diff options
context:
space:
mode:
authorMing Qian <ming.qian@nxp.com>2022-06-28 08:21:12 +0300
committerMauro Carvalho Chehab <mchehab@kernel.org>2022-07-08 20:13:03 +0300
commitafba6e20801ad9a2f863c52c21e609e021269d83 (patch)
treeab8b0edd80933806384e34443a03e84f1337884c /drivers/media/platform/amphion/vpu_v4l2.c
parentfe3d651627d61210c6905339e5281d3b9db75033 (diff)
downloadlinux-afba6e20801ad9a2f863c52c21e609e021269d83.tar.xz
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: 6de8d628df6ef ("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>
Diffstat (limited to 'drivers/media/platform/amphion/vpu_v4l2.c')
-rw-r--r--drivers/media/platform/amphion/vpu_v4l2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/platform/amphion/vpu_v4l2.c b/drivers/media/platform/amphion/vpu_v4l2.c
index da455e5ab337..8a3eed957ae6 100644
--- a/drivers/media/platform/amphion/vpu_v4l2.c
+++ b/drivers/media/platform/amphion/vpu_v4l2.c
@@ -500,8 +500,8 @@ static int vpu_vb2_start_streaming(struct vb2_queue *q, unsigned int count)
fmt->sizeimage[1], fmt->bytesperline[1],
fmt->sizeimage[2], fmt->bytesperline[2],
q->num_buffers);
- ret = call_vop(inst, start, q->type);
vb2_clear_last_buffer_dequeued(q);
+ ret = call_vop(inst, start, q->type);
if (ret)
vpu_vb2_buffers_return(inst, q->type, VB2_BUF_STATE_QUEUED);