[01/14] drm/i915: Move the get_pages assertions up to the right layer
diff mbox

Message ID 1354535352-3506-2-git-send-email-chris@chris-wilson.co.uk
State New, archived
Headers show

Commit Message

Chris Wilson Dec. 3, 2012, 11:48 a.m. UTC
A useful assertion resided inside the get_pages_gtt() routine,
which is generally applicable.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/i915_gem.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch
diff mbox

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index dfe7174..726bfc2 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1653,8 +1653,6 @@  i915_gem_object_put_pages_gtt(struct drm_i915_gem_object *obj)
 	struct scatterlist *sg;
 	int ret, i;
 
-	BUG_ON(obj->madv == __I915_MADV_PURGED);
-
 	ret = i915_gem_object_set_to_cpu_domain(obj, true);
 	if (ret) {
 		/* In the event of a disaster, abandon all caches and
@@ -1697,6 +1695,7 @@  i915_gem_object_put_pages(struct drm_i915_gem_object *obj)
 		return 0;
 
 	BUG_ON(obj->gtt_space);
+	BUG_ON(obj->madv == __I915_MADV_PURGED);
 
 	if (obj->pages_pin_count)
 		return -EBUSY;