diff --git a/.pick_status.json b/.pick_status.json index 95710777684..eaa5be815ec 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -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" }, diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 594b2e59513..2cfafa904f0 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -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;