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

Author: Rafael Antognolli <[email protected]>
Date:   Tue Mar  3 08:07:32 2020 -0800

intel/gen12+: Disable mid thread preemption.

Fixes a GPU hang in Car Chase.

Cc: [email protected]

v2: Add comment explaining why (Jason).

Reviewed-by: Jason Ekstrand <[email protected]>
Reviewed-by: Lionel Landwerlin <[email protected]>
Tested-by: Marge Bot 
<https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4035>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4035>
(cherry picked from commit 5f13996262a6d72ca5b5c235647d5257ae961b66)

---

 .pick_status.json                     |  2 +-
 src/gallium/drivers/iris/iris_state.c | 12 ++++++++++++
 src/intel/genxml/gen12.xml            |  1 +
 src/intel/vulkan/genX_pipeline.c      | 12 ++++++++++++
 4 files changed, 26 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index 733cf38e272..4756005ed94 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -139,7 +139,7 @@
         "description": "intel/gen12+: Disable mid thread preemption.",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/gallium/drivers/iris/iris_state.c 
b/src/gallium/drivers/iris/iris_state.c
index 482b4f68376..34a3d646954 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -4363,6 +4363,18 @@ iris_store_cs_state(struct iris_context *ice,
       desc.BarrierEnable = cs_prog_data->uses_barrier;
       desc.CrossThreadConstantDataReadLength =
          cs_prog_data->push.cross_thread.regs;
+#if GEN_GEN >= 12
+      /* TODO: Check if we are missing workarounds and enable mid-thread
+       * preemption.
+       *
+       * We still have issues with mid-thread preemption (it was already
+       * disabled by the kernel on gen11, due to missing workarounds). It's
+       * possible that we are just missing some workarounds, and could enable
+       * it later, but for now let's disable it to fix a GPU in compute in Car
+       * Chase (and possibly more).
+       */
+      desc.ThreadPreemptionDisable = true;
+#endif
    }
 }
 
diff --git a/src/intel/genxml/gen12.xml b/src/intel/genxml/gen12.xml
index 6ed9ccc369e..4fd7e66251b 100644
--- a/src/intel/genxml/gen12.xml
+++ b/src/intel/genxml/gen12.xml
@@ -525,6 +525,7 @@
       <value name="Ftz" value="0"/>
       <value name="SetByKernel" value="1"/>
     </field>
+    <field name="Thread Preemption Disable" start="84" end="84" type="bool"/>
     <field name="Sampler Count" start="98" end="100" type="uint">
       <value name="No samplers used" value="0"/>
       <value name="Between 1 and 4 samplers used" value="1"/>
diff --git a/src/intel/vulkan/genX_pipeline.c b/src/intel/vulkan/genX_pipeline.c
index 6e01377c6f4..1c300054927 100644
--- a/src/intel/vulkan/genX_pipeline.c
+++ b/src/intel/vulkan/genX_pipeline.c
@@ -2356,6 +2356,18 @@ compute_pipeline_create(
       .CrossThreadConstantDataReadLength =
          cs_prog_data->push.cross_thread.regs,
 #endif
+#if GEN_GEN >= 12
+      /* TODO: Check if we are missing workarounds and enable mid-thread
+       * preemption.
+       *
+       * We still have issues with mid-thread preemption (it was already
+       * disabled by the kernel on gen11, due to missing workarounds). It's
+       * possible that we are just missing some workarounds, and could enable
+       * it later, but for now let's disable it to fix a GPU in compute in Car
+       * Chase (and possibly more).
+       */
+      .ThreadPreemptionDisable = true,
+#endif
 
       .NumberofThreadsinGPGPUThreadGroup = cs_prog_data->threads,
    };

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

Reply via email to