Re: [PATCH 4/8] drm/ttm: factor out ttm_bo_mmap_vma_setup

From: Gerd Hoffmann
Date: Tue Sep 17 2019 - 05:54:44 EST


> It may not be worth blocking on this, so
>
> Acked-by: Thomas Zimmermann <tzimmermann@xxxxxxx>
>
> But I still think it's not a good interface because it exposes internal
> details.
>
> Please consider another idea: how about splitting off the ttm_bo_get()
> and vma-flags setup of ttm_fbdev_mmap() into a separate function, like this:
>
> void ttm_bo_mmap_refed(vma, bo)
> {
> ttm_bo_get(bo)
> ttm_bo_mmap_vma_setup(vma);
> }
> EXPORT_SYMBOL(ttm_bo_mmap_refed)

ttm_bo_mmap_refed and ttm_bo_mmap_vma_setup are almost identical ...

But, yes, moving the ttm_bo_get call to ttm_bo_mmap_vma_setup probably
makes sense and hides this little detail to the outside.

> ttm_fbdev_mmap() sounds like it is only for fbdev and the only user is
> amdgpu. Can it be moved out of ttm entirely?

Exporting ttm_bo_mmap_vma_setup() allows to do that ;)

cheers,
Gerd