drm/gem: Fix mmap fake offset handling for drm_gem_object_funcs.mmap
Commit c40069cb ("drm: add mmap() to drm_gem_object_funcs") introduced a GEM object mmap() hook which is expected to subtract the fake offset from vm_pgoff. However, for mmap() on dmabufs, there is not a fake offset. To fix this, let's always call mmap() object callback with an offset of 0, and leave it up to drm_gem_mmap_obj() to remove the fake offset. TTM still needs the fake offset, so we have to add it back until that's fixed. Fixes: c40069cb ("drm: add mmap() to drm_gem_object_funcs") Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by:Rob Herring <robh@kernel.org> Acked-by:
Gerd Hoffmann <kraxel@redhat.com> Reviewed-by:
Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20191024191859.31700-1-robh@kernel.org
Showing
- drivers/gpu/drm/drm_gem.c 3 additions, 0 deletionsdrivers/gpu/drm/drm_gem.c
- drivers/gpu/drm/drm_gem_shmem_helper.c 0 additions, 3 deletionsdrivers/gpu/drm/drm_gem_shmem_helper.c
- drivers/gpu/drm/ttm/ttm_bo_vm.c 7 additions, 0 deletionsdrivers/gpu/drm/ttm/ttm_bo_vm.c
- include/drm/drm_gem.h 3 additions, 2 deletionsinclude/drm/drm_gem.h
Loading
Please register or sign in to comment