]> git.dujemihanovic.xyz Git - linux.git/commit
drm/v3d: Implement show_fdinfo() callback for GPU usage stats
authorMaíra Canal <mcanal@igalia.com>
Tue, 5 Sep 2023 21:06:34 +0000 (18:06 -0300)
committerMaíra Canal <mcanal@igalia.com>
Mon, 6 Nov 2023 13:09:23 +0000 (10:09 -0300)
commit09a93cc4f7d1893777f6b788bffe60d64e4d5df7
treeda3b555b3007c5c2d05b87a161c502b6729c3ed9
parent5faf6e1853d30d113ebc9977e015d0152e5e1970
drm/v3d: Implement show_fdinfo() callback for GPU usage stats

This patch exposes the accumulated amount of active time per client
through the fdinfo infrastructure. The amount of active time is exposed
for each V3D queue: BIN, RENDER, CSD, TFU and CACHE_CLEAN.

In order to calculate the amount of active time per client, a CPU clock
is used through the function local_clock(). The point where the jobs has
started is marked and is finally compared with the time that the job had
finished.

Moreover, the number of jobs submitted to each queue is also exposed on
fdinfo through the identifier "v3d-jobs-<queue>".

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/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