drm/i915: Use ttm mmap handling for ttm bo's.
Use the ttm handlers for servicing page faults, and vm_access. We do our own validation of read-only access, otherwise use the ttm handlers as much as possible. Because the ttm handlers expect the vma_node at vma->base, we slightly need to massage the mmap handlers to look at vma_node->driver_private to fetch the bo, if it's NULL, we assume i915's normal mmap_offset uapi is used. This is the easiest way to achieve compatibility without changing ttm's semantics. Signed-off-by:Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by:
Thomas Hellström <thomas.hellstrom@linux.intel.com> Signed-off-by:
Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210610070152.572423-5-thomas.hellstrom@linux.intel.com
Showing
- drivers/gpu/drm/i915/gem/i915_gem_mman.c 57 additions, 26 deletionsdrivers/gpu/drm/i915/gem/i915_gem_mman.c
- drivers/gpu/drm/i915/gem/i915_gem_object.h 3 additions, 3 deletionsdrivers/gpu/drm/i915/gem/i915_gem_object.h
- drivers/gpu/drm/i915/gem/i915_gem_object_types.h 3 additions, 0 deletionsdrivers/gpu/drm/i915/gem/i915_gem_object_types.h
- drivers/gpu/drm/i915/gem/i915_gem_pages.c 1 addition, 2 deletionsdrivers/gpu/drm/i915/gem/i915_gem_pages.c
- drivers/gpu/drm/i915/gem/i915_gem_ttm.c 114 additions, 7 deletionsdrivers/gpu/drm/i915/gem/i915_gem_ttm.c
- drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c 47 additions, 43 deletionsdrivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
- drivers/gpu/drm/i915/selftests/igt_mmap.c 19 additions, 6 deletionsdrivers/gpu/drm/i915/selftests/igt_mmap.c
- drivers/gpu/drm/i915/selftests/igt_mmap.h 7 additions, 5 deletionsdrivers/gpu/drm/i915/selftests/igt_mmap.h
Loading
Please register or sign in to comment