summaryrefslogtreecommitdiff
path: root/tests/i915/gem_userptr_blits.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_userptr_blits.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_userptr_blits.c')
-rw-r--r--tests/i915/gem_userptr_blits.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/i915/gem_userptr_blits.c b/tests/i915/gem_userptr_blits.c
index 18e806fe..11d6f4a1 100644
--- a/tests/i915/gem_userptr_blits.c
+++ b/tests/i915/gem_userptr_blits.c
@@ -1165,18 +1165,17 @@ static void test_readonly(int i915)
igt_assert(mprotect(space, total, PROT_READ) == 0);
igt_fork(child, 1) {
- unsigned int engine;
char *orig;
orig = g_compute_checksum_for_data(G_CHECKSUM_SHA1, pages, sz);
gem_userptr(i915, space, total, true, userptr_flags, &rhandle);
- for_each_engine(i915, engine) {
+ for_each_engine(e, i915) {
char *ref, *result;
/* First tweak the backing store through the write */
- store_dword_rand(i915, engine, whandle, sz, 1024);
+ store_dword_rand(i915, eb_ring(e), whandle, sz, 1024);
gem_sync(i915, whandle);
ref = g_compute_checksum_for_data(G_CHECKSUM_SHA1,
pages, sz);
@@ -1185,7 +1184,7 @@ static void test_readonly(int i915)
igt_assert(strcmp(ref, orig));
/* Now try the same through the read-only handle */
- store_dword_rand(i915, engine, rhandle, total, 1024);
+ store_dword_rand(i915, eb_ring(e), rhandle, total, 1024);
gem_sync(i915, rhandle);
result = g_compute_checksum_for_data(G_CHECKSUM_SHA1,
pages, sz);