mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-28 15:40:13 +01:00
[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.
This commit is contained in:
parent
68856b619b
commit
93c2871ecc
1 changed files with 7 additions and 9 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue