Hello, Here is a proposal to expose VC4 HW perf counters to userspace. This is done through 3 new ioctls which are allowing one to create, destroy and query the status of a perf monitor object. A perfmon object does not count things by its own, it has to be attached to a SUBMIT_CL request to be activated. After the request, the perfmon object stays around and can be attached to another request if needed. Everytime the perfmon is attached to a SUBMIT_CL request, its values are incremented by the HW perf counter values, so that the counters can count things across GPU jobs. If you want to reset the values of a perfmon, just destroy it and create a new one. Note that the first patch is not directly related to perfmon itself, but will allow us to easily extend what is passed to a SUBMIT_CL request without having to add new ioctls. Regards, Boris --- Boris Brezillon (2): drm/vc4: Add a mechanism to easily extend CL submissions drm/vc4: Expose performance counters to userspace drivers/gpu/drm/vc4/Makefile | 1 + drivers/gpu/drm/vc4/vc4_drv.c | 27 ++++++ drivers/gpu/drm/vc4/vc4_drv.h | 45 +++++++++ drivers/gpu/drm/vc4/vc4_gem.c | 89 ++++++++++++++++- drivers/gpu/drm/vc4/vc4_irq.c | 13 ++- drivers/gpu/drm/vc4/vc4_perfmon.c | 195 ++++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/vc4/vc4_regs.h | 35 +------ drivers/gpu/drm/vc4/vc4_v3d.c | 64 ++++++------- include/uapi/drm/vc4_drm.h | 156 ++++++++++++++++++++++++++++-- 9 files changed, 545 insertions(+), 80 deletions(-) create mode 100644 drivers/gpu/drm/vc4/vc4_perfmon.c -- 2.11.0 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel