Re: [PATCH v4 05/17] drm: add mmap() to drm_gem_object_funcs
From: Gerd Hoffmann
Date: Fri Sep 06 2019 - 08:13:25 EST
> I think if we do an mmap callback, it should replace all the mmap handling
> (except the drm_gem_object_get) that drm_gem_mmap_obj does. So maybe
> something like the below:
[ snip ]
> Since I remember quite a few discussions where the default vma flag
> wrangling we're doing is seriously getting in the way of things too.
Yep, makes sense.
> I think even better would be if this new ->mmap hook could also be used
> directly by the dma-buf mmap code, without having to jump through hoops
> creating a fake file and fake vma offset and everything. I think with that
> we'd have a really solid case to add this ->mmap hook.
Looks easy on a quick glance. So something like the patch below (quick
sketch, not tested yet other than compiling it)?