From 54efc5f68d69b2ec6b444a4713ceae1c1b0028ba 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 | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 2ee27d3..2aba509 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; } @@ -5081,7 +5078,7 @@ bool i915_gem_obj_bound_any(struct drm_i915_gem_object *o) struct i915_address_space *vm; list_for_each_entry(vm, &dev_priv->vm_list, global_link) - if (i915_gem_obj_bound(o, vm)) + if (drm_mm_node_allocated(&vma->node)) return true; return false; -- 1.7.9.5