summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-08-20 10:23:27 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-08-21 14:34:20 +0200
commitc4670ad080a1fe60d49f850e11f64a41db525496 (patch)
treefcd976c34eb795be6dbeef207d9b6a009040f5c3 /drivers/gpu/drm/i915/i915_gem.c
parent6c085a728cf000ac1865d66f8c9b52935558b328 (diff)
drm/i915: Add some sanity checks to unbound tracking
A pair of universally true checks that just need to be put in the right place depending on where in the patch sequence you go. Note that i915_gem_object_put_pages_gtt() already gains the BUG_ON(obj->gtt_space), but on reflection that needed to migrate to put_pages(). Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 462a8f2ad3a..a549be5f535 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -1378,6 +1378,8 @@ i915_gem_object_put_pages_gtt(struct drm_i915_gem_object *obj)
int page_count = obj->base.size / PAGE_SIZE;
int ret, i;
+ BUG_ON(obj->gtt_space);
+
if (obj->pages == NULL)
return 0;
@@ -2293,6 +2295,8 @@ i915_gem_object_unbind(struct drm_i915_gem_object *obj)
if (obj->pin_count)
return -EBUSY;
+ BUG_ON(obj->pages == NULL);
+
ret = i915_gem_object_finish_gpu(obj);
if (ret)
return ret;