Re: [PATCH] drm/virtio: fix mmap page attributes

From: Gerd Hoffmann
Date: Wed Dec 11 2019 - 03:15:54 EST


Hi,

> There's similar code in udl, [1] which still uses writecombine for
> imported buffers. Virtio does not need this?

virtio doesn't support dma-buf imports (yet).
So no worries for now.

Why pick writecombine for the imported buffer btw?
It'll probably be correct for the majority of imports, but it still
looks like a educated guess to me. What if you import from vgem?

I guess we should either ...
(1) Ask the exporting driver to handle things, simliar to how it is
done for vmaps already, probably by calling dma_buf_mmap(), or
(2) Refuse to mmap imported objects via drm api.

> Aside from this, do you think we could handle all special cases within
> shmem?

Probably makes sense to teach shmem helpers about caching.

cheers,
Gerd