Skip to content

Commit

Permalink
[media] media: vb2: return for polling if a buffer is available
Browse files Browse the repository at this point in the history
The vb2_poll() does not need to wait next vb_buffer_done() if there is already
a buffer in done_list of queue, but current vb2_poll() always waits.
So done_list is checked before calling poll_wait().

Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Seung-Woo Kim authored and Mauro Carvalho Chehab committed Jun 3, 2013
1 parent e9d98dd commit 412cb87
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/media/v4l2-core/videobuf2-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2014,7 +2014,8 @@ unsigned int vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait)
if (list_empty(&q->queued_list))
return res | POLLERR;

poll_wait(file, &q->done_wq, wait);
if (list_empty(&q->done_list))
poll_wait(file, &q->done_wq, wait);

/*
* Take first buffer available for dequeuing.
Expand Down

0 comments on commit 412cb87

Please sign in to comment.