aboutsummaryrefslogtreecommitdiffstats
path: root/include/media
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-09-20 15:16:35 -0400
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2014-09-21 19:57:30 -0400
commit58d75f4b1ce26324b4d809b18f94819843a98731 (patch)
tree9a8fbc40c7119ff9d6284d25d373b88fdb643312 /include/media
parent50394e7369d519ad0d732cb6913d2bbdf4213e2e (diff)
[media] vb2: fix VBI/poll regression
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>
Diffstat (limited to 'include/media')
-rw-r--r--include/media/videobuf2-core.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
index 80fa7253e483..2fefcf491aa8 100644
--- a/include/media/videobuf2-core.h
+++ b/include/media/videobuf2-core.h
@@ -380,6 +380,9 @@ struct v4l2_fh;
380 * @start_streaming_called: start_streaming() was called successfully and we 380 * @start_streaming_called: start_streaming() was called successfully and we
381 * started streaming. 381 * started streaming.
382 * @error: a fatal error occurred on the queue 382 * @error: a fatal error occurred on the queue
383 * @waiting_for_buffers: used in poll() to check if vb2 is still waiting for
384 * buffers. Only set for capture queues if qbuf has not yet been
385 * called since poll() needs to return POLLERR in that situation.
383 * @fileio: file io emulator internal data, used only if emulator is active 386 * @fileio: file io emulator internal data, used only if emulator is active
384 * @threadio: thread io internal data, used only if thread is active 387 * @threadio: thread io internal data, used only if thread is active
385 */ 388 */
@@ -417,6 +420,7 @@ struct vb2_queue {
417 unsigned int streaming:1; 420 unsigned int streaming:1;
418 unsigned int start_streaming_called:1; 421 unsigned int start_streaming_called:1;
419 unsigned int error:1; 422 unsigned int error:1;
423 unsigned int waiting_for_buffers:1;
420 424
421 struct vb2_fileio_data *fileio; 425 struct vb2_fileio_data *fileio;
422 struct vb2_threadio_data *threadio; 426 struct vb2_threadio_data *threadio;