Skip to content

Commit

Permalink
V4L/DVB: uvcvideo: Use POLLOUT and POLLWRNORM for output devices
Browse files Browse the repository at this point in the history
The V4L2 specification requires drivers to use the write events in the
file operations poll handler for output devices. The uvcvideo driver
erroneously used read events for all devices. Fix this.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Laurent Pinchart authored and Mauro Carvalho Chehab committed May 18, 2010
1 parent 35a00c4 commit ed3de60
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions drivers/media/video/uvc/uvc_queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,12 @@ unsigned int uvc_queue_poll(struct uvc_video_queue *queue, struct file *file,

poll_wait(file, &buf->wait, wait);
if (buf->state == UVC_BUF_STATE_DONE ||
buf->state == UVC_BUF_STATE_ERROR)
mask |= POLLIN | POLLRDNORM;
buf->state == UVC_BUF_STATE_ERROR) {
if (queue->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
mask |= POLLIN | POLLRDNORM;
else
mask |= POLLOUT | POLLWRNORM;
}

done:
mutex_unlock(&queue->mutex);
Expand Down

0 comments on commit ed3de60

Please sign in to comment.