Report how much of the NPU each client uses through fdinfo. Patch 1
exports the runtime the scheduler already accounts per entity, and patch
2 uses it for rocket's drm-engine-npu key.
v6: Rename the getter to drm_sched_entity_get_runtime_ns() (Maíra
Canal). Report rdev->num_cores, the cores that are bound, as the
capacity instead of rdev->max_cores, and skip the key once no core
is left as a capacity of zero is not allowed (Maíra Canal). Add
tags.
v5: Use the entity runtime from the new drm_sched_entity_get_runtime()
instead of a counter in rocket (Tvrtko Ursulin). Reviewed-by tags
are not carried as the accounting changed. Based on drm-misc-next.
v4: Single drm-engine-npu key with drm-engine-capacity-npu, and
documentation (Tomeu Vizoso).
v3: Add a rocket_engine_usage_create() helper (Gyeyoung Baek).
v2: Size the per-core counters by rdev->max_cores.
Link to v5:
https://lore.kernel.org/all/[email protected]/
Link to v4:
https://lore.kernel.org/all/[email protected]/
Link to v3:
https://lore.kernel.org/all/[email protected]/
Link to v2:
https://lore.kernel.org/all/[email protected]/
Link to v1:
https://lore.kernel.org/all/[email protected]/
Sidong Yang (2):
drm/sched: Add drm_sched_entity_get_runtime_ns()
accel/rocket: Report NPU usage through fdinfo
Documentation/accel/rocket/index.rst | 29 ++++++++++++++++++++++++
Documentation/gpu/drm-usage-stats.rst | 1 +
drivers/accel/rocket/rocket_drv.c | 25 +++++++++++++++++++-
drivers/gpu/drm/scheduler/sched_entity.c | 25 ++++++++++++++++++++
include/drm/gpu_scheduler.h | 1 +
5 files changed, 80 insertions(+), 1 deletion(-)
base-commit: c408466a4dfaee4b12587e926c5b85e68c8b3c40
--
2.53.0