From: Pawel Osciak
Date: Mon, 29 Mar 2010 08:16:31 +0000 (-0300)
Subject: V4L/DVB: videobuf: make poll() report proper flags for output video devices
X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=9b558434136138edc79710385aaf613cb4b30459;p=deliverable%2Flinux.git
V4L/DVB: videobuf: make poll() report proper flags for output video devices
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
Reviewed-by: Kyungmin Park
Reviewed-by: Hans Verkuil
Signed-off-by: Mauro Carvalho Chehab
---
diff --git a/drivers/media/video/videobuf-core.c b/drivers/media/video/videobuf-core.c
index f47cf1ca1239..7d3378437ded 100644
--- a/drivers/media/video/videobuf-core.c
+++ b/drivers/media/video/videobuf-core.c
@@ -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;