From b18f3d2276387e318e66f6e3ca4a7c840505f76c Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 28 Aug 2013 11:25:00 +0100 Subject: [PATCH] fix --- drivers/gpu/drm/i915/i915_gem.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 2ee27d3..d47298a 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -2798,14 +2798,11 @@ int i915_vma_unbind(struct i915_vma *vma) drm_mm_remove_node(&vma->node); -destroy: - i915_gem_vma_destroy(vma); - - /* Since the unbound list is global, only move to that list if - * no more VMAs exist. */ - if (list_empty(&obj->vma_list)) + if (!i915_gem_obj_bound_any(obj)); list_move_tail(&obj->global_list, &dev_priv->mm.unbound_list); +destroy: + i915_gem_vma_destroy(vma); return 0; } @@ -5077,11 +5074,10 @@ bool i915_gem_obj_bound(struct drm_i915_gem_object *o, bool i915_gem_obj_bound_any(struct drm_i915_gem_object *o) { - struct drm_i915_private *dev_priv = o->base.dev->dev_private; - struct i915_address_space *vm; + struct i915_vma *vma; - list_for_each_entry(vm, &dev_priv->vm_list, global_link) - if (i915_gem_obj_bound(o, vm)) + list_for_each_entry(vma, &o->vma_list, vma_link) + if (drm_mm_node_allocated(&vma->node)) return true; return false; -- 1.7.9.5