[PATCH 101/101] vma-sync-before-lock

Chris Wilson chris at chris-wilson.co.uk
Mon Jul 27 23:13:06 UTC 2020


---
 drivers/gpu/drm/i915/i915_vma.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_vma.c b/drivers/gpu/drm/i915/i915_vma.c
index 0276e9f0357a..f945de6b8fa8 100644
--- a/drivers/gpu/drm/i915/i915_vma.c
+++ b/drivers/gpu/drm/i915/i915_vma.c
@@ -1157,10 +1157,13 @@ void i915_vma_release(struct kref *ref)
 	struct i915_vma *vma = container_of(ref, typeof(*vma), ref);
 
 	if (drm_mm_node_allocated(&vma->node)) {
+		i915_vma_sync(vma);
+
 		mutex_lock(&vma->vm->mutex);
 		atomic_and(~I915_VMA_PIN_MASK, &vma->flags);
-		WARN_ON(__i915_vma_unbind(vma));
+		GEM_WARN_ON(__i915_vma_unbind(vma));
 		mutex_unlock(&vma->vm->mutex);
+
 		GEM_BUG_ON(drm_mm_node_allocated(&vma->node));
 	}
 	GEM_BUG_ON(i915_vma_is_active(vma));
-- 
2.20.1



More information about the Intel-gfx-trybot mailing list