anv: refactor batch_set_preemption to use batch_emit_pipe_control

This makes it easier to hook workarounds for this pipe control.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24690>
This commit is contained in:
Tapani Pälli
2023-08-15 12:20:14 +03:00
committed by Marge Bot
parent f3398683f2
commit 71a2d651c1
3 changed files with 11 additions and 8 deletions
+3 -1
View File
@@ -209,7 +209,9 @@ genX(ray_tracing_pipeline_emit)(struct anv_ray_tracing_pipeline *pipeline);
})
void
genX(batch_set_preemption)(struct anv_batch *batch, bool value);
genX(batch_set_preemption)(struct anv_batch *batch,
const struct intel_device_info *devinfo,
bool value);
void
genX(cmd_buffer_set_preemption)(struct anv_cmd_buffer *cmd_buffer, bool value);
+6 -5
View File
@@ -3209,7 +3209,9 @@ genX(batch_emit_pipe_control_write)(struct anv_batch *batch,
/* Set preemption on/off. */
void
genX(batch_set_preemption)(struct anv_batch *batch, bool value)
genX(batch_set_preemption)(struct anv_batch *batch,
const struct intel_device_info *devinfo,
bool value)
{
#if GFX_VERx10 >= 120
anv_batch_write_reg(batch, GENX(CS_CHICKEN1), cc1) {
@@ -3218,9 +3220,7 @@ genX(batch_set_preemption)(struct anv_batch *batch, bool value)
}
/* Wa_16013994831 - we need to insert CS_STALL and 250 noops. */
anv_batch_emit(batch, GENX(PIPE_CONTROL), pipe) {
pipe.CommandStreamerStallEnable = true;
}
genX(batch_emit_pipe_control)(batch, devinfo, ANV_PIPE_CS_STALL_BIT);
for (unsigned i = 0; i < 250; i++)
anv_batch_emit(batch, GENX(MI_NOOP), noop);
@@ -3234,7 +3234,8 @@ genX(cmd_buffer_set_preemption)(struct anv_cmd_buffer *cmd_buffer, bool value)
if (cmd_buffer->state.gfx.object_preemption == value)
return;
genX(batch_set_preemption)(&cmd_buffer->batch, value);
genX(batch_set_preemption)(&cmd_buffer->batch, cmd_buffer->device->info,
value);
cmd_buffer->state.gfx.object_preemption = value;
#endif
}
+2 -2
View File
@@ -83,7 +83,7 @@ emit_common_so_memcpy(struct anv_batch *batch, struct anv_device *device,
/* Wa_16013994831 - Disable preemption during streamout. */
if (intel_needs_workaround(device->info, 16013994831))
genX(batch_set_preemption)(batch, false);
genX(batch_set_preemption)(batch, device->info, false);
#endif
anv_batch_emit(batch, GENX(3DSTATE_SBE), sbe) {
@@ -273,7 +273,7 @@ void
genX(emit_so_memcpy_end)(struct anv_memcpy_state *state)
{
if (intel_device_info_is_dg2(state->device->info))
genX(batch_set_preemption)(state->batch, true);
genX(batch_set_preemption)(state->batch, state->device->info, true);
anv_batch_emit(state->batch, GENX(MI_BATCH_BUFFER_END), end);