[Intel-gfx] [PATCH] drm/i915/gem: Ensure aperture exists before setting domain to GTT

Stuart Summers stuart.summers at intel.com
Tue Nov 19 21:30:32 UTC 2019


mmap_gtt is already covered by a check for aperture presence.
Also add the case to the gem_set_domain IOCTL to avoid this
path for unsupported platforms.

Signed-off-by: Stuart Summers <stuart.summers at intel.com>
---
 drivers/gpu/drm/i915/gem/i915_gem_domain.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/i915/gem/i915_gem_domain.c b/drivers/gpu/drm/i915/gem/i915_gem_domain.c
index 9aebcf263191..cf1e221fe27a 100644
--- a/drivers/gpu/drm/i915/gem/i915_gem_domain.c
+++ b/drivers/gpu/drm/i915/gem/i915_gem_domain.c
@@ -112,6 +112,9 @@ i915_gem_object_set_to_gtt_domain(struct drm_i915_gem_object *obj, bool write)
 
 	assert_object_held(obj);
 
+	if (!i915_ggtt_has_aperture(&i915->ggtt))
+		return -ENODEV;
+
 	ret = i915_gem_object_wait(obj,
 				   I915_WAIT_INTERRUPTIBLE |
 				   (write ? I915_WAIT_ALL : 0),
-- 
2.22.0



More information about the Intel-gfx mailing list