[Intel-gfx] [PATCH] drm/vgem: Replace vgem_object_funcs with the common drm shmem helper

Chris Wilson chris at chris-wilson.co.uk
Mon Oct 12 10:49:03 UTC 2020


Quoting Daniel Vetter (2020-10-09 17:16:06)
> On Fri, Oct 9, 2020 at 12:21 PM Chris Wilson <chris at chris-wilson.co.uk> wrote:
> >
> > vgem is a minimalistic driver that provides shmemfs objects to
> > userspace that may then be used as an in-memory surface and transported
> > across dma-buf to other drivers. Since it's introduction,
> > drm_gem_shmem_helper now provides the same shmemfs facilities and so we
> > can trim vgem to wrap the helper.
> >
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > ---
> >  drivers/gpu/drm/Kconfig         |   1 +
> >  drivers/gpu/drm/vgem/vgem_drv.c | 281 ++------------------------------
> >  drivers/gpu/drm/vgem/vgem_drv.h |  11 --
> >  3 files changed, 13 insertions(+), 280 deletions(-)
> 
> Nice diffstat :-)
> 
> Reviewed-by: Daniel Vetter <daniel.vetter at ffwll.ch>

Unfortunately I had to drop the drm_gem_prime_mmap() since the existing
expectation is that we hand the faulthandler off to shmemfs so we can
release the module while the memory is exported. The other issue happens
to be for arch/x86 where just setting PAT=WC on the PTE does not flush
the cache for that page, and the CPU will preferentially use the cache.
That has caught us out more than once.
-Chris


More information about the dri-devel mailing list