[Intel-gfx] [PATCH] drm/i915: Warn if the buffer is not in the correct domain during a fault

Chris Wilson chris at chris-wilson.co.uk
Sun Oct 11 13:18:32 CEST 2009


Eric convinced me a pair of poorly coordinating applications may trigger
this condition and so the potential result of misrendering was
preferable to killing the victim with a SIGBUS. However, I'm curious to
know if we are hitting this condition -- in particular whether it is the
cause (or perhaps just a symptom) of some of our current rendering bugs.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index abfc27b..0c788c6 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1217,6 +1217,9 @@ int i915_gem_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 			goto unlock;
 	}
 
+	WARN_ON((obj->read_domains & I915_GEM_DOMAIN_GTT) == 0);
+	WARN_ON(write && (obj->write_domain & I915_GEM_DOMAIN_GTT) == 0);
+
 	pfn = ((dev->agp->base + obj_priv->gtt_offset) >> PAGE_SHIFT) +
 		page_offset;
 
-- 
1.6.4.3




More information about the Intel-gfx mailing list