diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2018-02-21 14:13:16 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-02-23 16:42:36 +0000 |
commit | 305ebcedc36e98f3118ac27a5bbde0ce7cd71a74 (patch) | |
tree | 3e392be546ac6e667b13ad6b494d724ab4822707 /lib/igt_gt.h | |
parent | f9b6fd624be9692e9a892c0976fa72cedefc9fed (diff) |
Iterate over physical engines
We current have a single for_each_engine() iterator which we use to
generate both a set of uABI engines and a set of physical engines.
Determining what uABI ring-id corresponds to an actual HW engine is
tricky, so pull that out to a library function and introduce
for_each_physical_engine() for cases where we want to issue requests
once on each HW ring (avoiding aliasing issues).
v2: Remember can_store_dword for gem_sync
v3: Find more open-coded for_each_physical
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Diffstat (limited to 'lib/igt_gt.h')
-rw-r--r-- | lib/igt_gt.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/igt_gt.h b/lib/igt_gt.h index 68592410..4d9d1aa0 100644 --- a/lib/igt_gt.h +++ b/lib/igt_gt.h @@ -81,6 +81,15 @@ extern const struct intel_execution_engine { e__++) \ for_if (gem_has_ring(fd__, flags__ = e__->exec_id | e__->flags)) +#define for_each_physical_engine(fd__, flags__) \ + for (const struct intel_execution_engine *e__ = intel_execution_engines;\ + e__->name; \ + e__++) \ + for_if (gem_ring_has_physical_engine(fd__, flags__ = e__->exec_id | e__->flags)) + +bool gem_ring_is_physical_engine(int fd, unsigned int ring); +bool gem_ring_has_physical_engine(int fd, unsigned int ring); + bool gem_can_store_dword(int fd, unsigned int engine); extern const struct intel_execution_engine2 { |