[PATCH] ARM: dma-mapping: support non-consistent DMA attribute
Daniel Drake
drake at endlessm.com
Wed Feb 25 05:58:00 PST 2015
On Wed, Feb 25, 2015 at 4:24 AM, Arnd Bergmann <arnd at arndb.de> wrote:
> On Tuesday 24 February 2015 14:45:03 Daniel Drake wrote:
>> Currently when arm_dma_mmap() is called, vm_page_prot is reset
>> according to DMA attributes. Currently, writecombine is the
>> only attribute supported; any other configuration will map uncached
>> memory.
>>
>> Add support for the non-consistent attribute so that cachable memory
>> can be mapped into userspace via the dma_mmap_attrs() API.
>>
>> Signed-off-by: Daniel Drake <drake at endlessm.com>
>>
>
> How does the user process enforce consistency then?
Hmm, good point.
The use case here is that we're mapping certain memory shared with the
Mali GPU into userspace, where we expect the CPU to be doing rendering
to it, and we've measured performance improvements from having the CPU
cache enabled. But Mali also comes alongside UMP (comparable to
dma-buf) which provides an ioctl-based API for userspace to
invalidate/flush caches, which we use heavily in this pipeline.
UMP's not going upstream, but I was wondering if this patch had any
value in the more general case. Thinking more, perhaps not, at least
until dma-buf grows some form of userspace cache control API.
Daniel
More information about the linux-arm-kernel
mailing list