diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c index f33508f854a4..c359006074a8 100644 --- a/drivers/media/v4l2-core/videobuf2-core.c +++ b/drivers/media/v4l2-core/videobuf2-core.c @@ -2596,6 +2596,13 @@ unsigned int vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait) if ((list_empty(&q->queued_list) && !vb2_is_streaming(q)) || q->error) return res | POLLERR; + /* + * For output streams you can write as long as there are fewer buffers + * queued than there are buffers available. + */ + if (V4L2_TYPE_IS_OUTPUT(q->type) && q->queued_count < q->num_buffers) + return res | POLLOUT | POLLWRNORM; + if (list_empty(&q->done_list)) poll_wait(file, &q->done_wq, wait);