vb2: fix a regression in poll() behavior for output,streams 70/175670/1
authorSasha Levin <sasha.levin@oracle.com>
Mon, 1 Feb 2016 16:27:06 +0000 (11:27 -0500)
committerSeung-Woo Kim <sw0312.kim@samsung.com>
Wed, 11 Apr 2018 09:30:21 +0000 (18:30 +0900)
commit02aebd7e832f8aca8bee2e099c132a8a81cb1ec9
tree54874a14e35202cab06f4108f75ca5fd6f170db5
parent1d72bc7860933249a1ff7aaa06cfcb2fdff509d1
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>
[sw0312.kim: cherry-pick from linux-3.18.y]
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Change-Id: I6874d98e4881c059d592addb2e9767d398d82262
drivers/media/v4l2-core/videobuf2-core.c