diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-12-22 21:02:54 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-12-23 12:30:23 +0000 |
commit | f5af1659d809e264d619e5f483fd8f47bced3b6a (patch) | |
tree | 658c57c43fc73fddac999421bdb104d818fd027d /drivers/gpu/drm | |
parent | 4941f35b48f7f329bdf2ccad17d6fdb2190f8d34 (diff) | |
download | linux-stable-f5af1659d809e264d619e5f483fd8f47bced3b6a.tar.gz linux-stable-f5af1659d809e264d619e5f483fd8f47bced3b6a.tar.bz2 linux-stable-f5af1659d809e264d619e5f483fd8f47bced3b6a.zip |
drm/i915: Add a simple is-bound check before unbinding
Only acquire the various atomic references required to unbind the vma if
we do need to unbind the vma.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191222210256.2066451-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 983755bec76b..e9f82e9cb6ff 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -138,6 +138,10 @@ try_again: struct i915_address_space *vm = vma->vm; bool awake = false; + list_move_tail(&vma->obj_link, &still_in_list); + if (!i915_vma_is_bound(vma, I915_VMA_BIND_MASK)) + continue; + ret = -EAGAIN; if (!i915_vm_tryopen(vm)) break; @@ -153,7 +157,6 @@ try_again: } } - list_move_tail(&vma->obj_link, &still_in_list); spin_unlock(&obj->vma.lock); ret = -EBUSY; |