[Mesa-dev] [PATCH 1/2] panfrost: Kill the perf counters interface

Boris Brezillon boris.brezillon at collabora.com
Fri Jun 21 13:57:26 UTC 2019


The DRM driver has a dummy implementation and the non-drm backend is
gone, so let's kill this perf counter interface.

Signed-off-by: Boris Brezillon <boris.brezillon at collabora.com>
---
 src/gallium/drivers/panfrost/pan_context.c | 14 --------------
 src/gallium/drivers/panfrost/pan_drm.c     | 14 --------------
 src/gallium/drivers/panfrost/pan_screen.c  | 10 ----------
 src/gallium/drivers/panfrost/pan_screen.h  |  4 ----
 4 files changed, 42 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index e4a04dd821f5..867b49c55967 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -48,9 +48,6 @@
 #include "pan_util.h"
 #include "pan_tiler.h"
 
-static int performance_counter_number = 0;
-extern const char *pan_counters_base;
-
 /* Do not actually send anything to the GPU; merely generate the cmdstream as fast as possible. Disables framebuffer writes */
 //#define DRY_RUN
 
@@ -1442,17 +1439,6 @@ panfrost_submit_frame(struct panfrost_context *ctx, bool flush_immediate,
         /* If readback, flush now (hurts the pipelined performance) */
         if (flush_immediate)
                 screen->driver->force_flush_fragment(ctx, fence);
-
-        if (screen->driver->dump_counters && pan_counters_base) {
-                screen->driver->dump_counters(screen);
-
-                char filename[128];
-                snprintf(filename, sizeof(filename), "%s/frame%d.mdgprf", pan_counters_base, ++performance_counter_number);
-                FILE *fp = fopen(filename, "wb");
-                fwrite(screen->perf_counters.cpu,  4096, sizeof(uint32_t), fp);
-                fclose(fp);
-        }
-
 #endif
 }
 
diff --git a/src/gallium/drivers/panfrost/pan_drm.c b/src/gallium/drivers/panfrost/pan_drm.c
index aed50477ff7d..f4d0721071bb 100644
--- a/src/gallium/drivers/panfrost/pan_drm.c
+++ b/src/gallium/drivers/panfrost/pan_drm.c
@@ -318,18 +318,6 @@ panfrost_drm_force_flush_fragment(struct panfrost_context *ctx,
         }
 }
 
-static void
-panfrost_drm_enable_counters(struct panfrost_screen *screen)
-{
-	fprintf(stderr, "unimplemented: %s\n", __func__);
-}
-
-static void
-panfrost_drm_dump_counters(struct panfrost_screen *screen)
-{
-	fprintf(stderr, "unimplemented: %s\n", __func__);
-}
-
 static unsigned
 panfrost_drm_query_gpu_version(struct panfrost_screen *screen)
 {
@@ -420,12 +408,10 @@ panfrost_create_drm_driver(int fd)
 	driver->base.force_flush_fragment = panfrost_drm_force_flush_fragment;
 	driver->base.allocate_slab = panfrost_drm_allocate_slab;
 	driver->base.free_slab = panfrost_drm_free_slab;
-	driver->base.enable_counters = panfrost_drm_enable_counters;
 	driver->base.query_gpu_version = panfrost_drm_query_gpu_version;
 	driver->base.init_context = panfrost_drm_init_context;
 	driver->base.fence_reference = panfrost_drm_fence_reference;
 	driver->base.fence_finish = panfrost_drm_fence_finish;
-	driver->base.dump_counters = panfrost_drm_dump_counters;
 
         return &driver->base;
 }
diff --git a/src/gallium/drivers/panfrost/pan_screen.c b/src/gallium/drivers/panfrost/pan_screen.c
index 5d3acc0a0dd5..8d43e0d9f4ca 100644
--- a/src/gallium/drivers/panfrost/pan_screen.c
+++ b/src/gallium/drivers/panfrost/pan_screen.c
@@ -66,8 +66,6 @@ int pan_debug = 0;
 
 struct panfrost_driver *panfrost_create_drm_driver(int fd);
 
-const char *pan_counters_base = NULL;
-
 static const char *
 panfrost_get_name(struct pipe_screen *screen)
 {
@@ -585,14 +583,6 @@ panfrost_create_screen(int fd, struct renderonly *ro)
 
         screen->driver = panfrost_create_drm_driver(fd);
 
-        /* Dump performance counters iff asked for in the environment */
-        pan_counters_base = getenv("PANCOUNTERS_BASE");
-
-        if (pan_counters_base) {
-                screen->driver->allocate_slab(screen, &screen->perf_counters, 64, true, 0, 0, 0);
-                screen->driver->enable_counters(screen);
-        }
-
         if (pan_debug & PAN_DBG_TRACE)
                 pandecode_initialize();
 
diff --git a/src/gallium/drivers/panfrost/pan_screen.h b/src/gallium/drivers/panfrost/pan_screen.h
index 0660be5128c7..c7504f3221d4 100644
--- a/src/gallium/drivers/panfrost/pan_screen.h
+++ b/src/gallium/drivers/panfrost/pan_screen.h
@@ -64,8 +64,6 @@ struct panfrost_driver {
                            struct panfrost_memory *mem);
         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);
 	unsigned (*query_gpu_version) (struct panfrost_screen *screen);
 	int (*init_context) (struct panfrost_context *ctx);
 	void (*fence_reference) (struct pipe_screen *screen,
@@ -83,8 +81,6 @@ struct panfrost_screen {
         struct renderonly *ro;
         struct panfrost_driver *driver;
 
-        struct panfrost_memory perf_counters;
-
         /* Memory management is based on subdividing slabs with AMD's allocator */
         struct pb_slabs slabs;
         
-- 
2.20.1



More information about the mesa-dev mailing list