diff mbox

drm/i915: Warn if the buffer is not in the correct domain during a fault

Message ID 1255259912-9765-1-git-send-email-chris@chris-wilson.co.uk (mailing list archive)
State Rejected
Headers show

Commit Message

Chris Wilson Oct. 11, 2009, 11:18 a.m. UTC
None
diff mbox

Patch

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;