anv: Add and use emit_pipeline_select()

To avoid the replication of code to properly emit PIPELINE_SELECT.

init_compute_queue_state() had a different emit of PIPELINE_SELECT but
as there is no compute engine in GFX VER 11 we are safe with the
differences.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20444>
This commit is contained in:
José Roberto de Souza
2022-12-26 09:34:23 -08:00
parent 57f73d097e
commit c6d1f76da2
4 changed files with 18 additions and 24 deletions
+14 -5
View File
@@ -6274,6 +6274,19 @@ genX(CmdTraceRaysIndirect2KHR)(
#endif /* GFX_VERx10 >= 125 */
/* Only emit PIPELINE_SELECT, for the whole mode switch and flushing use
* flush_pipeline_select()
*/
void
genX(emit_pipeline_select)(struct anv_batch *batch, uint32_t pipeline)
{
anv_batch_emit(batch, GENX(PIPELINE_SELECT), ps) {
ps.MaskBits = GFX_VER >= 12 ? 0x13 : 3;
ps.MediaSamplerDOPClockGateEnable = GFX_VER >= 12;
ps.PipelineSelection = pipeline;
}
}
static void
genX(flush_pipeline_select)(struct anv_cmd_buffer *cmd_buffer,
uint32_t pipeline)
@@ -6345,11 +6358,7 @@ genX(flush_pipeline_select)(struct anv_cmd_buffer *cmd_buffer,
"flush and invalidate for PIPELINE_SELECT");
genX(cmd_buffer_apply_pipe_flushes)(cmd_buffer);
anv_batch_emit(&cmd_buffer->batch, GENX(PIPELINE_SELECT), ps) {
ps.MaskBits = GFX_VER >= 12 ? 0x13 : 3;
ps.MediaSamplerDOPClockGateEnable = GFX_VER >= 12;
ps.PipelineSelection = pipeline;
}
genX(emit_pipeline_select)(&cmd_buffer->batch, pipeline);
#if GFX_VER == 9
if (devinfo->platform == INTEL_PLATFORM_GLK) {