[PATCH] drm/i915: Differentiate between aliasing-ppgtt and ggtt pinning
Chris Wilson
chris at chris-wilson.co.uk
Wed Mar 25 22:09:49 UTC 2020
Userptr causes lockdep to complain when we are using the aliasing-ppgtt
(and ggtt, but for that it is rightfully so to complain about) in that
when we revoke the userptr we take a mutex which we also use to revoke
the mmaps. However, we only revoke mmaps for GGTT bindings and we never
allow userptr to create a GGTT binding so the warning should be false
and is simply caused by our conflation of the aliasing-ppgtt with the
ggtt. So lets try treating the binding into the aliasing-ppgtt as a
separate lockclass from the ggtt. The downside is that we are
deliberately suppressing lockdep;s ability to warn us of cycles.
---
drivers/gpu/drm/i915/i915_vma.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index 191577a98390..b044089165db 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -914,7 +914,8 @@ int i915_vma_pin(struct i915_vma *vma, u64 size, u64 alignment, u64 flags)
wakeref = intel_runtime_pm_get(&vma->vm->i915->runtime_pm);
/* No more allocations allowed once we hold vm->mutex */
- err = mutex_lock_interruptible(&vma->vm->mutex);
+ err = mutex_lock_interruptible_nested(&vma->vm->mutex,
+ !!(flags & PIN_USER));
if (err)
goto err_fence;
@@ -1320,7 +1321,8 @@ int i915_vma_unbind(struct i915_vma *vma)
if (err)
goto out_rpm;
- err = mutex_lock_interruptible(&vm->mutex);
+ err = mutex_lock_interruptible_nested(&vma->vm->mutex,
+ !!i915_vma_is_bound(vma, I915_VMA_LOCAL_BIND));
if (err)
goto out_rpm;
--
2.20.1
More information about the Intel-gfx-trybot
mailing list