Module: Mesa Branch: main Commit: 8ce3b99bc143e7c4c65e9f5149e3131e70f44d83 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8ce3b99bc143e7c4c65e9f5149e3131e70f44d83
Author: Rohan Garg <rohan.g...@intel.com> Date: Thu Oct 26 15:37:25 2023 +0200 iris: Wa 16014538804 for DG2, MTL A0 Send empty/dummy PIPE_CONTROL after every third 3DPRIMITIVE command. Signed-off-by: Rohan Garg <rohan.g...@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwer...@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25039> --- src/gallium/drivers/iris/iris_batch.h | 2 ++ src/gallium/drivers/iris/iris_genx_protos.h | 1 + src/gallium/drivers/iris/iris_state.c | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+) diff --git a/src/gallium/drivers/iris/iris_batch.h b/src/gallium/drivers/iris/iris_batch.h index 67a6e31e877..341a3c9fe5e 100644 --- a/src/gallium/drivers/iris/iris_batch.h +++ b/src/gallium/drivers/iris/iris_batch.h @@ -212,6 +212,8 @@ struct iris_batch { /** Batch wrapper structure for perfetto */ struct intel_ds_queue ds; + + uint8_t num_3d_primitives_emitted; }; void iris_init_batches(struct iris_context *ice); diff --git a/src/gallium/drivers/iris/iris_genx_protos.h b/src/gallium/drivers/iris/iris_genx_protos.h index 9742f744103..bedce464abc 100644 --- a/src/gallium/drivers/iris/iris_genx_protos.h +++ b/src/gallium/drivers/iris/iris_genx_protos.h @@ -44,6 +44,7 @@ void genX(update_pma_fix)(struct iris_context *ice, void genX(invalidate_aux_map_state)(struct iris_batch *batch); void genX(emit_breakpoint)(struct iris_batch *batch, bool emit_before_draw); +void genX(emit_3dprimitive_was)(struct iris_batch *batch); static inline void genX(maybe_emit_breakpoint)(struct iris_batch *batch, diff --git a/src/gallium/drivers/iris/iris_state.c b/src/gallium/drivers/iris/iris_state.c index 3cbeea7e42f..f32e7e60479 100644 --- a/src/gallium/drivers/iris/iris_state.c +++ b/src/gallium/drivers/iris/iris_state.c @@ -7869,6 +7869,24 @@ genX(emit_breakpoint)(struct iris_batch *batch, bool emit_before_draw) } } +void +genX(emit_3dprimitive_was)(struct iris_batch *batch) +{ + UNUSED const struct intel_device_info *devinfo = batch->screen->devinfo; +#if INTEL_NEEDS_WA_16014538804 + if (!intel_needs_workaround(devinfo, 16014538804)) + return; + + batch->num_3d_primitives_emitted++; + + /* Wa_16014538804 - Send empty/dummy pipe control after 3 3DPRIMITIVE. */ + if (batch->num_3d_primitives_emitted == 3) { + iris_emit_pipe_control_flush(batch, "Wa_16014538804", 0); + batch->num_3d_primitives_emitted = 0; + } +#endif +} + static void iris_upload_render_state(struct iris_context *ice, struct iris_batch *batch, @@ -8114,6 +8132,7 @@ iris_upload_render_state(struct iris_context *ice, } } + genX(emit_3dprimitive_was)(batch); genX(maybe_emit_breakpoint)(batch, false); #if GFX_VERx10 == 125