Re: [RFC] ARM DMA mapping TODO, v1

From: Benjamin Herrenschmidt
Date: Wed Apr 27 2011 - 17:37:10 EST


On Thu, 2011-04-21 at 21:29 +0200, Arnd Bergmann wrote:
>
> 7. Extend the dma_map_ops to have a way for mapping a buffer
> from dma_alloc_{non,}coherent into user space. We have not
> discussed that yet, but after thinking this for some time, I
> believe this would be the right approach to map buffers into
> user space from code that doesn't care about the underlying
> hardware.

Yes. There is a dma_mmap_coherent() call that's not part of the "Real"
API but is implemented by some archs and used by Alsa (I added support
for it on powerpc recently).

Maybe that should go into the dma ops.

The question remains, if we ever want to do more complex demand-paged
operations, should we also expose a lower level set of functions to get
struct page out of a dma_alloc_coherent() allocation and to get the
pgprot for the user dma mapping ?

> After all these are in place, building anything on top of
> dma_alloc_{non,}coherent should be much easier. The question
> of passing buffers between V4L and DRM is still completely
> unsolved as far as I can tell, but that discussion might become
> more focused if we can agree on the above points and assume
> that it will be done.

My gut feeling is that it should be done by having V4L use DRM buffers
in the first place...

> I expect that I will have to update the list above as people
> point out mistakes in my assumptions.

Cheers,
Ben.


--
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/