summaryrefslogtreecommitdiff
path: root/tests/i915/gem_exec_suspend.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-10-25 15:19:44 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2019-10-26 19:03:25 +0100
commit6fbb9508c3ce339d36fafa1b8bcdb9ce66905953 (patch)
tree2c812ab9e806baccd4fd7700a26c0e49c7731fd8 /tests/i915/gem_exec_suspend.c
parent69d00d9daf9645cd6cd6751e78a4111646bf1284 (diff)
lib/i915: Use explicit iterator names in for_each_engine()
Provide the iterator name as an explicit macro parameter so that it is known to the caller, and allows for them to properly nest loops over all engines. Fixes: ../tests/i915/gem_exec_schedule.c: In function ‘semaphore_noskip’: ../lib/igt_gt.h:84:44: warning: declaration of ‘e__’ shadows a previous local [-Wshadow] for (const struct intel_execution_engine *e__ = intel_execution_engines;\ ^~~ ../tests/i915/gem_exec_schedule.c:653:2: note: in expansion of macro ‘for_each_physical_engine’ for_each_physical_engine(i915, other) { ^~~~~~~~~~~~~~~~~~~~~~~~ ../lib/igt_gt.h:84:44: note: shadowed declaration is here for (const struct intel_execution_engine *e__ = intel_execution_engines;\ ^~~ ../tests/i915/gem_exec_schedule.c:652:2: note: in expansion of macro ‘for_each_physical_engine’ for_each_physical_engine(i915, engine) { ^~~~~~~~~~~~~~~~~~~~~~~~ ../tests/i915/gem_exec_schedule.c: In function ‘measure_semaphore_power’: ../lib/igt_gt.h:84:44: warning: declaration of ‘e__’ shadows a previous local [-Wshadow] for (const struct intel_execution_engine *e__ = intel_execution_engines;\ ^~~ ../tests/i915/gem_exec_schedule.c:1740:3: note: in expansion of macro ‘for_each_physical_engine’ for_each_physical_engine(i915, engine) { ^~~~~~~~~~~~~~~~~~~~~~~~ ../lib/igt_gt.h:84:44: note: shadowed declaration is here for (const struct intel_execution_engine *e__ = intel_execution_engines;\ ^~~ ../tests/i915/gem_exec_schedule.c:1719:2: note: in expansion of macro ‘for_each_physical_engine’ for_each_physical_engine(i915, signaler) { ^~~~~~~~~~~~~~~~~~~~~~~~ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Andi Shyti <andi.shyti@intel.com>
Diffstat (limited to 'tests/i915/gem_exec_suspend.c')
-rw-r--r--tests/i915/gem_exec_suspend.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/tests/i915/gem_exec_suspend.c b/tests/i915/gem_exec_suspend.c
index f25f1a86..af6190dd 100644
--- a/tests/i915/gem_exec_suspend.c
+++ b/tests/i915/gem_exec_suspend.c
@@ -65,11 +65,9 @@ static void check_bo(int fd, uint32_t handle)
static void test_all(int fd, unsigned flags)
{
- unsigned engine;
-
- for_each_physical_engine(fd, engine)
- if (gem_can_store_dword(fd, engine))
- run_test(fd, engine, flags & ~0xff);
+ for_each_physical_engine(e, fd)
+ if (gem_can_store_dword(fd, eb_ring(e)))
+ run_test(fd, eb_ring(e), flags & ~0xff);
}
static bool has_semaphores(int fd)
@@ -107,9 +105,9 @@ static void run_test(int fd, unsigned engine, unsigned flags)
* GPU is then unlikely to be active!)
*/
if (has_semaphores(fd)) {
- for_each_physical_engine(fd, engine) {
- if (gem_can_store_dword(fd, engine))
- engines[nengine++] = engine;
+ for_each_physical_engine(e, fd) {
+ if (gem_can_store_dword(fd, eb_ring(e)))
+ engines[nengine++] = eb_ring(e);
}
} else {
igt_require(gem_has_ring(fd, 0));
@@ -275,11 +273,9 @@ igt_main
for (e = intel_execution_engines; e->name; e++) {
for (m = modes; m->suffix; m++) {
igt_subtest_f("%s-uncached%s", e->name, m->suffix)
- run_test(fd, e->exec_id | e->flags,
- m->mode | UNCACHED);
+ run_test(fd, eb_ring(e), m->mode | UNCACHED);
igt_subtest_f("%s-cached%s", e->name, m->suffix)
- run_test(fd, e->exec_id | e->flags,
- m->mode | CACHED);
+ run_test(fd, eb_ring(e), m->mode | CACHED);
}
}