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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



A useful assertion resided inside the get_pages_gtt() routine,
which is generally applicable.

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

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;
-- 
1.7.10.4



[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux