diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-11-05 17:53:05 +0300 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-11-06 15:09:44 +0300 |
commit | bee0a70a9eab27061dd0346dd0df09e6c2e8caa2 (patch) | |
tree | 37da7263f62bb16cc258b117f96693aae7dacc59 /drivers/gpu/drm/i915/gem/i915_gem_mman.c | |
parent | a096883dda2cfa52c19e2ab4121b64efe8cf95a6 (diff) | |
download | linux-bee0a70a9eab27061dd0346dd0df09e6c2e8caa2.tar.xz |
drm/i915/gem: Early rejection of no-aperture map_ggtt
If the device does not have an aperture through which we can indirectly
access and detile the buffers, simply reject the ioctl. Later we can
extend the ioctl to support different modes, but as an extension the
user must opt in and explicitly control the mmap type (viz
MMAP_OFFSET_IOCTL).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191105145305.14314-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/gem/i915_gem_mman.c')
-rw-r--r-- | drivers/gpu/drm/i915/gem/i915_gem_mman.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_mman.c b/drivers/gpu/drm/i915/gem/i915_gem_mman.c index e3002849844b..d60973603cc1 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c @@ -450,6 +450,9 @@ i915_gem_mmap_gtt(struct drm_file *file, struct drm_i915_gem_object *obj; int ret; + if (!i915_ggtt_has_aperture(&to_i915(dev)->ggtt)) + return -ENODEV; + obj = i915_gem_object_lookup(file, handle); if (!obj) return -ENOENT; |