[PATCH 1/2] drm/shmem: Use cached mappings by default
tzimmermann at suse.de
Mon May 18 08:13:44 UTC 2020
Am 15.05.20 um 16:10 schrieb Daniel Vetter:
> On Fri, May 15, 2020 at 08:58:02AM +0200, Thomas Zimmermann wrote:
>> Am 14.05.20 um 22:36 schrieb Rob Herring:
>>> On Thu, May 14, 2020 at 7:40 AM Daniel Vetter <daniel at ffwll.ch> wrote:
>>>> On Wed, May 13, 2020 at 05:03:11PM +0200, Thomas Zimmermann wrote:
>>>>> SHMEM-buffer backing storage is allocated from system memory; which is
>>>>> typically cachable. Currently, only virtio uses cachable mappings; udl
>>>>> uses its own vmap/mmap implementation for cachable mappings. Other
>>>>> drivers default to writecombine mappings.
>>>> I'm pretty sure this breaks all these drivers. quick grep on a few
>>>> functions says this is used by lima, panfrost, v3d. And they definitely
>>>> need uncached/wc stuff afaiui. Or I'm completely missing something?
>> OK. I think I'll just make a patch that adds a .gem_create_object helper
>> that sets the map_cached flag. So drivers can opt-in.
>>> Yes, that would be my guess. DMA is usually non-coherent on Arm.
>> Can one of you give me some pointer to what you're looking at? For
>> example, I grepped for use of vmap within lima and only found .
>> That's a for memcpy with no DMA involved. There's got to be something
>> I'm missing.
>> Best regards
> $ git grep drm_gem_shmem_mmap
> We also need correct access from userspace, otherwise the gpu is going to
> be sad.
I've been thinking about this, and I think it means that we can never
have cached mappings anywhere. Even if shmem supports it internally for
most drivers, as soon as the page are exported, the importer could
expect uncached memory.
Given that, I think the correct thing to do is to udl's gem code and use
the default implementation.
>> Thomas Zimmermann
>> Graphics Driver Developer
>> SUSE Software Solutions Germany GmbH
>> Maxfeldstr. 5, 90409 Nürnberg, Germany
>> (HRB 36809, AG Nürnberg)
>> Geschäftsführer: Felix Imendörffer
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Maxfeldstr. 5, 90409 Nürnberg, Germany
(HRB 36809, AG Nürnberg)
Geschäftsführer: Felix Imendörffer
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 488 bytes
Desc: OpenPGP digital signature
More information about the dri-devel