[media] vb2: fix a regression in poll() behavior for output,streams
authorSasha Levin <sasha.levin@oracle.com>
Mon, 1 Feb 2016 16:27:06 +0000 (11:27 -0500)
committerSasha Levin <sasha.levin@oracle.com>
Mon, 1 Feb 2016 16:27:13 +0000 (11:27 -0500)
commitb377c2be9c4cd3a8c422627d9964f257e6d0ed53
treee026fb6945d0a5d46431e6653d81f246c2307d77
parent3c0a63d74b4a12a0a98cd85b195031d8d4b109a6
[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>
drivers/media/v4l2-core/videobuf2-core.c