diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-02-03 12:46:44 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-03-16 08:30:10 +0000 |
commit | 71ad19eb8fe4f0eecae3bf063e107293b90b9abc (patch) | |
tree | afa70de4ceaff0b535d9435e9e04d842f62108da /lib | |
parent | 520b6f7fbb6cb7dc99d689cc6c073fae1ccc8e7f (diff) |
lib/i915: Pretty print HW semaphores
Include whether the scheduler is using HW semaphore assistance in our
pretty debug strings, and make the caps known for requires.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/i915/gem_scheduler.c | 32 | ||||
-rw-r--r-- | lib/i915/gem_scheduler.h | 5 |
2 files changed, 26 insertions, 11 deletions
diff --git a/lib/i915/gem_scheduler.c b/lib/i915/gem_scheduler.c index ad156306..1ea91038 100644 --- a/lib/i915/gem_scheduler.c +++ b/lib/i915/gem_scheduler.c @@ -67,7 +67,7 @@ unsigned gem_scheduler_capability(int fd) } /** - * gem_has_scheduler: + * gem_scheduler_enabled: * @fd: open i915 drm file descriptor * * Feature test macro to query whether the driver has scheduling capability. @@ -75,11 +75,11 @@ unsigned gem_scheduler_capability(int fd) bool gem_scheduler_enabled(int fd) { return gem_scheduler_capability(fd) & - LOCAL_I915_SCHEDULER_CAP_ENABLED; + I915_SCHEDULER_CAP_ENABLED; } /** - * gem_has_ctx_priority: + * gem_scheduler_has_ctx_priority: * @fd: open i915 drm file descriptor * * Feature test macro to query whether the driver supports assigning custom @@ -88,11 +88,11 @@ bool gem_scheduler_enabled(int fd) bool gem_scheduler_has_ctx_priority(int fd) { return gem_scheduler_capability(fd) & - LOCAL_I915_SCHEDULER_CAP_PRIORITY; + I915_SCHEDULER_CAP_PRIORITY; } /** - * gem_has_preemption: + * gem_scheduler_has_preemption: * @fd: open i915 drm file descriptor * * Feature test macro to query whether the driver supports preempting active @@ -101,7 +101,21 @@ bool gem_scheduler_has_ctx_priority(int fd) bool gem_scheduler_has_preemption(int fd) { return gem_scheduler_capability(fd) & - LOCAL_I915_SCHEDULER_CAP_PREEMPTION; + I915_SCHEDULER_CAP_PREEMPTION; +} + +/** + * gem_scheduler_has_semaphores: + * @fd: open i915 drm file descriptor + * + * Feature test macro to query whether the driver supports using HW semaphores + * to schedule dependencies in parallel (using the HW to delay execution until + * ready to reduce latency). + */ +bool gem_scheduler_has_semaphores(int fd) +{ + return gem_scheduler_capability(fd) & + I915_SCHEDULER_CAP_SEMAPHORES; } /** @@ -118,8 +132,10 @@ void gem_scheduler_print_capability(int fd) return; igt_info("Has kernel scheduler\n"); - if (caps & LOCAL_I915_SCHEDULER_CAP_PRIORITY) + if (caps & I915_SCHEDULER_CAP_PRIORITY) igt_info(" - With priority sorting\n"); - if (caps & LOCAL_I915_SCHEDULER_CAP_PREEMPTION) + if (caps & I915_SCHEDULER_CAP_PREEMPTION) igt_info(" - With preemption enabled\n"); + if (caps & I915_SCHEDULER_CAP_SEMAPHORES) + igt_info(" - With HW semaphores enabled\n"); } diff --git a/lib/i915/gem_scheduler.h b/lib/i915/gem_scheduler.h index 9fcb0266..f9049d12 100644 --- a/lib/i915/gem_scheduler.h +++ b/lib/i915/gem_scheduler.h @@ -24,14 +24,13 @@ #ifndef GEM_SCHEDULER_H #define GEM_SCHEDULER_H -#define LOCAL_I915_SCHEDULER_CAP_ENABLED (1 << 0) -#define LOCAL_I915_SCHEDULER_CAP_PRIORITY (1 << 1) -#define LOCAL_I915_SCHEDULER_CAP_PREEMPTION (1 << 2) +#include <stdbool.h> unsigned gem_scheduler_capability(int fd); 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); void gem_scheduler_print_capability(int fd); #endif /* GEM_SCHEDULER_H */ |