diff options
author | Jonathan Corbet <corbet@lwn.net> | 2011-07-14 17:10:44 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-09-03 09:57:33 -0400 |
commit | 297875b6a1f3910c883e4b00bb9bc3e6c3aa6ab7 (patch) | |
tree | f9319522a8ffaa66312ebfbee37e35c54639eb5c /drivers/media/video | |
parent | 77b1e2fbbdfa0ee5cdf6c928b711493a3738468e (diff) |
[media] videobuf2: Do not unconditionally map S/G buffers into kernel space
The one in-tree videobuf2-dma-sg driver (mmp-camera) has no need for a
kernel-space mapping of the buffers; one suspects that most other drivers
would not either. The videobuf2-dma-sg module does the right thing if
buf->vaddr == NULL - it maps the buffer on demand if somebody needs it. So
let's not map the buffer at allocation time; that will save a little CPU
time and a lot of address space in the vmalloc range.
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Acked-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/videobuf2-dma-sg.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/drivers/media/video/videobuf2-dma-sg.c b/drivers/media/video/videobuf2-dma-sg.c index 065f468faf8f..3bad8b105fea 100644 --- a/drivers/media/video/videobuf2-dma-sg.c +++ b/drivers/media/video/videobuf2-dma-sg.c | |||
@@ -75,12 +75,6 @@ static void *vb2_dma_sg_alloc(void *alloc_ctx, unsigned long size) | |||
75 | 75 | ||
76 | printk(KERN_DEBUG "%s: Allocated buffer of %d pages\n", | 76 | printk(KERN_DEBUG "%s: Allocated buffer of %d pages\n", |
77 | __func__, buf->sg_desc.num_pages); | 77 | __func__, buf->sg_desc.num_pages); |
78 | |||
79 | if (!buf->vaddr) | ||
80 | buf->vaddr = vm_map_ram(buf->pages, | ||
81 | buf->sg_desc.num_pages, | ||
82 | -1, | ||
83 | PAGE_KERNEL); | ||
84 | return buf; | 78 | return buf; |
85 | 79 | ||
86 | fail_pages_alloc: | 80 | fail_pages_alloc: |