From 13d0d2db1a2c562ba38c6fe1a97cd01ff66aa045 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Wed, 24 Feb 2021 12:36:56 -0800 Subject: [PATCH] freedreno: Slight perf_debug rework Allow ctx to be NULL in perf_debug_ctx() and make perf_debug() a shortcut for perf_debug_ctx(NULL, ...) to simplify things slightly in the next patch. Signed-off-by: Rob Clark Part-of: --- src/gallium/drivers/freedreno/freedreno_util.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gallium/drivers/freedreno/freedreno_util.h b/src/gallium/drivers/freedreno/freedreno_util.h index 2871cebac8c..c56d6ee41f4 100644 --- a/src/gallium/drivers/freedreno/freedreno_util.h +++ b/src/gallium/drivers/freedreno/freedreno_util.h @@ -104,15 +104,15 @@ extern bool fd_binning_enabled; __FUNCTION__, __LINE__, ##__VA_ARGS__); } while (0) #define perf_debug_ctx(ctx, ...) do { \ - perf_debug(__VA_ARGS__); \ - pipe_debug_message(&(ctx)->debug, PERF_INFO, __VA_ARGS__); \ - } while(0) - -#define perf_debug(...) do { \ if (FD_DBG(PERF)) \ mesa_logw(__VA_ARGS__); \ + struct fd_context *__c = (ctx); \ + if (__c) \ + pipe_debug_message(&__c->debug, PERF_INFO, __VA_ARGS__); \ } while(0) +#define perf_debug(...) perf_debug_ctx(NULL, __VA_ARGS__) + struct fd_context; /**