Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 306084
b: refs/heads/master
c: bf5c7cb
h: refs/heads/master
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Mar 27, 2012
1 parent 66a237c commit 3a668c8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d0b66fdfd3c5c31764740f6ffe5a345549d6af97
refs/heads/master: bf5c7cbb996d6af51f8cc18a30ffa426196bf840
7 changes: 5 additions & 2 deletions trunk/drivers/media/video/videobuf2-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1647,6 +1647,7 @@ static int __vb2_cleanup_fileio(struct vb2_queue *q);
*/
unsigned int vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait)
{
unsigned long req_events = poll_requested_events(wait);
unsigned long flags;
unsigned int ret;
struct vb2_buffer *vb = NULL;
Expand All @@ -1655,12 +1656,14 @@ unsigned int vb2_poll(struct vb2_queue *q, struct file *file, poll_table *wait)
* Start file I/O emulator only if streaming API has not been used yet.
*/
if (q->num_buffers == 0 && q->fileio == NULL) {
if (!V4L2_TYPE_IS_OUTPUT(q->type) && (q->io_modes & VB2_READ)) {
if (!V4L2_TYPE_IS_OUTPUT(q->type) && (q->io_modes & VB2_READ) &&
(req_events & (POLLIN | POLLRDNORM))) {
ret = __vb2_init_fileio(q, 1);
if (ret)
return POLLERR;
}
if (V4L2_TYPE_IS_OUTPUT(q->type) && (q->io_modes & VB2_WRITE)) {
if (V4L2_TYPE_IS_OUTPUT(q->type) && (q->io_modes & VB2_WRITE) &&
(req_events & (POLLOUT | POLLWRNORM))) {
ret = __vb2_init_fileio(q, 0);
if (ret)
return POLLERR;
Expand Down

0 comments on commit 3a668c8

Please sign in to comment.