diff options
author | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2021-06-01 10:46:52 +0300 |
---|---|---|
committer | Matthew Auld <matthew.auld@intel.com> | 2021-06-01 11:55:45 +0300 |
commit | 35cbd91eb541e001f6e2648c56abb5361e3d6774 (patch) | |
tree | dacb12fe832cd36c67001367fb103d14162b9994 /drivers/gpu/drm/i915/gem/i915_gem_mman.c | |
parent | 62445a97c5fa85c4c6966c936155fc6a0dcfac5b (diff) | |
download | linux-35cbd91eb541e001f6e2648c56abb5361e3d6774.tar.xz |
drm/i915: Disable mmap ioctl for gen12+
The platform should exclusively use mmap_offset, one less path to worry
about for discrete.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210601074654.3103-14-thomas.hellstrom@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/gem/i915_gem_mman.c')
-rw-r--r-- | drivers/gpu/drm/i915/gem/i915_gem_mman.c | 7 |
1 files changed, 7 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 8598a1c78a4c..65db290efd16 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_mman.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_mman.c @@ -56,10 +56,17 @@ int i915_gem_mmap_ioctl(struct drm_device *dev, void *data, struct drm_file *file) { + struct drm_i915_private *i915 = to_i915(dev); struct drm_i915_gem_mmap *args = data; struct drm_i915_gem_object *obj; unsigned long addr; + /* mmap ioctl is disallowed for all platforms after TGL-LP. This also + * covers all platforms with local memory. + */ + if (INTEL_GEN(i915) >= 12 && !IS_TIGERLAKE(i915)) + return -EOPNOTSUPP; + if (args->flags & ~(I915_MMAP_WC)) return -EINVAL; |