[RFC PATCH v2 4/8] media: videobuf2: introduce VIDEOBUF2_PAGE memops
Ming Lei
ming.lei at canonical.com
Tue Jan 10 06:55:25 EST 2012
Hi,
On Tue, Jan 10, 2012 at 6:20 PM, Marek Szyprowski
<m.szyprowski at samsung.com> wrote:
>> Sorry, could you describe the abuse problem in a bit detail?
>
> Videobuf2 requires memory module handlers to provide vaddr method to provide a pointer in
> kernel virtual address space to video data (buffer content). It is used for example by
Yes, this is what the patch is doing, __get_free_pages just returns
the kernel virtual
address which will be passed to driver.
> read()/write() io method emulator. Memory allocator/handler should not be specific to any
> particular use case in the device driver. That's the design. Simple.
Most of the patch is copied from videobuf-vmalloc.c, and the
interfaces are totally same
with videobuf-vmalloc.c.
>
> I your case you want to give pointer to struct page from the memory allocator to the
In my case, the pointer to struct page is not required to the driver
at all, so I think you
have misunderstood the patch, don't I?
> driver. The cookie method has been introduced exactly for this purpose. Memory allocator
> also provides a simple inline function to convert generic 'void *' return type from cookie
> method to allocator specific structure/pointer. vb2_dma_contig_plane_dma_addr() and
> vb2_dma_sg_plane_desc() were examples how does passing allocator specific type though the
> cookie method works.
thanks,
--
Ming Lei
More information about the linux-arm-kernel
mailing list