summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorSasha Levin <sasha.levin@oracle.com>2016-02-01 19:27:06 +0300
committerSasha Levin <sasha.levin@oracle.com>2016-02-02 21:53:13 +0300
commit4357a54387ddeb8b39634fb80485975df481e91e (patch)
tree75447807d14ab4f3be644e2d7d6e5b34dc42ff67 /drivers/media
parentf641fdbd8ca737df49e96d9d58206fb0a9d82512 (diff)
downloadlinux-4357a54387ddeb8b39634fb80485975df481e91e.tar.xz
[media] vb2: fix a regression in poll() behavior for output,streams
[ Upstream commit 4623e5967448444a4ea1e77beb58898c4af48693 ] In the 3.17 kernel the poll() behavior changed for output streams: as long as not all buffers were queued up poll() would return that userspace can write. This is fine for the write() call, but when using stream I/O this changed the behavior since the expectation was that it would wait for buffers to become available for dequeuing. This patch only enables the check whether you can queue buffers for file I/O only, and skips it for stream I/O. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: <stable@vger.kernel.org> # for v3.17 and up Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/v4l2-core/videobuf2-core.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
index cc9537ef4829..1d1c4d35a1a6 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -2618,10 +2618,10 @@ unsigned int vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait)
return res | POLLERR;
/*
- * For output streams you can write as long as there are fewer buffers
- * queued than there are buffers available.
+ * For output streams you can call 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)
+ if (V4L2_TYPE_IS_OUTPUT(q->type) && q->fileio && q->queued_count < q->num_buffers)
return res | POLLOUT | POLLWRNORM;
if (list_empty(&q->done_list))