summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/panfrost/pan_screen.c
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-02-25 03:31:29 +0000
committerAlyssa Rosenzweig <[email protected]>2019-02-27 03:56:38 +0000
commit4c82abb9b603af1d799d8e3864ff7c7e846fa6ee (patch)
tree17b552094a260971cd0c93857148163f9e2b30ff /src/gallium/drivers/panfrost/pan_screen.c
parent60270c83b5e759e4b5edbe5270fe26d52a3967d0 (diff)
panfrost: Expose perf counters in environment
Previously, we were guarded by an #ifdef, which is generally a bad form. This patch instead guards them behind an environmental variable. Signed-off-by: Alyssa Rosenzweig <[email protected]>
Diffstat (limited to 'src/gallium/drivers/panfrost/pan_screen.c')
-rw-r--r--src/gallium/drivers/panfrost/pan_screen.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c
index f61758d1bb9..b8a119fd343 100644
--- a/src/gallium/drivers/panfrost/pan_screen.c
+++ b/src/gallium/drivers/panfrost/pan_screen.c
@@ -53,6 +53,8 @@
struct panfrost_driver *panfrost_create_drm_driver(int fd);
struct panfrost_driver *panfrost_create_nondrm_driver(int fd);
+const char *pan_counters_base = NULL;
+
static const char *
panfrost_get_name(struct pipe_screen *screen)
{
@@ -551,17 +553,18 @@ panfrost_create_screen(int fd, struct renderonly *ro, bool is_drm)
#endif
}
- /* Enable pantrace iff asked for in the environment */
+ /* Dump memory and/or performance counters iff asked for in the environment */
const char *pantrace_base = getenv("PANTRACE_BASE");
+ pan_counters_base = getenv("PANCOUNTERS_BASE");
if (pantrace_base) {
pantrace_initialize(pantrace_base);
}
-#ifdef DUMP_PERFORMANCE_COUNTERS
- screen->driver->allocate_slab(screen, &screen->perf_counters, 64, true, 0, 0, 0);
- screen->driver->enable_counters(screen);
-#endif
+ if (pan_counters_base) {
+ screen->driver->allocate_slab(screen, &screen->perf_counters, 64, true, 0, 0, 0);
+ screen->driver->enable_counters(screen);
+ }
screen->base.destroy = panfrost_destroy_screen;