radeonsi/gfx11: use new packet EVENT_WRITE_ZPASS

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
This commit is contained in:
Marek Olšák 2023-01-24 06:10:12 -05:00 committed by Marge Bot
parent 4664b22f65
commit 711c4bddb2
2 changed files with 22 additions and 10 deletions

View file

@ -250,6 +250,8 @@
#define PKT3_WAIT_ON_CE_COUNTER 0x86
#define PKT3_SET_SH_REG_INDEX 0x9B
#define PKT3_LOAD_CONTEXT_REG_INDEX 0x9F /* new for VI */
#define PKT3_EVENT_WRITE_ZPASS 0xB1 /* GFX11+ & PFP version >= 1458 */
#define EVENT_WRITE_ZPASS_PFP_VERSION 1458
#define PKT3_DISPATCH_TASK_STATE_INIT 0xA9 /* Tells the HW about the task control buffer */
#define PKT3_DISPATCH_MESH_INDIRECT_MULTI 0x4C /* Indirect mesh shader only dispatch [GFX only] */

View file

@ -813,11 +813,16 @@ static void si_query_hw_do_emit_start(struct si_context *sctx, struct si_query_h
case PIPE_QUERY_OCCLUSION_PREDICATE:
case PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE: {
radeon_begin(cs);
radeon_emit(PKT3(PKT3_EVENT_WRITE, 2, 0));
if (sctx->gfx_level >= GFX11)
radeon_emit(EVENT_TYPE(V_028A90_PIXEL_PIPE_STAT_DUMP) | EVENT_INDEX(1));
else
radeon_emit(EVENT_TYPE(V_028A90_ZPASS_DONE) | EVENT_INDEX(1));
if (sctx->gfx_level >= GFX11 &&
sctx->screen->info.pfp_fw_version >= EVENT_WRITE_ZPASS_PFP_VERSION) {
radeon_emit(PKT3(PKT3_EVENT_WRITE_ZPASS, 1, 0));
} else {
radeon_emit(PKT3(PKT3_EVENT_WRITE, 2, 0));
if (sctx->gfx_level >= GFX11)
radeon_emit(EVENT_TYPE(V_028A90_PIXEL_PIPE_STAT_DUMP) | EVENT_INDEX(1));
else
radeon_emit(EVENT_TYPE(V_028A90_ZPASS_DONE) | EVENT_INDEX(1));
}
radeon_emit(va);
radeon_emit(va >> 32);
radeon_end();
@ -924,11 +929,16 @@ static void si_query_hw_do_emit_stop(struct si_context *sctx, struct si_query_hw
case PIPE_QUERY_OCCLUSION_PREDICATE_CONSERVATIVE: {
va += 8;
radeon_begin(cs);
radeon_emit(PKT3(PKT3_EVENT_WRITE, 2, 0));
if (sctx->gfx_level >= GFX11)
radeon_emit(EVENT_TYPE(V_028A90_PIXEL_PIPE_STAT_DUMP) | EVENT_INDEX(1));
else
radeon_emit(EVENT_TYPE(V_028A90_ZPASS_DONE) | EVENT_INDEX(1));
if (sctx->gfx_level >= GFX11 &&
sctx->screen->info.pfp_fw_version >= EVENT_WRITE_ZPASS_PFP_VERSION) {
radeon_emit(PKT3(PKT3_EVENT_WRITE_ZPASS, 1, 0));
} else {
radeon_emit(PKT3(PKT3_EVENT_WRITE, 2, 0));
if (sctx->gfx_level >= GFX11)
radeon_emit(EVENT_TYPE(V_028A90_PIXEL_PIPE_STAT_DUMP) | EVENT_INDEX(1));
else
radeon_emit(EVENT_TYPE(V_028A90_ZPASS_DONE) | EVENT_INDEX(1));
}
radeon_emit(va);
radeon_emit(va >> 32);
radeon_end();