diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2020-12-30 11:02:42 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2020-12-30 14:24:40 +0000 |
commit | 1384f8df232ae5232bf2db2de8cbd6f69b25236b (patch) | |
tree | c7878fe5ffd6bebb5cfe9ce7e288a353a4f7675a /lib/i915/gem_ring.h | |
parent | 3714a967f69f7c7d6ec32e7b09f64ceb0a11bec1 (diff) |
i915: Rename legacy for_each_engine to for_each_ring
Improve the differentiation between the legacy ring selector ABI and the
more recent engine selection API.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Andi Shyti <andi.shyti@intel.com>
Diffstat (limited to 'lib/i915/gem_ring.h')
-rw-r--r-- | lib/i915/gem_ring.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/i915/gem_ring.h b/lib/i915/gem_ring.h index c69adce0..d2a0c2f4 100644 --- a/lib/i915/gem_ring.h +++ b/lib/i915/gem_ring.h @@ -26,6 +26,30 @@ #include <stdbool.h> +extern const struct intel_execution_ring { + const char *name; + const char *full_name; + unsigned exec_id; + unsigned flags; +} intel_execution_rings[]; + +#define eb_ring(e) ((e)->exec_id | (e)->flags) + +#define for_each_ring(it__, fd__) \ + for (const struct intel_execution_ring *it__ = intel_execution_rings;\ + it__->name; \ + it__++) \ + for_if (gem_has_ring(fd__, eb_ring(it__))) + +#define for_each_physical_ring(it__, fd__) \ + for (const struct intel_execution_ring *it__ = intel_execution_rings;\ + it__->name; \ + it__++) \ + for_if (gem_ring_has_physical_engine(fd__, eb_ring(it__))) + +bool gem_ring_is_physical_engine(int fd, unsigned int ring); +bool gem_ring_has_physical_engine(int fd, unsigned int ring); + enum measure_ring_flags { MEASURE_RING_NEW_CTX = 1 }; |