[igt-dev] [RFC v2 15/43] tests/i915/gem_ctx_thrash: use the gem_engine_topology library

Ramalingam C ramalingam.c at intel.com
Fri Jun 21 10:03:17 UTC 2019


Replace the legacy for_each_engine* defines with the ones
implemented in the gem_engine_topology library.

Signed-off-by: Ramalingam C <ramalingam.c at intel.com>
---
 tests/i915/gem_ctx_thrash.c | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/tests/i915/gem_ctx_thrash.c b/tests/i915/gem_ctx_thrash.c
index b25f95f137a8..d9201c3dd327 100644
--- a/tests/i915/gem_ctx_thrash.c
+++ b/tests/i915/gem_ctx_thrash.c
@@ -103,13 +103,13 @@ static void single(const char *name, bool all_engines)
 
 	num_engines = 0;
 	if (all_engines) {
-		unsigned engine;
+		const struct intel_execution_engine2 *e;
 
-		for_each_physical_engine(fd, engine) {
-			if (!gem_can_store_dword(fd, engine))
+		__for_each_physical_engine(fd, e) {
+			if (!gem_class_can_store_dword(fd, e->class))
 				continue;
 
-			engines[num_engines++] = engine;
+			engines[num_engines++] = e->flags;
 			if (num_engines == ARRAY_SIZE(engines))
 				break;
 		}
@@ -220,7 +220,8 @@ static void single(const char *name, bool all_engines)
 
 static void processes(void)
 {
-	unsigned engines[16], engine;
+	const struct intel_execution_engine2 *e;
+	unsigned engines[16];
 	int num_engines;
 	struct rlimit rlim;
 	unsigned num_ctx;
@@ -230,8 +231,8 @@ static void processes(void)
 	fd = drm_open_driver(DRIVER_INTEL);
 
 	num_engines = 0;
-	for_each_physical_engine(fd, engine) {
-		engines[num_engines++] = engine;
+	__for_each_physical_engine(fd, e) {
+		engines[num_engines++] = e->flags;
 		if (num_engines == ARRAY_SIZE(engines))
 			break;
 	}
-- 
2.19.1



More information about the igt-dev mailing list