intel/gen12+: Disable mid thread preemption.
authorRafael Antognolli <rafael.antognolli@intel.com>
Tue, 3 Mar 2020 16:07:32 +0000 (08:07 -0800)
committerMarge Bot <eric+marge@anholt.net>
Tue, 3 Mar 2020 19:52:06 +0000 (19:52 +0000)
Fixes a GPU hang in Car Chase.

Cc: mesa-stable@lists.freedesktop.org
v2: Add comment explaining why (Jason).

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4035>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4035>

src/gallium/drivers/iris/iris_state.c
src/intel/genxml/gen12.xml
src/intel/vulkan/genX_pipeline.c

index 5574b073a79de703ee955eae7f39a33c4b2a984e..6c760e04635c5e18a94c65b8ddd4dc7f5c875386 100644 (file)
@@ -4378,6 +4378,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
    }
 }
 
index 127bc549a8be7372f1dc9cd8e08e72ec1be3bcfe..f9fd23214287f53b2072e3d416b671e22d39aeb7 100644 (file)
       <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"/>
index c9f8eaa6f51c775203a0805b259af360ae00c27d..52a363fc07569c85ad0b2efebe6a3107a94c2c20 100644 (file)
@@ -2354,6 +2354,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,
    };