From 383df5998711abb29149bfd04b26f8917c90926a Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sat, 2 Oct 2021 11:55:10 -0700 Subject: [PATCH] freedreno: Get shader variant msgs in perf debug output We want FD_MESA_DEBUG=perf to also tell us about variants. Signed-off-by: Rob Clark Part-of: --- src/gallium/drivers/freedreno/freedreno_util.h | 12 +++++++++--- src/gallium/drivers/freedreno/ir3/ir3_gallium.c | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/freedreno/freedreno_util.h b/src/gallium/drivers/freedreno/freedreno_util.h index c989262cc74..5e0065717e4 100644 --- a/src/gallium/drivers/freedreno/freedreno_util.h +++ b/src/gallium/drivers/freedreno/freedreno_util.h @@ -114,13 +114,19 @@ extern bool fd_binning_enabled; ##__VA_ARGS__); \ } while (0) -#define perf_debug_ctx(ctx, ...) \ +#define perf_debug_message(debug, type, ...) \ do { \ if (FD_DBG(PERF)) \ mesa_logw(__VA_ARGS__); \ + struct pipe_debug_callback *__d = (debug); \ + if (__d) \ + pipe_debug_message(__d, type, __VA_ARGS__); \ + } while (0) + +#define perf_debug_ctx(ctx, ...) \ + do { \ struct fd_context *__c = (ctx); \ - if (__c) \ - pipe_debug_message(&__c->debug, PERF_INFO, __VA_ARGS__); \ + perf_debug_message(__c ? &__c->debug : NULL, PERF_INFO, __VA_ARGS__); \ } while (0) #define perf_debug(...) perf_debug_ctx(NULL, __VA_ARGS__) diff --git a/src/gallium/drivers/freedreno/ir3/ir3_gallium.c b/src/gallium/drivers/freedreno/ir3/ir3_gallium.c index 947bef3a505..701fc474fbf 100644 --- a/src/gallium/drivers/freedreno/ir3/ir3_gallium.c +++ b/src/gallium/drivers/freedreno/ir3/ir3_gallium.c @@ -133,7 +133,7 @@ ir3_shader_variant(struct ir3_shader *shader, struct ir3_shader_key key, if (created) { if (shader->initial_variants_done) { - pipe_debug_message(debug, SHADER_INFO, + perf_debug_message(debug, SHADER_INFO, "%s shader: recompiling at draw time: global " "0x%08x, vfsamples %x/%x, astc %x/%x\n", ir3_shader_stage(v), key.global, key.vsamples,