diff options
-rw-r--r-- | drivers/media/video/videobuf-core.c | 7 | ||||
-rw-r--r-- | drivers/media/video/videobuf-dma-sg.c | 11 | ||||
-rw-r--r-- | drivers/media/video/videobuf-dvb.c | 10 | ||||
-rw-r--r-- | drivers/media/video/videobuf-vmalloc.c | 1 | ||||
-rw-r--r-- | include/media/videobuf-core.h | 18 | ||||
-rw-r--r-- | include/media/videobuf-vmalloc.h | 4 |
6 files changed, 39 insertions, 12 deletions
diff --git a/drivers/media/video/videobuf-core.c b/drivers/media/video/videobuf-core.c index 848a2d0e1233..fc51e4918bbf 100644 --- a/drivers/media/video/videobuf-core.c +++ b/drivers/media/video/videobuf-core.c | |||
@@ -94,6 +94,13 @@ int videobuf_iolock(struct videobuf_queue *q, struct videobuf_buffer *vb, | |||
94 | return CALL(q, iolock, q, vb, fbuf); | 94 | return CALL(q, iolock, q, vb, fbuf); |
95 | } | 95 | } |
96 | 96 | ||
97 | void *videobuf_queue_to_vmalloc (struct videobuf_queue *q, | ||
98 | struct videobuf_buffer *buf) | ||
99 | { | ||
100 | return CALL(q, vmalloc, buf); | ||
101 | } | ||
102 | EXPORT_SYMBOL_GPL(videobuf_queue_to_vmalloc); | ||
103 | |||
97 | /* --------------------------------------------------------------------- */ | 104 | /* --------------------------------------------------------------------- */ |
98 | 105 | ||
99 | 106 | ||
diff --git a/drivers/media/video/videobuf-dma-sg.c b/drivers/media/video/videobuf-dma-sg.c index c0b7902862e4..03a7b946bd54 100644 --- a/drivers/media/video/videobuf-dma-sg.c +++ b/drivers/media/video/videobuf-dma-sg.c | |||
@@ -432,6 +432,16 @@ static void *__videobuf_alloc(size_t size) | |||
432 | return vb; | 432 | return vb; |
433 | } | 433 | } |
434 | 434 | ||
435 | static void *__videobuf_to_vmalloc (struct videobuf_buffer *buf) | ||
436 | { | ||
437 | struct videobuf_dma_sg_memory *mem = buf->priv; | ||
438 | BUG_ON(!mem); | ||
439 | |||
440 | MAGIC_CHECK(mem->magic, MAGIC_SG_MEM); | ||
441 | |||
442 | return mem->dma.vmalloc; | ||
443 | } | ||
444 | |||
435 | static int __videobuf_iolock (struct videobuf_queue* q, | 445 | static int __videobuf_iolock (struct videobuf_queue* q, |
436 | struct videobuf_buffer *vb, | 446 | struct videobuf_buffer *vb, |
437 | struct v4l2_framebuffer *fbuf) | 447 | struct v4l2_framebuffer *fbuf) |
@@ -677,6 +687,7 @@ static struct videobuf_qtype_ops sg_ops = { | |||
677 | .mmap_mapper = __videobuf_mmap_mapper, | 687 | .mmap_mapper = __videobuf_mmap_mapper, |
678 | .video_copy_to_user = __videobuf_copy_to_user, | 688 | .video_copy_to_user = __videobuf_copy_to_user, |
679 | .copy_stream = __videobuf_copy_stream, | 689 | .copy_stream = __videobuf_copy_stream, |
690 | .vmalloc = __videobuf_to_vmalloc, | ||
680 | }; | 691 | }; |
681 | 692 | ||
682 | void *videobuf_sg_alloc(size_t size) | 693 | void *videobuf_sg_alloc(size_t size) |
diff --git a/drivers/media/video/videobuf-dvb.c b/drivers/media/video/videobuf-dvb.c index 0f8542a4c71a..6e4d73ec6855 100644 --- a/drivers/media/video/videobuf-dvb.c +++ b/drivers/media/video/videobuf-dvb.c | |||
@@ -20,9 +20,10 @@ | |||
20 | #include <linux/fs.h> | 20 | #include <linux/fs.h> |
21 | #include <linux/kthread.h> | 21 | #include <linux/kthread.h> |
22 | #include <linux/file.h> | 22 | #include <linux/file.h> |
23 | |||
23 | #include <linux/freezer.h> | 24 | #include <linux/freezer.h> |
24 | 25 | ||
25 | #include <media/videobuf-dma-sg.h> | 26 | #include <media/videobuf-core.h> |
26 | #include <media/videobuf-dvb.h> | 27 | #include <media/videobuf-dvb.h> |
27 | 28 | ||
28 | /* ------------------------------------------------------------------ */ | 29 | /* ------------------------------------------------------------------ */ |
@@ -45,7 +46,7 @@ static int videobuf_dvb_thread(void *data) | |||
45 | struct videobuf_buffer *buf; | 46 | struct videobuf_buffer *buf; |
46 | unsigned long flags; | 47 | unsigned long flags; |
47 | int err; | 48 | int err; |
48 | struct videobuf_dmabuf *dma; | 49 | void *outp; |
49 | 50 | ||
50 | dprintk("dvb thread started\n"); | 51 | dprintk("dvb thread started\n"); |
51 | set_freezable(); | 52 | set_freezable(); |
@@ -66,9 +67,10 @@ static int videobuf_dvb_thread(void *data) | |||
66 | try_to_freeze(); | 67 | try_to_freeze(); |
67 | 68 | ||
68 | /* feed buffer data to demux */ | 69 | /* feed buffer data to demux */ |
69 | dma=videobuf_to_dma(buf); | 70 | outp = videobuf_queue_to_vmalloc (&dvb->dvbq, buf); |
71 | |||
70 | if (buf->state == VIDEOBUF_DONE) | 72 | if (buf->state == VIDEOBUF_DONE) |
71 | dvb_dmx_swfilter(&dvb->demux, dma->vmalloc, | 73 | dvb_dmx_swfilter(&dvb->demux, outp, |
72 | buf->size); | 74 | buf->size); |
73 | 75 | ||
74 | /* requeue buffer */ | 76 | /* requeue buffer */ |
diff --git a/drivers/media/video/videobuf-vmalloc.c b/drivers/media/video/videobuf-vmalloc.c index d68d0273807b..c91e1d8e3802 100644 --- a/drivers/media/video/videobuf-vmalloc.c +++ b/drivers/media/video/videobuf-vmalloc.c | |||
@@ -387,6 +387,7 @@ static struct videobuf_qtype_ops qops = { | |||
387 | .mmap_mapper = __videobuf_mmap_mapper, | 387 | .mmap_mapper = __videobuf_mmap_mapper, |
388 | .video_copy_to_user = __videobuf_copy_to_user, | 388 | .video_copy_to_user = __videobuf_copy_to_user, |
389 | .copy_stream = __videobuf_copy_stream, | 389 | .copy_stream = __videobuf_copy_stream, |
390 | .vmalloc = videobuf_to_vmalloc, | ||
390 | }; | 391 | }; |
391 | 392 | ||
392 | void videobuf_queue_vmalloc_init(struct videobuf_queue* q, | 393 | void videobuf_queue_vmalloc_init(struct videobuf_queue* q, |
diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h index 377a6c6e931b..5b39a22533fe 100644 --- a/include/media/videobuf-core.h +++ b/include/media/videobuf-core.h | |||
@@ -13,6 +13,9 @@ | |||
13 | * the Free Software Foundation; either version 2 | 13 | * the Free Software Foundation; either version 2 |
14 | */ | 14 | */ |
15 | 15 | ||
16 | #ifndef _VIDEOBUF_CORE_H | ||
17 | #define _VIDEOBUF_CORE_H | ||
18 | |||
16 | #include <linux/poll.h> | 19 | #include <linux/poll.h> |
17 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | 20 | #ifdef CONFIG_VIDEO_V4L1_COMPAT |
18 | #include <linux/videodev.h> | 21 | #include <linux/videodev.h> |
@@ -123,7 +126,8 @@ struct videobuf_queue_ops { | |||
123 | struct videobuf_qtype_ops { | 126 | struct videobuf_qtype_ops { |
124 | u32 magic; | 127 | u32 magic; |
125 | 128 | ||
126 | void* (*alloc) (size_t size); | 129 | void *(*alloc) (size_t size); |
130 | void *(*vmalloc) (struct videobuf_buffer *buf); | ||
127 | int (*iolock) (struct videobuf_queue* q, | 131 | int (*iolock) (struct videobuf_queue* q, |
128 | struct videobuf_buffer *vb, | 132 | struct videobuf_buffer *vb, |
129 | struct v4l2_framebuffer *fbuf); | 133 | struct v4l2_framebuffer *fbuf); |
@@ -185,6 +189,10 @@ int videobuf_iolock(struct videobuf_queue* q, struct videobuf_buffer *vb, | |||
185 | 189 | ||
186 | void *videobuf_alloc(struct videobuf_queue* q); | 190 | void *videobuf_alloc(struct videobuf_queue* q); |
187 | 191 | ||
192 | /* Used on videobuf-dvb */ | ||
193 | void *videobuf_queue_to_vmalloc (struct videobuf_queue* q, | ||
194 | struct videobuf_buffer *buf); | ||
195 | |||
188 | void videobuf_queue_core_init(struct videobuf_queue *q, | 196 | void videobuf_queue_core_init(struct videobuf_queue *q, |
189 | struct videobuf_queue_ops *ops, | 197 | struct videobuf_queue_ops *ops, |
190 | struct device *dev, | 198 | struct device *dev, |
@@ -233,10 +241,4 @@ int videobuf_mmap_free(struct videobuf_queue *q); | |||
233 | int videobuf_mmap_mapper(struct videobuf_queue *q, | 241 | int videobuf_mmap_mapper(struct videobuf_queue *q, |
234 | struct vm_area_struct *vma); | 242 | struct vm_area_struct *vma); |
235 | 243 | ||
236 | /* --------------------------------------------------------------------- */ | 244 | #endif |
237 | |||
238 | /* | ||
239 | * Local variables: | ||
240 | * c-basic-offset: 8 | ||
241 | * End: | ||
242 | */ | ||
diff --git a/include/media/videobuf-vmalloc.h b/include/media/videobuf-vmalloc.h index ec63ab0fab93..aed39460c154 100644 --- a/include/media/videobuf-vmalloc.h +++ b/include/media/videobuf-vmalloc.h | |||
@@ -12,6 +12,8 @@ | |||
12 | * it under the terms of the GNU General Public License as published by | 12 | * it under the terms of the GNU General Public License as published by |
13 | * the Free Software Foundation; either version 2 | 13 | * the Free Software Foundation; either version 2 |
14 | */ | 14 | */ |
15 | #ifndef _VIDEOBUF_VMALLOC_H | ||
16 | #define _VIDEOBUF_VMALLOC_H | ||
15 | 17 | ||
16 | #include <media/videobuf-core.h> | 18 | #include <media/videobuf-core.h> |
17 | 19 | ||
@@ -39,3 +41,5 @@ void videobuf_queue_vmalloc_init(struct videobuf_queue* q, | |||
39 | void *videobuf_to_vmalloc (struct videobuf_buffer *buf); | 41 | void *videobuf_to_vmalloc (struct videobuf_buffer *buf); |
40 | 42 | ||
41 | void videobuf_vmalloc_free (struct videobuf_buffer *buf); | 43 | void videobuf_vmalloc_free (struct videobuf_buffer *buf); |
44 | |||
45 | #endif | ||