summaryrefslogtreecommitdiff
path: root/linux/include/media/videobuf-core.h
diff options
context:
space:
mode:
authorBrandon Philips <brandon@ifup.org>2008-04-02 11:10:59 -0700
committerBrandon Philips <brandon@ifup.org>2008-04-02 11:10:59 -0700
commit12d05113a10be2078e72039a301b3d3902d29248 (patch)
treecfe42c1a425ec1fa570fcd183cc02dfb34cf1638 /linux/include/media/videobuf-core.h
parente2c76fa02753f7c3ed102dbca09fdf17926e6085 (diff)
downloadmediapointer-dvb-s2-12d05113a10be2078e72039a301b3d3902d29248.tar.gz
mediapointer-dvb-s2-12d05113a10be2078e72039a301b3d3902d29248.tar.bz2
videobuf-vmalloc.c: Fix hack of postponing mmap on remap failure
In videobuf-vmalloc.c remap_vmalloc_range is failing when applications are trying to mmap buffers immediately after reqbuf. It fails because the vmalloc area isn't setup until the first QBUF when drivers call iolock. This patch introduces mmap_setup to the qtype_ops and it is called in __videobuf_mmap_setup if the buffer type is mmap. In the case of vmalloc buffers this calls iolock, and sets the state to idle. I don't think this is needed for dma-sg buffers and it defaults to a no-op for everything but vmalloc. Signed-off-by: Brandon Philips <bphilips@suse.de> --- linux/drivers/media/video/videobuf-core.c | 29 +++++++----------- linux/drivers/media/video/videobuf-vmalloc.c | 43 +++++++++++++-------------- linux/include/media/videobuf-core.h | 3 + 3 files changed, 35 insertions(+), 40 deletions(-)
Diffstat (limited to 'linux/include/media/videobuf-core.h')
-rw-r--r--linux/include/media/videobuf-core.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/linux/include/media/videobuf-core.h b/linux/include/media/videobuf-core.h
index b94057eac..7c80e8adf 100644
--- a/linux/include/media/videobuf-core.h
+++ b/linux/include/media/videobuf-core.h
@@ -144,6 +144,8 @@ struct videobuf_qtype_ops {
int vbihack,
int nonblocking);
int (*mmap_free) (struct videobuf_queue *q);
+ int (*mmap_setup) (struct videobuf_queue *q,
+ struct videobuf_buffer *vb);
int (*mmap_mapper) (struct videobuf_queue *q,
struct vm_area_struct *vma);
};
@@ -168,7 +170,6 @@ struct videobuf_queue {
unsigned int streaming:1;
unsigned int reading:1;
- unsigned int is_mmapped:1;
/* capture via mmap() + ioctl(QBUF/DQBUF) */
struct list_head stream;