drm: Why shmem?

Eric Anholt eric at anholt.net
Mon Aug 28 20:40:41 UTC 2017


Noralf Trønnes <noralf at tronnes.org> writes:

> Hi,
>
> Currently I'm using the cma library with tinydrm because it was so
> simple to use even though I have to work around the fact that reads are
> uncached. A bigger problem that I have become aware of, is that it
> restricts the dma buffers it can import since they have to be continous.
>
> So I looked to udl and it uses shmem. Fine, let's make a shmem gem
> library similar to the cma library.
>
> Now I have done so and have started to think about the DOC: section,
> explaining what the library does. And I'm stuck, what's the benefit of
> using shmem compared to just using alloc_page()?

Using shmem means that, when the buffer isn't pinned for DMA usage by
the device, the pages can be swapped out.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/dri-devel/attachments/20170828/478762a8/attachment.sig>


More information about the dri-devel mailing list