drm/v3d: Create two functions to update all GPU stats variables
authorMaíra Canal <mcanal@igalia.com>
Sat, 20 Apr 2024 21:32:09 +0000 (18:32 -0300)
committerMaíra Canal <mcanal@igalia.com>
Tue, 23 Apr 2024 22:32:45 +0000 (19:32 -0300)
commit52ce97765cc71708acfd2a66b71e6cd3abb096d8
tree28862b1d51881b20466b838fbaf5502eb6205135
parenta6325ad47bc808aeb4c69ae36e0236c2c6d400b5
drm/v3d: Create two functions to update all GPU stats variables

Currently, we manually perform all operations to update the GPU stats
variables. Apart from the code repetition, this is very prone to errors,
as we can see on commit 35f4f8c9fc97 ("drm/v3d: Don't increment
`enabled_ns` twice").

Therefore, create two functions to manage updating all GPU stats
variables. Now, the jobs only need to call for `v3d_job_update_stats()`
when the job is done and `v3d_job_start_stats()` when starting the job.

Co-developed-by: Tvrtko Ursulin <tursulin@igalia.com>
Signed-off-by: Tvrtko Ursulin <tursulin@igalia.com>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240420213632.339941-3-mcanal@igalia.com
drivers/gpu/drm/v3d/v3d_drv.h
drivers/gpu/drm/v3d/v3d_irq.c
drivers/gpu/drm/v3d/v3d_sched.c