Commit 46431d9c authored by Hans Verkuil's avatar Hans Verkuil Committed by Greg Kroah-Hartman

media: videobuf2-core: don't call memop 'finish' when queueing

[ Upstream commit 90b2da89 ]

When a buffer is queued or requeued in vb2_buffer_done, then don't
call the finish memop. In this case the buffer is only returned to vb2,
not to userspace.

Calling 'finish' here will cause an unbalance when the queue is
canceled, since the core will call the same memop again.
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b5326119
...@@ -870,9 +870,12 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state) ...@@ -870,9 +870,12 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state)
dprintk(4, "done processing on buffer %d, state: %d\n", dprintk(4, "done processing on buffer %d, state: %d\n",
vb->index, state); vb->index, state);
if (state != VB2_BUF_STATE_QUEUED &&
state != VB2_BUF_STATE_REQUEUEING) {
/* sync buffers */ /* sync buffers */
for (plane = 0; plane < vb->num_planes; ++plane) for (plane = 0; plane < vb->num_planes; ++plane)
call_void_memop(vb, finish, vb->planes[plane].mem_priv); call_void_memop(vb, finish, vb->planes[plane].mem_priv);
}
spin_lock_irqsave(&q->done_lock, flags); spin_lock_irqsave(&q->done_lock, flags);
if (state == VB2_BUF_STATE_QUEUED || if (state == VB2_BUF_STATE_QUEUED ||
......
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