iris: implement autostrip disable for Wa_14024997852

Note that currently autostrip is disabled globally with
Wa_14021490052 for some gfx versions and steppings.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37975>
This commit is contained in:
Tapani Pälli
2025-10-17 13:15:51 +03:00
committed by Marge Bot
parent 0ff1dd9e0c
commit 7d9cf48fd7
2 changed files with 53 additions and 0 deletions
+3
View File
@@ -1068,6 +1068,9 @@ struct iris_context {
/** State for Wa_14015055625, Wa_14019166699 */
bool uses_primitive_id;
/** State for Wa_14024997852. */
bool autostrip_state;
/** Do we have integer RT in current framebuffer state? */
bool has_integer_rt;
+50
View File
@@ -6904,6 +6904,34 @@ emit_wa_18020335297_dummy_draw(struct iris_batch *batch)
}
}
static void
setup_autostrip_state(struct iris_context *ice,
struct iris_batch *batch,
bool enable)
{
#if GFX_VERx10 >= 200
if (ice->state.autostrip_state != enable) {
iris_emit_pipe_control_flush(batch,
"Wa_14024997852",
PIPE_CONTROL_CS_STALL);
/* VF */
iris_emit_reg(batch, GENX(VFL_SCRATCH_PAD), vfl) {
vfl.AutostripDisable = !enable;
vfl.PartialAutostripDisable = !enable;
vfl.AutostripDisableMask = true;
vfl.PartialAutostripDisableMask = true;
}
/* TE and Mesh. */
iris_emit_reg(batch, GENX(FF_MODE), ff) {
ff.TEAutostripDisable = !enable;
ff.MeshShaderAutostripDisable = !enable;
ff.MeshShaderPartialAutostripDisable = !enable;
}
ice->state.autostrip_state = enable;
}
#endif
}
static void
iris_upload_dirty_render_state(struct iris_context *ice,
struct iris_batch *batch,
@@ -6939,6 +6967,28 @@ iris_upload_dirty_render_state(struct iris_context *ice,
struct iris_fs_data *fs_data =
iris_fs_data(ice->shaders.prog[MESA_SHADER_FRAGMENT]);
/* Wa_14024997852: When Draw Cut Index or primitive id is enabled
* and topology is tri list, we need to toggle autostrip.
*
* Note that we do not take primitive id in to account because it
* is mentioned only in xe2 clone of this wa and autostrip has been
* disabled globally on xe2 (+xe3 a0) by kernel due to 14021490052
* workaround.
*/
if (intel_needs_workaround(batch->screen->devinfo, 14024997852) &&
dirty & (IRIS_DIRTY_VF | IRIS_DIRTY_VF_TOPOLOGY)) {
bool tri_list_topology =
translate_prim_type(draw->mode, ice->state.vertices_per_patch) ==
_3DPRIM_TRILIST;
/* Enable autostrip unless having triangle list topology and
* IndexedDrawCutIndexEnable (only used on primitive_restart).
*/
setup_autostrip_state(ice, batch,
tri_list_topology &&
draw->primitive_restart);
}
/* When MSAA is enabled, instead of using BLENDFACTOR_ZERO use
* CONST_COLOR, CONST_ALPHA and supply zero by using blend constants.
*/