diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-13 17:40:30 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 16:04:57 -0500 |
commit | 1f8d30083abc17897b897787c39d446eb9d99fe0 (patch) | |
tree | 5f286b1c8b2d95446cba0b8f9e3834fc27528d25 /drivers/media/video | |
parent | dfd8c04ec14b88bc2849e62d6ff9e36f31352b60 (diff) |
V4L/DVB (7023): Fix a regresion left by changeset 7e65d6e8f6df
Changeset 7e65d6e8f6df removed a very bad hack on mmap(). However, the fixes
weren't considering usermap and overlay memory models. This were breaking
direct reading from /dev/video?, used mostly by mpeg aware drivers.
Thanks to Steven Toth <stoth@linuxtv.org> for reporting the issue and
bissecting it.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/videobuf-core.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/media/video/videobuf-core.c b/drivers/media/video/videobuf-core.c index c3adbd686ffe..80a14da9acef 100644 --- a/drivers/media/video/videobuf-core.c +++ b/drivers/media/video/videobuf-core.c | |||
@@ -102,10 +102,14 @@ int videobuf_iolock(struct videobuf_queue *q, struct videobuf_buffer *vb, | |||
102 | since mmap_mapper() method should be called before _iolock. | 102 | since mmap_mapper() method should be called before _iolock. |
103 | On some cases, the mmap_mapper() is called only after scheduling. | 103 | On some cases, the mmap_mapper() is called only after scheduling. |
104 | */ | 104 | */ |
105 | wait_event_timeout(vb->done, q->is_mmapped, msecs_to_jiffies(100)); | 105 | if (vb->memory == V4L2_MEMORY_MMAP) { |
106 | if (!q->is_mmapped) { | 106 | wait_event_timeout(vb->done, q->is_mmapped, |
107 | printk(KERN_ERR "Error: mmap_mapper() never called!\n"); | 107 | msecs_to_jiffies(100)); |
108 | return -EINVAL; | 108 | if (!q->is_mmapped) { |
109 | printk(KERN_ERR | ||
110 | "Error: mmap_mapper() never called!\n"); | ||
111 | return -EINVAL; | ||
112 | } | ||
109 | } | 113 | } |
110 | 114 | ||
111 | return CALL(q, iolock, q, vb, fbuf); | 115 | return CALL(q, iolock, q, vb, fbuf); |