drm/i915: Clear vma->bound on unbinding
authorMika Kuoppala <[email protected]>
Thu, 30 Apr 2015 08:02:31 +0000 (11:02 +0300)
committerDaniel Vetter <[email protected]>
Fri, 8 May 2015 11:03:29 +0000 (13:03 +0200)
Unbinding doesn't always lead to unconditional destruction
of vma. This destruction avoidance happens if vma is part of
execbuffer relocation list or if vma is being considered for
eviction in i915_gem_evict_something().

For those other users, mark the vma unbound so that
the correct state of this vma is preserved.

Reported-by: Chris Wilson <[email protected]>
Cc: Chris Wilson <[email protected]>
Cc: Daniel Vetter <[email protected]>
Signed-off-by: Mika Kuoppala <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
drivers/gpu/drm/i915/i915_gem.c

index e8f6f4c0a2c6ad532f3b5553dc7677617a80902d..c378f042114531d844465c27dc9a31d3b52478cc 100644 (file)
@@ -3069,6 +3069,7 @@ int i915_vma_unbind(struct i915_vma *vma)
        trace_i915_vma_unbind(vma);
 
        vma->vm->unbind_vma(vma);
+       vma->bound = 0;
 
        list_del_init(&vma->mm_list);
        if (i915_is_ggtt(vma->vm)) {