From 6cb2f07e90720d63d6b2062753718905c26fab69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 20 Aug 2021 12:50:31 -0400 Subject: [PATCH] radeonsi: add si_print_current_ib function for debugging Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/drivers/radeonsi/si_debug.c | 6 ++++++ src/gallium/drivers/radeonsi/si_pipe.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/gallium/drivers/radeonsi/si_debug.c b/src/gallium/drivers/radeonsi/si_debug.c index bcc8baa9335..f79f49b54dd 100644 --- a/src/gallium/drivers/radeonsi/si_debug.c +++ b/src/gallium/drivers/radeonsi/si_debug.c @@ -390,6 +390,12 @@ static void si_parse_current_ib(FILE *f, struct radeon_cmdbuf *cs, unsigned begi fprintf(f, "------------------- %s end (dw = %u) -------------------\n\n", name, orig_end); } +void si_print_current_ib(struct si_context *sctx, FILE *f) +{ + si_parse_current_ib(f, &sctx->gfx_cs, 0, sctx->gfx_cs.prev_dw + sctx->gfx_cs.current.cdw, + NULL, 0, "GFX", sctx->chip_class); +} + static void si_log_chunk_type_cs_print(void *data, FILE *f) { struct si_log_chunk_cs *chunk = data; diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index a40666ed3e8..d786859b4d4 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -1457,6 +1457,7 @@ void si_init_debug_functions(struct si_context *sctx); void si_check_vm_faults(struct si_context *sctx, struct radeon_saved_cs *saved, enum ring_type ring); bool si_replace_shader(unsigned num, struct si_shader_binary *binary); +void si_print_current_ib(struct si_context *sctx, FILE *f); /* si_fence.c */ void si_cp_release_mem(struct si_context *ctx, struct radeon_cmdbuf *cs, unsigned event,