From e0c1e01aabf66d47f4903f4b6d439258faa880af Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 13 Apr 2008 11:54:05 -0300 Subject: videobuf: revert changeset #7490:5b77f099a151 From: Mauro Carvalho Chehab This changeset were supposed to optimize mmap() support on vmalloc. However, it just broke mmap() on real devices. Revert the changeset to make mmap() to work again. Signed-off-by: Mauro Carvalho Chehab --- linux/include/media/videobuf-core.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'linux/include') diff --git a/linux/include/media/videobuf-core.h b/linux/include/media/videobuf-core.h index 18b0ba615..ea269cec4 100644 --- a/linux/include/media/videobuf-core.h +++ b/linux/include/media/videobuf-core.h @@ -144,8 +144,6 @@ 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); }; @@ -172,6 +170,7 @@ 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; -- cgit v1.2.3 From e63393d099ee7dc257d46a85611ac301c7cb2f1c Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 13 Apr 2008 11:59:29 -0300 Subject: videobuf-dma-sg: Remove unused flag From: Mauro Carvalho Chehab Signed-off-by: Mauro Carvalho Chehab --- linux/include/media/videobuf-dma-sg.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'linux/include') diff --git a/linux/include/media/videobuf-dma-sg.h b/linux/include/media/videobuf-dma-sg.h index b6ab08045..be8da269e 100644 --- a/linux/include/media/videobuf-dma-sg.h +++ b/linux/include/media/videobuf-dma-sg.h @@ -68,9 +68,6 @@ struct videobuf_dmabuf { /* for kernel buffers */ void *vmalloc; - /* Stores the userspace pointer to vmalloc area */ - void *varea; - /* for overlay buffers (pci-pci dma) */ dma_addr_t bus_addr; -- cgit v1.2.3 From 1def8c1f6f0fb108cf841f29e899253c8b8e3523 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Sun, 13 Apr 2008 12:10:00 -0300 Subject: videobuf-dvb: allow its usage with videobuf-vmalloc From: Mauro Carvalho Chehab videobuf-dvb were still using a function that were videobuf-dma-sg dependent. This patch creates a generic handler for this function. This way, videobuf-dvb can now work with all videobuf implementations. Signed-off-by: Mauro Carvalho Chehab --- linux/include/media/videobuf-core.h | 18 ++++++++++-------- linux/include/media/videobuf-vmalloc.h | 4 ++++ 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'linux/include') diff --git a/linux/include/media/videobuf-core.h b/linux/include/media/videobuf-core.h index ea269cec4..dd0821f40 100644 --- a/linux/include/media/videobuf-core.h +++ b/linux/include/media/videobuf-core.h @@ -13,6 +13,9 @@ * the Free Software Foundation; either version 2 */ +#ifndef _VIDEOBUF_CORE_H +#define _VIDEOBUF_CORE_H + #include #ifdef CONFIG_VIDEO_V4L1_COMPAT #include @@ -123,7 +126,8 @@ struct videobuf_queue_ops { struct videobuf_qtype_ops { u32 magic; - void* (*alloc) (size_t size); + void *(*alloc) (size_t size); + void *(*vmalloc) (struct videobuf_buffer *buf); int (*iolock) (struct videobuf_queue* q, struct videobuf_buffer *vb, struct v4l2_framebuffer *fbuf); @@ -189,6 +193,10 @@ int videobuf_iolock(struct videobuf_queue* q, struct videobuf_buffer *vb, void *videobuf_alloc(struct videobuf_queue* q); +/* Used on videobuf-dvb */ +void *videobuf_queue_to_vmalloc (struct videobuf_queue* q, + struct videobuf_buffer *buf); + void videobuf_queue_core_init(struct videobuf_queue *q, struct videobuf_queue_ops *ops, struct device *dev, @@ -237,10 +245,4 @@ int videobuf_mmap_free(struct videobuf_queue *q); int videobuf_mmap_mapper(struct videobuf_queue *q, struct vm_area_struct *vma); -/* --------------------------------------------------------------------- */ - -/* - * Local variables: - * c-basic-offset: 8 - * End: - */ +#endif diff --git a/linux/include/media/videobuf-vmalloc.h b/linux/include/media/videobuf-vmalloc.h index ec63ab0fa..aed39460c 100644 --- a/linux/include/media/videobuf-vmalloc.h +++ b/linux/include/media/videobuf-vmalloc.h @@ -12,6 +12,8 @@ * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 */ +#ifndef _VIDEOBUF_VMALLOC_H +#define _VIDEOBUF_VMALLOC_H #include @@ -39,3 +41,5 @@ void videobuf_queue_vmalloc_init(struct videobuf_queue* q, void *videobuf_to_vmalloc (struct videobuf_buffer *buf); void videobuf_vmalloc_free (struct videobuf_buffer *buf); + +#endif -- cgit v1.2.3