anv: add a command streamer stall on Xe2+ when switching pipelines

Xe2+ gets rid of PIPELINE_SELECT, so we need to make sure we add a stall
when switching pipelines

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27823>
This commit is contained in:
Rohan Garg
2024-02-28 15:16:22 +01:00
committed by Marge Bot
parent af41fad1e9
commit 3dbc15e74e

View File

@@ -3737,6 +3737,18 @@ genX(flush_pipeline_select)(struct anv_cmd_buffer *cmd_buffer,
return;
#if GFX_VER >= 20
/* While PIPELINE_SELECT is not needed on Xe2+, our current assumption
* is that the pipelined flushes in the 3D pipeline are not getting
* synchronized with the compute dispatches (and vice versa). So we need
* a CS_STALL prior the next set of commands to ensure the flushes have
* completed.
*
* The new RESOURCE_BARRIER instruction has support for synchronizing
* 3D/Compute and once we switch to that we should be able to get rid of
* this CS_STALL.
*/
anv_add_pending_pipe_bits(cmd_buffer, ANV_PIPE_CS_STALL_BIT, "pipeline switch stall");
/* Since we are not stalling/flushing caches explicitly while switching
* between the pipelines, we need to apply data dependency flushes recorded
* previously on the resource.