Message ID | 20210518082701.997251-13-thomas.hellstrom@linux.intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/i915: Move LMEM (VRAM) management over to TTM | expand |
On 5/18/21 10:26 AM, Thomas Hellström wrote: > From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> > > The paltform should exclusively use mmap_offset, one less path to worry > about for discrete. s/paltform/platform/ > > Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Otherwise, Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> > --- > drivers/gpu/drm/i915/gem/i915_gem_mman.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > 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; >
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;