[PATCH 0/2] Lima DRM driver
Noralf Trønnes
noralf at tronnes.org
Thu Feb 14 21:15:14 UTC 2019
Den 13.02.2019 02.44, skrev Rob Herring:
> On Tue, Feb 12, 2019 at 7:00 PM Eric Anholt <eric at anholt.net> wrote:
>>
>> Rob Herring <robh at kernel.org> writes:
>>
[snip]
>>> FWIW, I'm working on the panfrost driver and am using the shmem
>>> helpers from Noralf. It's the early stages though. I started a patch
>>> for etnaviv to use it too, but found I need to rework it to sub-class
>>> the shmem GEM object.
>>
>> Did you just convert the shmem helpers over to doing alloc_coherent? If
>> so, I'd be interested in picking them up for v3d, and that might help
>> get another patch out of your stack.
>
> I haven't really fully addressed that yet, but yeah, my plan is just
> to switch to WC alloc and mappings. I was going to try to make it
> configurable, but there is a comment in the ARM dma mapping code which
> makes me wonder if tinydrm using streaming DMA for SPI is
> fundamentally broken (and maybe CMA is less broken?). If not broken,
> not guaranteed to work.
>
> /*
> * The whole dma_get_sgtable() idea is fundamentally unsafe - it seems
> * that the intention is to allow exporting memory allocated via the
> * coherent DMA APIs through the dma_buf API, which only accepts a
> * scattertable. This presents a couple of problems:
> * 1. Not all memory allocated via the coherent DMA APIs is backed by
> * a struct page
> * 2. Passing coherent DMA memory into the streaming APIs is not allowed
> * as we will try to flush the memory through a different alias to that
> * actually being used (and the flushes are redundant.)
> */
>
Thanks for drawing my attention to this, I wasn't aware of it. Sadly the
SPI subsystem doesn't have a way to pass in dma buffers, everything has
to go through the streaming API. Long term I guess I have to add support
for that.
Noralf.
More information about the dri-devel
mailing list