Module: Mesa
Branch: main
Commit: a6a95591aa40d5e5840c97f3efb29c2a106ea7ea
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a6a95591aa40d5e5840c97f3efb29c2a106ea7ea

Author: Mark Janes <markja...@swizzler.org>
Date:   Fri Dec  8 11:34:48 2023 -0800

intel/dev: poison macros for workarounds fixed at a stepping

INTEL_NEEDS_WA macros are valid when a workaround applies to all
platforms which have the GFX_VERx10 versions for the workaround.

Some workarounds were fixed at a stepping after the platform release.
If a workaround applies partially to any platform, then GFX_VERx10
cannot be used to correctly apply the workaround.

This change invalidates INTEL_NEEDS_WA_16014538804 and
INTEL_NEEDS_WA_22014412737, which were fixed for MTL platforms at
stepping b0.  The run-time checks were already present for all uses of
these macros.  Updating the poisoned macros to INTEL_WA_{num}_GFX_VER
compiles out the run-time checks on platforms where they cannot apply.

Acked-by: Caio Oliveira <caio.olive...@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwer...@intel.com>
Acked-by: Tapani Pälli <tapani.pa...@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26898>

---

 src/gallium/drivers/iris/iris_state.c | 2 +-
 src/intel/dev/gen_wa_helpers.py       | 5 +++--
 src/intel/vulkan/genX_cmd_buffer.c    | 4 ++--
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/iris/iris_state.c 
b/src/gallium/drivers/iris/iris_state.c
index 6806c369deb..7452d198a27 100644
--- a/src/gallium/drivers/iris/iris_state.c
+++ b/src/gallium/drivers/iris/iris_state.c
@@ -8118,7 +8118,7 @@ genX(emit_3dprimitive_was)(struct iris_batch *batch,
    UNUSED const struct intel_device_info *devinfo = batch->screen->devinfo;
    UNUSED const struct iris_context *ice = batch->ice;
 
-#if INTEL_NEEDS_WA_22014412737 || INTEL_NEEDS_WA_16014538804
+#if INTEL_WA_22014412737_GFX_VER || INTEL_WA_16014538804_GFX_VER
    if (intel_needs_workaround(devinfo, 22014412737) &&
        (point_or_line_list(primitive_type) || indirect ||
         (vertex_count == 1 || vertex_count == 2))) {
diff --git a/src/intel/dev/gen_wa_helpers.py b/src/intel/dev/gen_wa_helpers.py
index 9ffa4e72f12..2f782d31d08 100644
--- a/src/intel/dev/gen_wa_helpers.py
+++ b/src/intel/dev/gen_wa_helpers.py
@@ -249,8 +249,9 @@ def partial_gens(wa_def):
 
         # eliminate each platform specifically indicated by the WA, to see if
         # are left over.
-        for platform in bug["mesa_platforms"]:
-            wa_required_for_completeness.remove(platform)
+        for platform, desc in bug["mesa_platforms"].items():
+            if desc["steppings"] == "all":
+                wa_required_for_completeness.remove(platform)
 
         # if any platform remains in the required set, then this wa *partially*
         # applies to one of the gfxvers.
diff --git a/src/intel/vulkan/genX_cmd_buffer.c 
b/src/intel/vulkan/genX_cmd_buffer.c
index 600f5be96a6..1818d4bd718 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -3813,7 +3813,7 @@ genX(CmdExecuteCommands)(
                                 "Secondary cmd buffer not tracked in VF 
cache");
    }
 
-#if INTEL_NEEDS_WA_16014538804
+#if INTEL_WA_16014538804_GFX_VER
    if (anv_cmd_buffer_is_render_queue(container) &&
        intel_needs_workaround(device->info, 16014538804))
       anv_batch_emit(&container->batch, GENX(PIPE_CONTROL), pc);
@@ -8601,7 +8601,7 @@ genX(batch_emit_post_3dprimitive_was)(struct anv_batch 
*batch,
                                       uint32_t primitive_topology,
                                       uint32_t vertex_count)
 {
-#if INTEL_NEEDS_WA_22014412737 || INTEL_NEEDS_WA_16014538804
+#if INTEL_WA_22014412737_GFX_VER || INTEL_WA_16014538804_GFX_VER
    if (intel_needs_workaround(device->info, 22014412737) &&
        (primitive_topology == _3DPRIM_POINTLIST ||
         primitive_topology == _3DPRIM_LINELIST ||

Reply via email to