mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-21 04:38:09 +02:00
anv: Move WA MEDIA_VFE_STATE after stalling PIPE_CONTROL
Fixes:bc612536("anv: Emit a dummy MEDIA_VFE_STATE before switching from GPGPU to 3D") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6172 Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21472> (cherry picked from commit07b57deea2)
This commit is contained in:
parent
f817193569
commit
df02db05e7
2 changed files with 32 additions and 23 deletions
|
|
@ -6790,7 +6790,7 @@
|
|||
"description": "anv: Move WA MEDIA_VFE_STATE after stalling PIPE_CONTROL",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "bc612536eb2f0f77725103e53077ad5a28036ac3"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -6015,28 +6015,6 @@ genX(flush_pipeline_select)(struct anv_cmd_buffer *cmd_buffer,
|
|||
*/
|
||||
if (pipeline == GPGPU)
|
||||
anv_batch_emit(&cmd_buffer->batch, GENX(3DSTATE_CC_STATE_POINTERS), t);
|
||||
|
||||
if (pipeline == _3D) {
|
||||
/* There is a mid-object preemption workaround which requires you to
|
||||
* re-emit MEDIA_VFE_STATE after switching from GPGPU to 3D. However,
|
||||
* even without preemption, we have issues with geometry flickering when
|
||||
* GPGPU and 3D are back-to-back and this seems to fix it. We don't
|
||||
* really know why.
|
||||
*/
|
||||
anv_batch_emit(&cmd_buffer->batch, GENX(MEDIA_VFE_STATE), vfe) {
|
||||
vfe.MaximumNumberofThreads =
|
||||
devinfo->max_cs_threads * devinfo->subslice_total - 1;
|
||||
vfe.NumberofURBEntries = 2;
|
||||
vfe.URBEntryAllocationSize = 2;
|
||||
}
|
||||
|
||||
/* We just emitted a dummy MEDIA_VFE_STATE so now that packet is
|
||||
* invalid. Set the compute pipeline to dirty to force a re-emit of the
|
||||
* pipeline in case we get back-to-back dispatch calls with the same
|
||||
* pipeline and a PIPELINE_SELECT in between.
|
||||
*/
|
||||
cmd_buffer->state.compute.pipeline_dirty = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
/* From "BXML » GT » MI » vol1a GPU Overview » [Instruction]
|
||||
|
|
@ -6065,6 +6043,37 @@ genX(flush_pipeline_select)(struct anv_cmd_buffer *cmd_buffer,
|
|||
"flush and invalidate for PIPELINE_SELECT");
|
||||
genX(cmd_buffer_apply_pipe_flushes)(cmd_buffer);
|
||||
|
||||
#if GFX_VER == 9
|
||||
if (pipeline == _3D) {
|
||||
/* There is a mid-object preemption workaround which requires you to
|
||||
* re-emit MEDIA_VFE_STATE after switching from GPGPU to 3D. However,
|
||||
* even without preemption, we have issues with geometry flickering when
|
||||
* GPGPU and 3D are back-to-back and this seems to fix it. We don't
|
||||
* really know why.
|
||||
*
|
||||
* Also, from the Sky Lake PRM Vol 2a, MEDIA_VFE_STATE:
|
||||
*
|
||||
* "A stalling PIPE_CONTROL is required before MEDIA_VFE_STATE unless
|
||||
* the only bits that are changed are scoreboard related ..."
|
||||
*
|
||||
* This is satisfied by applying pre-PIPELINE_SELECT pipe flushes above.
|
||||
*/
|
||||
anv_batch_emit(&cmd_buffer->batch, GENX(MEDIA_VFE_STATE), vfe) {
|
||||
vfe.MaximumNumberofThreads =
|
||||
devinfo->max_cs_threads * devinfo->subslice_total - 1;
|
||||
vfe.NumberofURBEntries = 2;
|
||||
vfe.URBEntryAllocationSize = 2;
|
||||
}
|
||||
|
||||
/* We just emitted a dummy MEDIA_VFE_STATE so now that packet is
|
||||
* invalid. Set the compute pipeline to dirty to force a re-emit of the
|
||||
* pipeline in case we get back-to-back dispatch calls with the same
|
||||
* pipeline and a PIPELINE_SELECT in between.
|
||||
*/
|
||||
cmd_buffer->state.compute.pipeline_dirty = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
anv_batch_emit(&cmd_buffer->batch, GENX(PIPELINE_SELECT), ps) {
|
||||
ps.MaskBits = GFX_VER >= 12 ? 0x13 : 3;
|
||||
ps.MediaSamplerDOPClockGateEnable = GFX_VER >= 12;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue