intel: Initialize FF_MODE2 on all Gfx12 platforms

On Alchemist, the FF_MODE2 documentation says that we must set the
FF_MODE2 timer values for GS and HS to 224.  The hardware performance
tuning guide also recommends setting the TDS timer to 4.

On Tigerlake, i915 applies workarounds to set the GS timer to 224
(failing to do so can cause HS/DS unit hangs), and the TDS timer to 4
(for performance).  It doesn't currently apply a HS timer there, and
I'm not sure if it's strictly necessary, but given that Alchemist
needed it, and the other two settings matched, let's assume that it
ought to match as well.

Unfortunately, there has been a bug in the i915 workarounds
infrastructure for non-masked context registers where writing one
field of the register zeroes out all the others.  So, I believe the
Tigerlake TDS timer value of 4 isn't being applied correctly there,
though the register is also not readable on that platform which
makes it hard to verify.  So, this may also speed up tessellation.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9233
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23839>
This commit is contained in:
Kenneth Graunke
2023-06-22 15:59:31 -07:00
committed by Marge Bot
parent 427fee3507
commit 1b3669a1ed
4 changed files with 70 additions and 0 deletions

View File

@@ -484,6 +484,35 @@ init_render_queue_state(struct anv_queue *queue)
}
#endif
#if GFX_VER == 12
anv_batch_write_reg(&batch, GENX(FF_MODE2), reg) {
/* On Alchemist, the FF_MODE2 docs for the GS timer say:
*
* "The timer value must be set to 224."
*
* and Wa_16011163337 indicates this is the case for all Gfx12 parts,
* and that this is necessary to avoid hanging the HS/DS units. It
* also clarifies that 224 is literally 0xE0 in the bits, not 7*32=224.
*
* The HS timer docs also have the same quote for Alchemist. I am
* unaware of a reason it needs to be set to 224 on Tigerlake, but
* we do so for consistency if nothing else.
*
* For the TDS timer value, the docs say:
*
* "For best performance, a value of 4 should be programmed."
*
* i915 also sets it this way on Tigerlake due to workarounds.
*
* The default VS timer appears to be 0, so we leave it at that.
*/
reg.GSTimerValue = 224;
reg.HSTimerValue = 224;
reg.TDSTimerValue = 4;
reg.VSTimerValue = 0;
}
#endif
#if INTEL_NEEDS_WA_1508744258
/* Disable RHWO by setting 0x7010[14] by default except during resolve
* pass.