summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gallium/drivers/panfrost/pan_context.c14
-rw-r--r--src/gallium/drivers/panfrost/pan_screen.h1
2 files changed, 10 insertions, 5 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 48b2314679b..508f55200af 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -1571,11 +1571,15 @@ panfrost_submit_frame(struct panfrost_context *ctx, bool flush_immediate)
screen->driver->force_flush_fragment(ctx);
#ifdef DUMP_PERFORMANCE_COUNTERS
- char filename[128];
- snprintf(filename, sizeof(filename), "/dev/shm/frame%d.mdgprf", ++performance_counter_number);
- FILE *fp = fopen(filename, "wb");
- fwrite(screen->perf_counters.cpu, 4096, sizeof(uint32_t), fp);
- fclose(fp);
+ if (screen->driver->dump_counters) {
+ screen->driver->dump_counters(screen);
+
+ char filename[128];
+ snprintf(filename, sizeof(filename), "/dev/shm/frame%d.mdgprf", ++performance_counter_number);
+ FILE *fp = fopen(filename, "wb");
+ fwrite(screen->perf_counters.cpu, 4096, sizeof(uint32_t), fp);
+ fclose(fp);
+ }
#endif
#endif
diff --git a/src/gallium/drivers/panfrost/pan_screen.h b/src/gallium/drivers/panfrost/pan_screen.h
index a2b4b2a77f7..e976b78b5a2 100644
--- a/src/gallium/drivers/panfrost/pan_screen.h
+++ b/src/gallium/drivers/panfrost/pan_screen.h
@@ -66,6 +66,7 @@ struct panfrost_driver {
void (*free_imported_bo) (struct panfrost_screen *screen,
struct panfrost_bo *bo);
void (*enable_counters) (struct panfrost_screen *screen);
+ void (*dump_counters) (struct panfrost_screen *screen);
};
struct panfrost_screen {