summaryrefslogtreecommitdiff
path: root/linux-core/i915_gem.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-06-13 19:43:40 -0700
committerKeith Packard <keithp@keithp.com>2008-06-13 19:43:40 -0700
commit93c2871eccc1abde0d88ea439cf963c4895a26fc (patch)
treeda36a8f22b7af37c955f633e891d62b381978ea7 /linux-core/i915_gem.c
parent68856b619bc1a2e91e67764911c8af4e2466fad9 (diff)
[intel-gem] BUG_ON active objects in gem_object_unbind
Now that gem_object_unbind waits for rendering to complete, objects should not be active when they are being pulled from the GTT. BUG_ON if this is broken.
Diffstat (limited to 'linux-core/i915_gem.c')
-rw-r--r--linux-core/i915_gem.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/linux-core/i915_gem.c b/linux-core/i915_gem.c
index 8741eecd..a15d7f23 100644
--- a/linux-core/i915_gem.c
+++ b/linux-core/i915_gem.c
@@ -734,8 +734,10 @@ i915_gem_object_unbind(struct drm_gem_object *obj)
*/
ret = i915_gem_object_set_domain(obj, I915_GEM_DOMAIN_CPU,
I915_GEM_DOMAIN_CPU);
- if (ret)
+ if (ret) {
+ DRM_ERROR("set_domain failed: %d\n", ret);
return ret;
+ }
if (obj_priv->agp_mem != NULL) {
drm_unbind_agp(obj_priv->agp_mem);
@@ -743,6 +745,8 @@ i915_gem_object_unbind(struct drm_gem_object *obj)
obj_priv->agp_mem = NULL;
}
+ BUG_ON(obj_priv->active);
+
i915_gem_object_free_page_list(obj);
atomic_dec(&dev->gtt_count);
@@ -752,15 +756,9 @@ i915_gem_object_unbind(struct drm_gem_object *obj)
obj_priv->gtt_space = NULL;
/* Remove ourselves from the LRU list if present. */
- if (!list_empty(&obj_priv->list)) {
+ if (!list_empty(&obj_priv->list))
list_del_init(&obj_priv->list);
- if (obj_priv->active) {
- DRM_ERROR("Failed to wait on buffer when unbinding, "
- "continued anyway.\n");
- obj_priv->active = 0;
- drm_gem_object_unreference(obj);
- }
- }
+
return 0;
}