From d3cec95b5ef68728e3b993b3560288cf1a2c14a0 Mon Sep 17 00:00:00 2001 From: Tvrtko Ursulin Date: Thu, 29 Mar 2018 10:11:28 +0100 Subject: 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 Reported-by: Michel Thierry Cc: Michel Thierry Reviewed-by: Chris Wilson Reviewed-by: Michel Thierry --- lib/igt_gt.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'lib/igt_gt.h') 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 */ -- cgit v1.2.3