diff options
author | Tvrtko Ursulin <tvrtko.ursulin@intel.com> | 2018-03-29 10:11:28 +0100 |
---|---|---|
committer | Tvrtko Ursulin <tvrtko.ursulin@intel.com> | 2018-03-29 17:03:14 +0100 |
commit | d3cec95b5ef68728e3b993b3560288cf1a2c14a0 (patch) | |
tree | 4cb3126c1e23b0201d20e7e2c018b78090a49253 /lib | |
parent | 2cbd4ddf11b3eaf01f33d8bc2ad46411ec6c299a (diff) |
tests/perf_pmu: Fix usage of for_each_engine_class_instance
Wrong file descriptor was passed to the iterator. This had currently no
effect, since it wasn't used in the macro, but needs to be fixed.
At the same time make the macro consistent by checking for engine presence
like the other iterators do.
Added __for_each_engine_class_instance which does not check for engine
presence and so is useful for enumerating all possible engines - like for
instance for subtest enumeration.
And another 'wrong fd used' fixlet in the render node subtests.
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reported-by: Michel Thierry <michel.thierry@intel.com>
Cc: Michel Thierry <michel.thierry@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Michel Thierry <michel.thierry@intel.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/igt_gt.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/igt_gt.h b/lib/igt_gt.h index a517ed7b..d44b7552 100644 --- a/lib/igt_gt.h +++ b/lib/igt_gt.h @@ -100,11 +100,6 @@ extern const struct intel_execution_engine2 { int instance; } intel_execution_engines2[]; -#define for_each_engine_class_instance(fd__, e__) \ - for ((e__) = intel_execution_engines2;\ - (e__)->name; \ - (e__)++) - unsigned int gem_class_instance_to_eb_flags(int gem_fd, enum drm_i915_gem_engine_class class, @@ -122,4 +117,11 @@ void gem_require_engine(int gem_fd, igt_require(gem_has_engine(gem_fd, class, instance)); } +#define __for_each_engine_class_instance(fd__, e__) \ + for ((e__) = intel_execution_engines2; (e__)->name; (e__)++) + +#define for_each_engine_class_instance(fd__, e__) \ + for ((e__) = intel_execution_engines2; (e__)->name; (e__)++) \ + for_if (gem_has_engine((fd__), (e__)->class, (e__)->instance)) + #endif /* IGT_GT_H */ |