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

Author: Georg Lehmann <[email protected]>
Date:   Tue Nov 21 15:24:35 2023 +0100

aco/sched: treat p_dual_src_export_gfx11 like export

This prevents the scheduler from moving the dual source export above mrtz
export, which caused hangs.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10173

Cc: mesa-stable
Reviewed-by: Rhys Perry <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26317>
(cherry picked from commit 0a5d3ac8d2b245e8b3f3589d3ade3de7356fe637)

---

 .pick_status.json                  | 2 +-
 src/amd/compiler/aco_scheduler.cpp | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index df2714983bc..4ef662c02b9 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -264,7 +264,7 @@
         "description": "aco/sched: treat p_dual_src_export_gfx11 like export",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null,
         "notes": null
diff --git a/src/amd/compiler/aco_scheduler.cpp 
b/src/amd/compiler/aco_scheduler.cpp
index 592e42c54c4..f4cebf7a493 100644
--- a/src/amd/compiler/aco_scheduler.cpp
+++ b/src/amd/compiler/aco_scheduler.cpp
@@ -596,13 +596,15 @@ perform_hazard_query(hazard_query* query, Instruction* 
instr, bool upwards)
       return hazard_fail_exec;
 
    /* Don't move exports so that they stay closer together.
+    * Since GFX11, export order matters. MRTZ must come first,
+    * then color exports sorted from first to last.
     * Also, with Primitive Ordered Pixel Shading on GFX11+, the `done` export 
must not be moved
     * above the memory accesses before the queue family scope (more precisely, 
fragment interlock
     * scope, but it's not available in ACO) release barrier that is expected 
to be inserted before
     * the export, as well as before any `s_wait_event export_ready` which 
enters the ordered
     * section, because the `done` export exits the ordered section.
     */
-   if (instr->isEXP())
+   if (instr->isEXP() || instr->opcode == aco_opcode::p_dual_src_export_gfx11)
       return hazard_fail_export;
 
    /* don't move non-reorderable instructions */

Reply via email to