[media] media: vb2: return for polling if a buffer is available

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>
This commit is contained in:
Seung-Woo Kim 2013-05-20 23:47:29 -03:00 committed by Mauro Carvalho Chehab
parent e9d98ddc0a
commit 412cb87d28
1 changed files with 2 additions and 1 deletions

View File

@ -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.