panfrost: Remove the perf counters interface
authorBoris Brezillon <boris.brezillon@collabora.com>
Wed, 19 Jun 2019 14:05:01 +0000 (16:05 +0200)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 21 Jun 2019 20:01:12 +0000 (13:01 -0700)
The DRM backend has a dummy implementation and the non-DRM backend is
gone, so let's remove this perf counter interface.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/gallium/drivers/panfrost/pan_context.c
src/gallium/drivers/panfrost/pan_drm.c
src/gallium/drivers/panfrost/pan_screen.c
src/gallium/drivers/panfrost/pan_screen.h

index a803a8b68cb5fd38d27f73331ce2179b02be873b..24e180e31c930f24c2be7c92aa911e60fafdf29c 100644 (file)
@@ -47,9 +47,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
 
@@ -1384,17 +1381,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
 }
 
index 3914fdc09cc3c181ed8ebb555555ceb84648f47d..b2db8df1aa7a172351e502abe077e9da81d2db12 100644 (file)
@@ -323,18 +323,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)
 {
@@ -425,12 +413,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;
 }
index 5d3acc0a0dd552a50ae376cab5a1507a104e2722..8d43e0d9f4caca70d45428c6fa8f5db86a052920 100644 (file)
@@ -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();
 
index 0660be5128c729f844a0285da361372abd85aaa4..c7504f3221d4887230eb2aeb45fea75d0e7084a6 100644 (file)
@@ -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;