[Intel-gfx] [PATCH 21/22] drm/i915: check for missing aperture in GTT pread/pwrite paths
Matthew Auld
matthew.auld at intel.com
Fri Sep 27 17:34:08 UTC 2019
From: CQ Tang <cq.tang at intel.com>
drm_mm_insert_node_in_range() treats range_start > range_end as a
programmer error, such that we explode in insert_mappable_node. For now
simply check for missing aperture on such paths.
Signed-off-by: CQ Tang <cq.tang at intel.com>
Signed-off-by: Matthew Auld <matthew.auld at intel.com>
---
drivers/gpu/drm/i915/i915_gem.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index fd329b6b475c..82daaab022d8 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -337,6 +337,9 @@ i915_gem_gtt_pread(struct drm_i915_gem_object *obj,
u64 remain, offset;
int ret;
+ if (!HAS_MAPPABLE_APERTURE(i915))
+ return -ENOSPC;
+
ret = mutex_lock_interruptible(&i915->drm.struct_mutex);
if (ret)
return ret;
@@ -530,6 +533,9 @@ i915_gem_gtt_pwrite_fast(struct drm_i915_gem_object *obj,
void __user *user_data;
int ret;
+ if (!HAS_MAPPABLE_APERTURE(i915))
+ return -ENOSPC;
+
ret = mutex_lock_interruptible(&i915->drm.struct_mutex);
if (ret)
return ret;
--
2.20.1
More information about the Intel-gfx
mailing list