Blame SOURCES/0001-iris-implement-inter-context-busy-tracking.patch

a202db
From 07dc3d4238e57901ccf98e0b506d9aad2c86b9d9 Mon Sep 17 00:00:00 2001
a202db
From: Paulo Zanoni <paulo.r.zanoni@intel.com>
a202db
Date: Mon, 10 Jan 2022 17:18:05 -0800
a202db
Subject: [PATCH] iris: implement inter-context busy-tracking
a202db
a202db
Previously, no buffers were ever marked as EXEC_OBJECT_ASYNC so the
a202db
Kernel would ensure dependency tracking for us. After we implemented
a202db
explicit busy tracking in commit 89a34cb8450a, only the external
a202db
objects kept relying on the Kernel's implicit tracking and Iris did
a202db
inter-batch busy tracking, meaning we lost inter-screen and
a202db
inter-context synchronization. This seemed fine to me since, as far as
a202db
I understood, it is the duty of the application to synchronize itself
a202db
against multiple screens and contexts.
a202db
a202db
The problem here is that applications were actually relying on the old
a202db
behavior where the Kernel guarantees synchronization, so 89a34cb8450a
a202db
can be seen as a regression. This commit addresses the inter-context
a202db
synchronization case.
a202db
a202db
Cc: mesa-stable
a202db
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5731
a202db
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5812
a202db
Fixes: 89a34cb8450a ("iris: switch to explicit busy tracking")
a202db
Tested-by: Konstantin Kharlamov <hi-angel@yandex.ru>
a202db
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
a202db
---
a202db
 src/gallium/drivers/iris/iris_batch.c | 8 ++++++++
a202db
 1 file changed, 8 insertions(+)
a202db
a202db
diff --git a/src/gallium/drivers/iris/iris_batch.c b/src/gallium/drivers/iris/iris_batch.c
a202db
index b7bde60aae7..1b0c5896d4f 100644
a202db
--- a/src/gallium/drivers/iris/iris_batch.c
a202db
+++ b/src/gallium/drivers/iris/iris_batch.c
a202db
@@ -835,6 +835,12 @@ update_bo_syncobjs(struct iris_batch *batch, struct iris_bo *bo, bool write)
a202db
       move_syncobj_to_batch(batch, &deps->write_syncobjs[other_batch_idx],
a202db
                             I915_EXEC_FENCE_WAIT);
a202db
 
a202db
+   /* If it's being written by our screen, wait on it too. This is relevant
a202db
+    * when there are multiple contexts on the same screen. */
a202db
+   if (deps->write_syncobjs[batch_idx])
a202db
+      move_syncobj_to_batch(batch, &deps->write_syncobjs[batch_idx],
a202db
+                            I915_EXEC_FENCE_WAIT);
a202db
+
a202db
    struct iris_syncobj *batch_syncobj = iris_batch_get_signal_syncobj(batch);
a202db
 
a202db
    if (write) {
a202db
@@ -847,6 +853,8 @@ update_bo_syncobjs(struct iris_batch *batch, struct iris_bo *bo, bool write)
a202db
 
a202db
       move_syncobj_to_batch(batch, &deps->read_syncobjs[other_batch_idx],
a202db
                            I915_EXEC_FENCE_WAIT);
a202db
+      move_syncobj_to_batch(batch, &deps->read_syncobjs[batch_idx],
a202db
+                           I915_EXEC_FENCE_WAIT);
a202db
 
a202db
    } else {
a202db
       /* If we're reading, replace the other read from our batch index. */
a202db
-- 
a202db
GitLab
a202db