[PATCH v3 0/2] drm: Add shmem GEM library

Daniel Vetter daniel at ffwll.ch
Fri Sep 14 16:13:41 UTC 2018


On Fri, Sep 14, 2018 at 5:48 PM, Thomas Hellstrom <thomas at shipmail.org> wrote:
> Hi, Noralf,
>
> On 09/11/2018 02:43 PM, Noralf Trønnes wrote:
>>
>> This patchset adds a library for shmem backed GEM objects and makes use
>> of it in tinydrm.
>>
>> When I made tinydrm I used the CMA helper because it was very easy to
>> use. July last year I learned that this limits which drivers to PRIME
>> import from, since CMA requires continuous memory. tinydrm drivers don't
>> require that. So I set out to change that looking first at shmem, but
>> that wasn't working since shmem didn't work with fbdev deferred I/O.
>> Then I did a vmalloc buffer attempt which worked with deferred I/O, but
>> maybe wouldn't be of so much use as a library for other drivers to use.
>> As my work to split out stuff from the CMA helper for shared use came to
>> an end, I had a generic fbdev emulation that uses a shadow buffer for
>> deferred I/O.
>> This means that I can now use shmem buffers after all.
>>
>> I have looked at the other drivers that use drm_gem_get_pages() and
>> several supports different cache modes so I've done that even though
>> tinydrm only uses the cached one.
>
> Out if interest, how can you use writecombine and uncached with shared
> memory?
> as typically the linear kernel map of the affected pages also needs
> changing?

I think on x86 at least the core code takes care of that. On arm, I'm
not sure this just works, since you can't change the mode of the
linear map. Instead you need specially allocated memory which is _not_
in the linear map. I guess arm boxes with pcie slots aren't that
common yet :-)
-Daniel

>
> Thanks,
> Thomas
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel



-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch


More information about the dri-devel mailing list