Skip to content

Commit

Permalink
V4L/DVB: videobuf: make poll() report proper flags for output video d…
Browse files Browse the repository at this point in the history
…evices

According to the V4L2 specification, poll() should set POLLOUT | POLLWRNORM
flags for output devices after the frame has been displayed.

Signed-off-by: Pawel Osciak <p.osciak@samsung.com>
Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Pawel Osciak authored and Mauro Carvalho Chehab committed May 19, 2010
1 parent fc7f8fd commit 9b55843
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions drivers/media/video/videobuf-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1120,8 +1120,18 @@ unsigned int videobuf_poll_stream(struct file *file,
if (0 == rc) {
poll_wait(file, &buf->done, wait);
if (buf->state == VIDEOBUF_DONE ||
buf->state == VIDEOBUF_ERROR)
rc = POLLIN|POLLRDNORM;
buf->state == VIDEOBUF_ERROR) {
switch (q->type) {
case V4L2_BUF_TYPE_VIDEO_OUTPUT:
case V4L2_BUF_TYPE_VBI_OUTPUT:
case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT:
rc = POLLOUT | POLLWRNORM;
break;
default:
rc = POLLIN | POLLRDNORM;
break;
}
}
}
mutex_unlock(&q->vb_lock);
return rc;
Expand Down

0 comments on commit 9b55843

Please sign in to comment.