OSDN Git Service

drm/i915: Remove erroneous i915_is_ggtt check for I915_GEM_OBJECT_UNBIND_VM_TRYLOCK
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Thu, 29 Apr 2021 12:01:58 +0000 (14:01 +0200)
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Fri, 30 Apr 2021 11:15:23 +0000 (13:15 +0200)
We changed the locking hierarchy for both ppgtt and ggtt, so both locks
should be trylocked inside i915_gem_object_unbind().

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Fixes: bc6f80cce9ae ("drm/i915: Use trylock in shrinker for ggtt on bsw vt-d and bxt, v2.")
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210429120158.1105318-1-maarten.lankhorst@linux.intel.com
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com> #irc
drivers/gpu/drm/i915/i915_gem.c

index 07da6a9..d0018c5 100644 (file)
@@ -158,8 +158,7 @@ try_again:
                        ret = -EBUSY;
                        if (flags & I915_GEM_OBJECT_UNBIND_ACTIVE ||
                            !i915_vma_is_active(vma)) {
-                               if (i915_is_ggtt(vma->vm) &&
-                                   flags & I915_GEM_OBJECT_UNBIND_VM_TRYLOCK) {
+                               if (flags & I915_GEM_OBJECT_UNBIND_VM_TRYLOCK) {
                                        if (mutex_trylock(&vma->vm->mutex)) {
                                                ret = __i915_vma_unbind(vma);
                                                mutex_unlock(&vma->vm->mutex);