Module: Mesa
Branch: staging/20.0
Commit: cbc7ba2e473e56b5c02bf422f8a7d51945b0d693
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=cbc7ba2e473e56b5c02bf422f8a7d51945b0d693

Author: Francisco Jerez <[email protected]>
Date:   Thu Mar 19 13:08:56 2020 -0700

intel/fs/gen12: Fix interaction of SWSB dependency combination with EU fusion 
workaround.

This has been reported to fix a hang in Shadow of Mordor on Gen12.
One of its compute shaders seems to cause an in-order exec_all
dependency to be merged into an out-of-order SET dependency slot,
which would prevent us from baking the SET dependency into the parent
instruction, leading to an assert failure in emit_inst_dependencies()
(Thanks to Rafael for noticing that).  Prevent that by avoiding
combination of in-order dependencies whenever that would cause a SET
dependency to be demoted to a SYNC.NOP instruction.

Fixes: e14529ff3262a527 "intel/fs/gen12: Workaround data coherency issues due 
to broken NoMask control flow."
Tested-by: Rafael Antognolli <[email protected]>
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
(cherry picked from commit 36c155a0178d6f05d65a9acfe5b7553d7a522f07)

---

 .pick_status.json                        |  2 +-
 src/intel/compiler/brw_fs_scoreboard.cpp | 21 +++++++++++----------
 2 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 589b3581dc8..2d1b2acaf62 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -652,7 +652,7 @@
         "description": "intel/fs/gen12: Fix interaction of SWSB dependency 
combination with EU fusion workaround.",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "e14529ff3262a527d630cecac655f69c8ae15c3f"
     },
diff --git a/src/intel/compiler/brw_fs_scoreboard.cpp 
b/src/intel/compiler/brw_fs_scoreboard.cpp
index 5343aa1e634..cf619ffe3dc 100644
--- a/src/intel/compiler/brw_fs_scoreboard.cpp
+++ b/src/intel/compiler/brw_fs_scoreboard.cpp
@@ -658,6 +658,16 @@ namespace {
 
          /* Try to combine the specified dependency with any existing ones. */
          for (unsigned i = 0; i < deps.size(); i++) {
+            /* Don't combine otherwise matching dependencies if there is an
+             * exec_all mismatch which would cause a SET dependency to gain an
+             * exec_all flag, since that would prevent it from being baked
+             * into the instruction we want to allocate an SBID for.
+             */
+            if (deps[i].exec_all != dep.exec_all &&
+                (!deps[i].exec_all || (dep.unordered & TGL_SBID_SET)) &&
+                (!dep.exec_all || (deps[i].unordered & TGL_SBID_SET)))
+               continue;
+
             if (dep.ordered && deps[i].ordered) {
                deps[i].jp = MAX2(deps[i].jp, dep.jp);
                deps[i].ordered |= dep.ordered;
@@ -665,16 +675,7 @@ namespace {
                dep.ordered = TGL_REGDIST_NULL;
             }
 
-            /* Don't combine otherwise matching unordered dependencies if
-             * there is an exec_all mismatch which would cause a SET
-             * dependency to gain an exec_all flag, since that would prevent
-             * it from being baked into the instruction we want to allocate an
-             * SBID for.
-             */
-            if (dep.unordered && deps[i].unordered && deps[i].id == dep.id &&
-                (deps[i].exec_all == dep.exec_all ||
-                 (deps[i].exec_all && !(dep.unordered & TGL_SBID_SET)) ||
-                 (dep.exec_all && !(deps[i].unordered & TGL_SBID_SET)))) {
+            if (dep.unordered && deps[i].unordered && deps[i].id == dep.id) {
                deps[i].unordered |= dep.unordered;
                deps[i].exec_all |= dep.exec_all;
                dep.unordered = TGL_SBID_NULL;

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to