diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2013-01-30 16:29:02 (GMT) |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-02-05 20:22:15 (GMT) |
commit | cd13823f5db3e66552801c04f0e761408ef17eb0 (patch) | |
tree | 78bc3dac7efc1db8129a759f44718bcabb8ea771 /drivers/media/v4l2-core | |
parent | 971dfc678114d61c07bd6f8ff8380558b6e12d5d (diff) | |
download | linux-fsl-qoriq-cd13823f5db3e66552801c04f0e761408ef17eb0.tar.xz |
[media] videobuf2: don't return POLLERR when only polling for events
If you only poll for events, then vb2_poll will return POLLPRI | POLLERR if
no streaming is in progress. That's not right, it's perfectly valid to
poll just for events.
Cc: Pawel Osciak <pawel@osciak.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/v4l2-core')
-rw-r--r-- | drivers/media/v4l2-core/videobuf2-core.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c index d09be38..db1235d 100644 --- a/drivers/media/v4l2-core/videobuf2-core.c +++ b/drivers/media/v4l2-core/videobuf2-core.c @@ -1965,6 +1965,11 @@ unsigned int vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait) poll_wait(file, &fh->wait, wait); } + if (!V4L2_TYPE_IS_OUTPUT(q->type) && !(req_events & (POLLIN | POLLRDNORM))) + return res; + if (V4L2_TYPE_IS_OUTPUT(q->type) && !(req_events & (POLLOUT | POLLWRNORM))) + return res; + /* * Start file I/O emulator only if streaming API has not been used yet. */ |