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>
This commit is contained in:
parent
dfd8c04ec1
commit
1f8d30083a
1 changed files with 8 additions and 4 deletions
|
@ -102,10 +102,14 @@ int videobuf_iolock(struct videobuf_queue *q, struct videobuf_buffer *vb,
|
||||||
since mmap_mapper() method should be called before _iolock.
|
since mmap_mapper() method should be called before _iolock.
|
||||||
On some cases, the mmap_mapper() is called only after scheduling.
|
On some cases, the mmap_mapper() is called only after scheduling.
|
||||||
*/
|
*/
|
||||||
wait_event_timeout(vb->done, q->is_mmapped, msecs_to_jiffies(100));
|
if (vb->memory == V4L2_MEMORY_MMAP) {
|
||||||
if (!q->is_mmapped) {
|
wait_event_timeout(vb->done, q->is_mmapped,
|
||||||
printk(KERN_ERR "Error: mmap_mapper() never called!\n");
|
msecs_to_jiffies(100));
|
||||||
return -EINVAL;
|
if (!q->is_mmapped) {
|
||||||
|
printk(KERN_ERR
|
||||||
|
"Error: mmap_mapper() never called!\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return CALL(q, iolock, q, vb, fbuf);
|
return CALL(q, iolock, q, vb, fbuf);
|
||||||
|
|
Loading…
Add table
Reference in a new issue