From 93c2871eccc1abde0d88ea439cf963c4895a26fc Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Fri, 13 Jun 2008 19:43:40 -0700 Subject: [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. --- linux-core/i915_gem.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'linux-core') 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; } -- cgit v1.2.3