Re: [PATCH v3 2/4] videobuf2-dma-streaming: new videobuf2 memory allocator
From: Federico Vaga
Date: Wed Dec 05 2012 - 07:46:02 EST
On Tuesday 04 December 2012 14:04:22 Mauro Carvalho Chehab wrote:
> Em 24-09-2012 09:44, Marek Szyprowski escreveu:
> > Hello,
> > On Monday, September 24, 2012 12:59 PM Federico Vaga wrote:
> >> The DMA streaming allocator is similar to the DMA contig but it use the
> >> DMA streaming interface (dma_map_single, dma_unmap_single). The
> >> allocator allocates buffers and immediately map the memory for DMA
> >> transfer. For each buffer prepare/finish it does a DMA synchronization.
> Hmm.. the explanation didn't convince me, e. g.:
> 1) why is it needed;
This allocator is needed because some device (like STA2X11 VIP) cannot work
with DMA sg or DMA coherent. Some other device (like the one used by Jonathan
when he proposes vb2-dma-nc allocator) can obtain much better performance with
DMA streaming than coherent.
> 2) why vb2-dma-config can't be patched to use dma_map_single
> (eventually using a different vb2_io_modes bit?);
I did not modify vb2-dma-contig because I was thinking that each DMA memory
allocator should reflect a DMA API.
> 3) what are the usecases for it.
> Could you please detail it? Without that, one that would be needing to
> write a driver will have serious doubts about what would be the right
> driver for its usage. Also, please document it at the driver itself.
I did not write all this details because the reasons to use vb2-dma-contig,
vb2-dma-sg or vb2-dma-streaming are the same reasons because someone choose
SG, coherent or streaming API. This is already documented in the DMA-*.txt
files, so I did not rewrite it to avoid duplication.
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/