diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-13 14:10:00 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:09:39 -0400 |
commit | 59d3448995a4c0ca98cbe82f6dac9460323377c1 (patch) | |
tree | fe6029dc9e66a4101b8e4e985ff9175a1735e14f /drivers/media/video/videobuf-dma-sg.c | |
parent | 3b5fa928a6b2971ec65571745defc5d9758b4bc1 (diff) |
V4L/DVB (7566): videobuf-dvb: allow its usage with videobuf-vmalloc
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 <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/videobuf-dma-sg.c')
-rw-r--r-- | drivers/media/video/videobuf-dma-sg.c | 11 |
1 files changed, 11 insertions, 0 deletions
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) |