diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-13 20:40:30 -0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-13 20:40:30 -0200 |
commit | 3074f9b68fb34b45932e9bb550a5234693eb6e04 (patch) | |
tree | 3840dd62878184a01fc0297e048bc4b7af78d554 /linux/drivers/media/video/videobuf-core.c | |
parent | e76427bffbcf128ab311a816734ecf6140546736 (diff) | |
download | mediapointer-dvb-s2-3074f9b68fb34b45932e9bb550a5234693eb6e04.tar.gz mediapointer-dvb-s2-3074f9b68fb34b45932e9bb550a5234693eb6e04.tar.bz2 |
Fix a regresion left by changeset 7e65d6e8f6df
From: Mauro Carvalho Chehab <mchehab@infradead.org>
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.
CC: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'linux/drivers/media/video/videobuf-core.c')
-rw-r--r-- | linux/drivers/media/video/videobuf-core.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/linux/drivers/media/video/videobuf-core.c b/linux/drivers/media/video/videobuf-core.c index 792099865..cf5033b68 100644 --- a/linux/drivers/media/video/videobuf-core.c +++ b/linux/drivers/media/video/videobuf-core.c @@ -103,10 +103,14 @@ int videobuf_iolock(struct videobuf_queue *q, struct videobuf_buffer *vb, since mmap_mapper() method should be called before _iolock. On some cases, the mmap_mapper() is called only after scheduling. */ - wait_event_timeout(vb->done, q->is_mmapped, msecs_to_jiffies(100)); - if (!q->is_mmapped) { - printk(KERN_ERR "Error: mmap_mapper() never called!\n"); - return -EINVAL; + if (vb->memory == V4L2_MEMORY_MMAP) { + wait_event_timeout(vb->done, q->is_mmapped, + msecs_to_jiffies(100)); + if (!q->is_mmapped) { + printk(KERN_ERR + "Error: mmap_mapper() never called!\n"); + return -EINVAL; + } } return CALL(q, iolock, q, vb, fbuf); |