From 00a91d88702b7d429bba0089324cf4f78b3ec8e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Mon, 12 Jun 2023 16:37:06 +0300 Subject: [PATCH] anv: use workaround framework for 1408224581, 14014097488 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This makes sure we apply WA only when it is required, these issues do not happen for later MTL steppings. Signed-off-by: Tapani Pälli Reviewed-by: Nanley Chery Part-of: --- src/intel/vulkan/genX_cmd_buffer.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 53fb686db35..674203a433c 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -7096,18 +7096,21 @@ cmd_buffer_emit_depth_stencil(struct anv_cmd_buffer *cmd_buffer) cmd_buffer->state.pending_pipe_bits |= ANV_PIPE_POST_SYNC_BIT; genX(cmd_buffer_apply_pipe_flushes)(cmd_buffer); - /* Wa_1408224581 - * - * Workaround: Gfx12LP Astep only An additional pipe control with - * post-sync = store dword operation would be required.( w/a is to - * have an additional pipe control after the stencil state whenever - * the surface state bits of this state is changing). - * - * This also seems sufficient to handle Wa_14014097488. - */ - anv_batch_emit(&cmd_buffer->batch, GENX(PIPE_CONTROL), pc) { - pc.PostSyncOperation = WriteImmediateData; - pc.Address = cmd_buffer->device->workaround_address; + if (intel_needs_workaround(cmd_buffer->device->info, 1408224581) || + intel_needs_workaround(cmd_buffer->device->info, 14014097488)) { + /* Wa_1408224581 + * + * Workaround: Gfx12LP Astep only An additional pipe control with + * post-sync = store dword operation would be required.( w/a is to + * have an additional pipe control after the stencil state whenever + * the surface state bits of this state is changing). + * + * This also seems sufficient to handle Wa_14014097488. + */ + anv_batch_emit(&cmd_buffer->batch, GENX(PIPE_CONTROL), pc) { + pc.PostSyncOperation = WriteImmediateData; + pc.Address = cmd_buffer->device->workaround_address; + } } } cmd_buffer->state.hiz_enabled = isl_aux_usage_has_hiz(info.hiz_usage);