iris: pull WA 22014412737 into emit_3dprimitive_was

Consolidate 3DPRIMITIVE WA's into a single function for iris

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/25039>
This commit is contained in:
Rohan Garg
2023-11-03 15:11:45 +01:00
committed by Marge Bot
parent 8ce3b99bc1
commit 1da1bcd038
2 changed files with 27 additions and 23 deletions
+4 -1
View File
@@ -44,7 +44,10 @@ 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);
void genX(emit_3dprimitive_was)(struct iris_batch *batch,
const struct pipe_draw_indirect_info *indirect,
uint32_t primitive_topology,
uint32_t vertex_count);
static inline void
genX(maybe_emit_breakpoint)(struct iris_batch *batch,
+23 -22
View File
@@ -7870,19 +7870,32 @@ genX(emit_breakpoint)(struct iris_batch *batch, bool emit_before_draw)
}
void
genX(emit_3dprimitive_was)(struct iris_batch *batch)
genX(emit_3dprimitive_was)(struct iris_batch *batch,
const struct pipe_draw_indirect_info *indirect,
uint32_t primitive_type,
uint32_t vertex_count)
{
UNUSED const struct intel_device_info *devinfo = batch->screen->devinfo;
#if INTEL_NEEDS_WA_16014538804
if (!intel_needs_workaround(devinfo, 16014538804))
return;
UNUSED const struct iris_context *ice = batch->ice;
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);
#if INTEL_NEEDS_WA_22014412737 || INTEL_NEEDS_WA_16014538804
if (intel_needs_workaround(devinfo, 22014412737) &&
(point_or_line_list(primitive_type) || indirect ||
(vertex_count == 1 || vertex_count == 2))) {
iris_emit_pipe_control_write(batch, "Wa_22014412737",
PIPE_CONTROL_WRITE_IMMEDIATE,
batch->screen->workaround_bo,
batch->screen->workaround_address.offset,
0ull);
batch->num_3d_primitives_emitted = 0;
} else if (intel_needs_workaround(devinfo, 16014538804)) {
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
}
@@ -8132,21 +8145,9 @@ iris_upload_render_state(struct iris_context *ice,
}
}
genX(emit_3dprimitive_was)(batch);
genX(emit_3dprimitive_was)(batch, indirect, ice->state.prim_mode, sc->count);
genX(maybe_emit_breakpoint)(batch, false);
#if GFX_VERx10 == 125
if (intel_needs_workaround(devinfo, 22014412737) &&
(point_or_line_list(ice->state.prim_mode) || indirect ||
(sc->count == 1 || sc->count == 2))) {
iris_emit_pipe_control_write(batch, "Wa_22014412737",
PIPE_CONTROL_WRITE_IMMEDIATE,
batch->screen->workaround_bo,
batch->screen->workaround_address.offset,
0ull);
}
#endif
iris_batch_sync_region_end(batch);
uint32_t count = (sc) ? sc->count : 0;