Skip to content

Commit

Permalink
drm/i915: Disable mmap ioctl for gen12+
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Maarten Lankhorst authored and Matthew Auld committed Jun 1, 2021
1 parent 62445a9 commit 35cbd91
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/gpu/drm/i915/gem/i915_gem_mman.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 35cbd91

Please sign in to comment.