diff options
author | Alyssa Rosenzweig <[email protected]> | 2019-02-18 23:32:05 +0000 |
---|---|---|
committer | Alyssa Rosenzweig <[email protected]> | 2019-02-25 02:34:16 +0000 |
commit | 4a4726af3c86f1249f3761b982a2555623f315b9 (patch) | |
tree | b84928614c5d870059d314daa2021fe09ad83fc7 | |
parent | cdca103d434f8085b9c1046b6df33e9cc5c55531 (diff) |
panfrost/nondrm: Split out dump_counters
Previously, this function was implied a part of the job submit.
Signed-off-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r-- | src/gallium/drivers/panfrost/pan_context.c | 14 | ||||
-rw-r--r-- | src/gallium/drivers/panfrost/pan_screen.h | 1 |
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 { |