diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c index 4b1fabc1809..a1201baa477 100644 --- a/src/gallium/drivers/panfrost/pan_screen.c +++ b/src/gallium/drivers/panfrost/pan_screen.c @@ -57,6 +57,7 @@ #include "panfrost-quirks.h" static const struct debug_named_value panfrost_debug_options[] = { + {"perf", PAN_DBG_PERF, "Enable performance warnings"}, {"trace", PAN_DBG_TRACE, "Trace the command stream"}, {"deqp", PAN_DBG_DEQP, "Hacks for dEQP"}, {"dirty", PAN_DBG_DIRTY, "Always re-emit all state"}, diff --git a/src/gallium/drivers/panfrost/pan_screen.h b/src/gallium/drivers/panfrost/pan_screen.h index e5261016092..33acb983d9a 100644 --- a/src/gallium/drivers/panfrost/pan_screen.h +++ b/src/gallium/drivers/panfrost/pan_screen.h @@ -36,6 +36,7 @@ #include "util/u_dynarray.h" #include "util/bitset.h" #include "util/set.h" +#include "util/log.h" #include "pan_device.h" #include "pan_mempool.h" @@ -103,4 +104,13 @@ panfrost_fence_create(struct panfrost_context *ctx); void panfrost_cmdstream_screen_init(struct panfrost_screen *screen); +#define perf_debug(dev, ...) \ + do { \ + if (unlikely((dev)->debug & PAN_DBG_PERF)) \ + mesa_logw(__VA_ARGS__); \ + } while(0) + +#define perf_debug_ctx(ctx, ...) \ + perf_debug(pan_device((ctx)->base.screen), __VA_ARGS__); + #endif /* PAN_SCREEN_H */ diff --git a/src/panfrost/lib/pan_util.h b/src/panfrost/lib/pan_util.h index 290d2951c24..64129846074 100644 --- a/src/panfrost/lib/pan_util.h +++ b/src/panfrost/lib/pan_util.h @@ -28,7 +28,7 @@ #ifndef PAN_UTIL_H #define PAN_UTIL_H -/* 0x0001 unused */ +#define PAN_DBG_PERF 0x0001 #define PAN_DBG_TRACE 0x0002 #define PAN_DBG_DEQP 0x0004 #define PAN_DBG_DIRTY 0x0008