RE: [PATCH] videobuf2: Do not unconditionally map S/G buffers into kernel space

2011-07-15 Thread Marek Szyprowski
Hello,

On Thursday, July 14, 2011 11:11 PM Jonathan Corbet wrote:

 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 cor...@lwn.net

Acked-by: Marek Szyprowski m.szyprow...@samsung.com

 ---
  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 b2d9485..0e8edc1 100644
 --- a/drivers/media/video/videobuf2-dma-sg.c
 +++ b/drivers/media/video/videobuf2-dma-sg.c
 @@ -77,12 +77,6 @@ static void *vb2_dma_sg_alloc(void *alloc_ctx, unsigned
 long size)
 
   printk(KERN_DEBUG %s: Allocated buffer of %d pages\n,
   __func__, buf-sg_desc.num_pages);
 -
 - if (!buf-vaddr)
 - buf-vaddr = vm_map_ram(buf-pages,
 - buf-sg_desc.num_pages,
 - -1,
 - PAGE_KERNEL);
   return buf;
 
  fail_pages_alloc:
 --
 1.7.6

Best regards
-- 
Marek Szyprowski
Samsung Poland RD Center


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] videobuf2: Do not unconditionally map S/G buffers into kernel space

2011-07-14 Thread Jonathan Corbet
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 cor...@lwn.net
---
 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 b2d9485..0e8edc1 100644
--- a/drivers/media/video/videobuf2-dma-sg.c
+++ b/drivers/media/video/videobuf2-dma-sg.c
@@ -77,12 +77,6 @@ static void *vb2_dma_sg_alloc(void *alloc_ctx, unsigned long 
size)
 
printk(KERN_DEBUG %s: Allocated buffer of %d pages\n,
__func__, buf-sg_desc.num_pages);
-
-   if (!buf-vaddr)
-   buf-vaddr = vm_map_ram(buf-pages,
-   buf-sg_desc.num_pages,
-   -1,
-   PAGE_KERNEL);
return buf;
 
 fail_pages_alloc:
-- 
1.7.6

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html