panfrost: Add perf_debug macros

Lifted from freedreno.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11830>
This commit is contained in:
Alyssa Rosenzweig 2021-07-12 13:55:30 -04:00 committed by Marge Bot
parent fae28b0fce
commit 256f4a5b02
3 changed files with 12 additions and 1 deletions

View File

@ -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"},

View File

@ -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 */

View File

@ -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