From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Szyprowski Subject: Re: [PATCHv10 08/26] v4l: vb2-dma-contig: add support for scatterlist in userptr mode Date: Tue, 30 Oct 2012 07:43:44 +0100 Message-ID: <508F7720.5080606@samsung.com> References: <1349880405-26049-1-git-send-email-t.stanislaws@samsung.com> <1349880405-26049-9-git-send-email-t.stanislaws@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-reply-to: Sender: linux-media-owner@vger.kernel.org To: Pawel Osciak Cc: Tomasz Stanislawski , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, airlied@redhat.com, kyungmin.park@samsung.com, laurent.pinchart@ideasonboard.com, sumit.semwal@ti.com, daeinki@gmail.com, daniel.vetter@ffwll.ch, robdclark@gmail.com, linaro-mm-sig@lists.linaro.org, hverkuil@xs4all.nl, remi@remlab.net, subashrp@gmail.com, mchehab@redhat.com, zhangfei.gao@gmail.com, s.nawrocki@samsung.com, k.debski@samsung.com List-Id: dri-devel@lists.freedesktop.org Hello, On 10/26/2012 6:24 PM, Pawel Osciak wrote: > Hi Tomasz, > > On Wed, Oct 10, 2012 at 7:46 AM, Tomasz Stanislawski > 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