#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
/* 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
}
}
}
-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)
{
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;
}
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)
{
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();
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,
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;