@@ -118,6 +118,19 @@ bool gem_scheduler_has_semaphores(int fd)
I915_SCHEDULER_CAP_SEMAPHORES;
}
+/**
+ * gem_scheduler_has_engine_busy_stats:
+ * @fd: open i915 drm file descriptor
+ *
+ * Feature test macro to query whether the driver supports reporting accurate
+ * per-engine utilisation.
+ */
+bool gem_scheduler_has_engine_busy_stats(int fd)
+{
+ return gem_scheduler_capability(fd) &
+ I915_SCHEDULER_CAP_ENGINE_BUSY_STATS;
+}
+
/**
* gem_scheduler_print_capability:
* @fd: open i915 drm file descriptor
@@ -138,4 +151,6 @@ void gem_scheduler_print_capability(int fd)
igt_info(" - With preemption enabled\n");
if (caps & I915_SCHEDULER_CAP_SEMAPHORES)
igt_info(" - With HW semaphores enabled\n");
+ if (caps & I915_SCHEDULER_CAP_ENGINE_BUSY_STATS)
+ igt_info(" - With engine busy statistics\n");
}
@@ -31,6 +31,7 @@ bool gem_scheduler_enabled(int fd);
bool gem_scheduler_has_ctx_priority(int fd);
bool gem_scheduler_has_preemption(int fd);
bool gem_scheduler_has_semaphores(int fd);
+bool gem_scheduler_has_engine_busy_stats(int fd);
void gem_scheduler_print_capability(int fd);
#endif /* GEM_SCHEDULER_H */
Hook the new capability bit alongside the existing scheduler reporting. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> --- lib/i915/gem_scheduler.c | 15 +++++++++++++++ lib/i915/gem_scheduler.h | 1 + 2 files changed, 16 insertions(+)