Commit 26989c27 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

media: videobuf2-v4l2: set last_buffer_dequeued in dqbuf

last_buffer_dequeued was set to true in __fill_v4l2_buffer, but this
is called for qbuf as well. Move it to vb2_dqbuf.
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 6eb9b758
...@@ -563,11 +563,6 @@ static void __fill_v4l2_buffer(struct vb2_buffer *vb, void *pb) ...@@ -563,11 +563,6 @@ static void __fill_v4l2_buffer(struct vb2_buffer *vb, void *pb)
b->flags |= V4L2_BUF_FLAG_REQUEST_FD; b->flags |= V4L2_BUF_FLAG_REQUEST_FD;
b->request_fd = vbuf->request_fd; b->request_fd = vbuf->request_fd;
} }
if (!q->is_output &&
b->flags & V4L2_BUF_FLAG_DONE &&
b->flags & V4L2_BUF_FLAG_LAST)
q->last_buffer_dequeued = true;
} }
/* /*
...@@ -786,6 +781,11 @@ int vb2_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool nonblocking) ...@@ -786,6 +781,11 @@ int vb2_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b, bool nonblocking)
ret = vb2_core_dqbuf(q, NULL, b, nonblocking); ret = vb2_core_dqbuf(q, NULL, b, nonblocking);
if (!q->is_output &&
b->flags & V4L2_BUF_FLAG_DONE &&
b->flags & V4L2_BUF_FLAG_LAST)
q->last_buffer_dequeued = true;
/* /*
* After calling the VIDIOC_DQBUF V4L2_BUF_FLAG_DONE must be * After calling the VIDIOC_DQBUF V4L2_BUF_FLAG_DONE must be
* cleared. * cleared.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment