[PATCHv10 08/26] v4l: vb2-dma-contig: add support for scatterlist in userptr mode

Marek Szyprowski m.szyprowski at samsung.com
Mon Oct 29 23:43:44 PDT 2012


Hello,

On 10/26/2012 6:24 PM, Pawel Osciak wrote:
> Hi Tomasz,
>
> On Wed, Oct 10, 2012 at 7:46 AM, Tomasz Stanislawski
> <t.stanislaws at samsung.com> wrote:
>> This patch introduces usage of dma_map_sg to map memory behind
>> a userspace pointer to a device as dma-contiguous mapping.
>>
>
> Perhaps I'm missing something, but I don't understand the purpose of
> this patch. If the device can do DMA SG, why use videobuf2-dma-contig
> and not videobuf2-dma-sg?

This patch is for devices which doesn't do DMA SG, but might be behind 
IOMMU. In such case one can call dma_map_sg() with scatterlist of 
individual pages gathered from user pointer (anonymous memory of the 
process) which in turn will be mapped into contiguous dma adress space 
(dma_map_sg() returns only one chunk in such case). This is not very 
intuitive, but it was best way to fit such case into existing 
dma-mapping design.

> What would be the difference design-wise
> between them if this patch is merged?

Best regards
-- 
Marek Szyprowski
Samsung Poland R&D Center



More information about the dri-devel mailing list