drm/v3d: Expose the total GPU usage stats on sysfs
authorMaíra Canal <mcanal@igalia.com>
Tue, 5 Sep 2023 21:06:35 +0000 (18:06 -0300)
committerMaíra Canal <mcanal@igalia.com>
Mon, 6 Nov 2023 13:09:29 +0000 (10:09 -0300)
commit509433d8146c64ca9e0bcc370ec910821fffe80c
tree9a3e6880c111b48d78a87255198a1ff68e6700fc
parent09a93cc4f7d1893777f6b788bffe60d64e4d5df7
drm/v3d: Expose the total GPU usage stats on sysfs

The previous patch exposed the accumulated amount of active time per
client for each V3D queue. But this doesn't provide a global notion of
the GPU usage.

Therefore, provide the accumulated amount of active time for each V3D
queue (BIN, RENDER, CSD, TFU and CACHE_CLEAN), considering all the jobs
submitted to the queue, independent of the client.

This data is exposed through the sysfs interface, so that if the
interface is queried at two different points of time the usage percentage
of each of the queues can be calculated.

Co-developed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Signed-off-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Acked-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Melissa Wen <mwen@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230905213416.1290219-3-mcanal@igalia.com
drivers/gpu/drm/v3d/Makefile
drivers/gpu/drm/v3d/v3d_drv.c
drivers/gpu/drm/v3d/v3d_drv.h
drivers/gpu/drm/v3d/v3d_gem.c
drivers/gpu/drm/v3d/v3d_irq.c
drivers/gpu/drm/v3d/v3d_sched.c
drivers/gpu/drm/v3d/v3d_sysfs.c [new file with mode: 0644]