[PATCH 1/2] drm/shmem: Use cached mappings by default

Thomas Zimmermann tzimmermann at suse.de
Fri May 15 06:58:02 UTC 2020


Hi

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 [1].
That's a for memcpy with no DMA involved. There's got to be something
I'm missing.

Best regards
Thomas

[1]
https://cgit.freedesktop.org/drm/drm-tip/tree/drivers/gpu/drm/lima/lima_sched.c#n391

> 
> Rob
> 

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20200515/74f6d384/attachment.sig>


More information about the dri-devel mailing list