Commit eb950819 authored by Thomas Hellström's avatar Thomas Hellström

drm/i915/gem: Remove some unnecessary code

The test for vma should always return true, and when assigning -EBUSY
to ret, the variable should already have that value.
Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: default avatarNiranjana Vishwanathapura <niranjana.vishwanathapura@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220304082641.308069-4-thomas.hellstrom@linux.intel.com
parent d9393973
...@@ -118,6 +118,7 @@ int i915_gem_object_unbind(struct drm_i915_gem_object *obj, ...@@ -118,6 +118,7 @@ int i915_gem_object_unbind(struct drm_i915_gem_object *obj,
unsigned long flags) unsigned long flags)
{ {
struct intel_runtime_pm *rpm = &to_i915(obj->base.dev)->runtime_pm; struct intel_runtime_pm *rpm = &to_i915(obj->base.dev)->runtime_pm;
bool vm_trylock = !!(flags & I915_GEM_OBJECT_UNBIND_VM_TRYLOCK);
LIST_HEAD(still_in_list); LIST_HEAD(still_in_list);
intel_wakeref_t wakeref; intel_wakeref_t wakeref;
struct i915_vma *vma; struct i915_vma *vma;
...@@ -170,8 +171,6 @@ int i915_gem_object_unbind(struct drm_i915_gem_object *obj, ...@@ -170,8 +171,6 @@ int i915_gem_object_unbind(struct drm_i915_gem_object *obj,
* and destroy the vma from under us. * and destroy the vma from under us.
*/ */
if (vma) {
bool vm_trylock = !!(flags & I915_GEM_OBJECT_UNBIND_VM_TRYLOCK);
ret = -EBUSY; ret = -EBUSY;
if (flags & I915_GEM_OBJECT_UNBIND_ASYNC) { if (flags & I915_GEM_OBJECT_UNBIND_ASYNC) {
assert_object_held(vma->obj); assert_object_held(vma->obj);
...@@ -184,14 +183,11 @@ int i915_gem_object_unbind(struct drm_i915_gem_object *obj, ...@@ -184,14 +183,11 @@ int i915_gem_object_unbind(struct drm_i915_gem_object *obj,
if (mutex_trylock(&vma->vm->mutex)) { if (mutex_trylock(&vma->vm->mutex)) {
ret = __i915_vma_unbind(vma); ret = __i915_vma_unbind(vma);
mutex_unlock(&vma->vm->mutex); mutex_unlock(&vma->vm->mutex);
} else {
ret = -EBUSY;
} }
} else { } else {
ret = i915_vma_unbind(vma); ret = i915_vma_unbind(vma);
} }
} }
}
i915_vm_put(vma->vm); i915_vm_put(vma->vm);
spin_lock(&obj->vma.lock); spin_lock(&obj->vma.lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment