Commit 8879ee9f authored by Gerd Knorr's avatar Gerd Knorr Committed by Linus Torvalds

[PATCH] v4l: video-buf fixes.

This patch has some minor bugfixes for the video-buf module.
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 800c5a77
...@@ -5,10 +5,10 @@ ...@@ -5,10 +5,10 @@
* The functions expect the hardware being able to scatter gatter * The functions expect the hardware being able to scatter gatter
* (i.e. the buffers are not linear in physical memory, but fragmented * (i.e. the buffers are not linear in physical memory, but fragmented
* into PAGE_SIZE chunks). They also assume the driver does not need * into PAGE_SIZE chunks). They also assume the driver does not need
* to touch the video data (thus it is probably not useful for USB as * to touch the video data (thus it is probably not useful for USB 1.1
* data often must be uncompressed by the drivers). * as data often must be uncompressed by the drivers).
* *
* (c) 2001,02 Gerd Knorr <kraxel@bytesex.org> * (c) 2001-2004 Gerd Knorr <kraxel@bytesex.org> [SUSE Labs]
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -536,6 +536,11 @@ videobuf_reqbufs(struct file *file, struct videobuf_queue *q, ...@@ -536,6 +536,11 @@ videobuf_reqbufs(struct file *file, struct videobuf_queue *q,
req->memory != V4L2_MEMORY_OVERLAY) req->memory != V4L2_MEMORY_OVERLAY)
return -EINVAL; return -EINVAL;
if (q->streaming)
return -EBUSY;
if (!list_empty(&q->stream))
return -EBUSY;
down(&q->lock); down(&q->lock);
count = req->count; count = req->count;
if (count > VIDEO_MAX_FRAME) if (count > VIDEO_MAX_FRAME)
...@@ -614,6 +619,8 @@ videobuf_qbuf(struct file *file, struct videobuf_queue *q, ...@@ -614,6 +619,8 @@ videobuf_qbuf(struct file *file, struct videobuf_queue *q,
case V4L2_MEMORY_USERPTR: case V4L2_MEMORY_USERPTR:
if (b->length < buf->bsize) if (b->length < buf->bsize)
goto done; goto done;
if (STATE_NEEDS_INIT != buf->state && buf->baddr != b->m.userptr)
q->ops->buf_release(file,buf);
buf->baddr = b->m.userptr; buf->baddr = b->m.userptr;
break; break;
case V4L2_MEMORY_OVERLAY: case V4L2_MEMORY_OVERLAY:
...@@ -1118,7 +1125,7 @@ int videobuf_mmap_setup(struct file *file, struct videobuf_queue *q, ...@@ -1118,7 +1125,7 @@ int videobuf_mmap_setup(struct file *file, struct videobuf_queue *q,
case V4L2_MEMORY_OVERLAY: case V4L2_MEMORY_OVERLAY:
/* nothing */ /* nothing */
break; break;
}; }
} }
dprintk(1,"mmap setup: %d buffers, %d bytes each\n", dprintk(1,"mmap setup: %d buffers, %d bytes each\n",
bcount,bsize); bcount,bsize);
......
...@@ -36,8 +36,6 @@ struct scatterlist* videobuf_vmalloc_to_sg(unsigned char *virt, int nr_pages); ...@@ -36,8 +36,6 @@ struct scatterlist* videobuf_vmalloc_to_sg(unsigned char *virt, int nr_pages);
*/ */
struct scatterlist* videobuf_pages_to_sg(struct page **pages, int nr_pages, struct scatterlist* videobuf_pages_to_sg(struct page **pages, int nr_pages,
int offset); int offset);
int videobuf_lock(struct page **pages, int nr_pages);
int videobuf_unlock(struct page **pages, int nr_pages);
/* --------------------------------------------------------------------- */ /* --------------------------------------------------------------------- */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment