From df622729ddbf6607c10670e52d2cb484b1abe7c7 Mon Sep 17 00:00:00 2001 From: Lucas Stach Date: Wed, 1 Feb 2023 16:26:07 +0100 Subject: drm/scheduler: track GPU active time per entity Track the accumulated time that jobs from this entity were active on the GPU. This allows drivers using the scheduler to trivially implement the DRM fdinfo when the hardware doesn't provide more specific information than signalling job completion anyways. [Bagas: Append missing colon to @elapsed_ns] Signed-off-by: Bagas Sanjaya Signed-off-by: Lucas Stach Reviewed-by: Andrey Grodzovsky --- include/drm/gpu_scheduler.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include/drm/gpu_scheduler.h') diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h index ca857ec9e7eb..aa771e01f63f 100644 --- a/include/drm/gpu_scheduler.h +++ b/include/drm/gpu_scheduler.h @@ -228,6 +228,13 @@ struct drm_sched_entity { */ struct rb_node rb_tree_node; + /** + * @elapsed_ns: + * + * Records the amount of time where jobs from this entity were active + * on the GPU. + */ + uint64_t elapsed_ns; }; /** -- cgit