media: vb2: fix VBI/poll regression
authorHans Verkuil <hans.verkuil@cisco.com>
Sat, 20 Sep 2014 19:16:35 +0000 (16:16 -0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Oct 2014 19:21:27 +0000 (12:21 -0700)
commitcbb87efb98dfabed6dd73b040f25badeaf319960
tree560d9c5105679d9604994ab10d15edd0281a2def
parent5f50c44d8a63ee6c4801cdcb372b8048ac77efcf
media: vb2: fix VBI/poll regression

commit 58d75f4b1ce26324b4d809b18f94819843a98731 upstream.

The recent conversion of saa7134 to vb2 unconvered a poll() bug that
broke the teletext applications alevt and mtt. These applications
expect that calling poll() without having called VIDIOC_STREAMON will
cause poll() to return POLLERR. That did not happen in vb2.

This patch fixes that behavior. It also fixes what should happen when
poll() is called when STREAMON is called but no buffers have been
queued. In that case poll() will also return POLLERR, but only for
capture queues since output queues will always return POLLOUT
anyway in that situation.

This brings the vb2 behavior in line with the old videobuf behavior.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/v4l2-core/videobuf2-core.c
include/media/videobuf2-core.h