Hello, This is an attempt at exposing Mali Midgard/Bifrost perf counters in a more or less generic way so that they can be used through the pipe_query interface. That should allow one to dump/display those counters using gallium-hud or any tool/lib that uses the GL_AMD_performance_monitor API (apitrace) to query HW counters.
This series adds new hooks to the panfrost_driver driver interface so that both the drm and non-drm drivers can be plugged (I only developped the glue for the DRM driver so far, but can work on the non-DRM driver if needed). Only T860 counters are exposed so far, as this is the platform I tested on. It's been tested with gallium-hud in invisible mode (the driver doesn't support RECT texture, which is needed to display the HUD): List all available counters: # GALLIUM_HUD_VISIBLE=false GALLIUM_HUD=help <app> Dump counters in a directory: # GALLIUM_HUD_VISIBLE=false GALLIUM_HUD_DUMP_DIR=<dump-dir> GALLIUM_HUD=<counter1>,<counter2>,... <app> Should also work with apitrace, but I haven't tested yet. Regards, Boris Boris Brezillon (4): drm-uapi: panfrost: Add perfcnt related bits panfrost: Expose perfcounters through the pipe_query interface panfrost: Implement perfcnt hooks in the DRM driver panfrost: Add T860 counters include/drm-uapi/panfrost_drm.h | 122 +++++++ src/gallium/drivers/panfrost/meson.build | 3 +- src/gallium/drivers/panfrost/pan_context.c | 80 ++++- src/gallium/drivers/panfrost/pan_context.h | 9 +- src/gallium/drivers/panfrost/pan_drm.c | 245 +++++++++++++ src/gallium/drivers/panfrost/pan_perfcnt.c | 389 +++++++++++++++++++++ src/gallium/drivers/panfrost/pan_perfcnt.h | 36 ++ src/gallium/drivers/panfrost/pan_screen.c | 9 +- src/gallium/drivers/panfrost/pan_screen.h | 41 +++ 9 files changed, 926 insertions(+), 8 deletions(-) create mode 100644 src/gallium/drivers/panfrost/pan_perfcnt.c create mode 100644 src/gallium/drivers/panfrost/pan_perfcnt.h -- 2.20.1 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev