genxml/mi: add additional bit to FF_MODE and autostrip helper

This provides bit and common code to control autostrip state.

Requirement for this is coming from Wa_14026781792. We are writing
register for Wa_14024997852 and since this register is nonmaskable
the bit needs to be written always. Helper takes care to touch only
required bits.

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/40344>
This commit is contained in:
Tapani Pälli 2026-03-27 13:47:44 +02:00 committed by Marge Bot
parent e08da4e928
commit bafa1120ce
2 changed files with 41 additions and 0 deletions

View file

@ -1694,4 +1694,44 @@ mi_goto_target_init_and_place(struct mi_builder *b)
#endif /* GFX_VER >= 9 */
/* Common code for drivers to set autostrip state. */
#if INTEL_WA_14024997852_GFX_VER
static inline void
mi_set_autostrip_state(struct mi_builder *b, bool enable)
{
struct mi_value ff_mode_reg = mi_reg32(GENX(FF_MODE_num));
uint32_t dword;
struct GENX(FF_MODE) ff_mode = {
.MeshShaderAutostripDisable = true,
.MeshShaderPartialAutostripDisable = true,
.TEAutostripDisable = true,
};
GENX(FF_MODE_pack)(NULL, &dword, &ff_mode);
/* This bit we want to always enable with Wa_14026781792. */
uint32_t bugfix;
struct GENX(FF_MODE) ff_mode_bugfix = {
#if INTEL_NEEDS_WA_14026781792
.TEPatchcontrolbugfix = true,
#endif
};
GENX(FF_MODE_pack)(NULL, &bugfix, &ff_mode_bugfix);
if (!enable) {
/* Enable flags. */
mi_store(b, ff_mode_reg,
mi_ior(b,
mi_imm(bugfix),
mi_ior(b, ff_mode_reg, mi_imm(dword))));
} else {
/* Disable flags. */
mi_store(b, ff_mode_reg,
mi_ior(b,
mi_imm(bugfix),
mi_iand(b, ff_mode_reg, mi_imm(~dword))));
}
}
#endif
#endif /* MI_BUILDER_H */

View file

@ -1953,6 +1953,7 @@
<field name="Disable Preemption and High Priority Pausing due to 3DPRIMITIVE Command Mask" dword="0" bits="26:26" type="bool" />
</register>
<register name="FF_MODE" length="1" num="0x6210">
<field name="TE Patch control bug fix" dword="0" bits="4:4" type="bool" />
<field name="Mesh Shader Autostrip Disable" dword="0" bits="15:15" type="bool" />
<field name="Mesh Shader Partial Autostrip Disable" dword="0" bits="16:16" type="bool" />
<field name="TE Autostrip Disable" dword="0" bits="31:31" type="bool" />