summaryrefslogtreecommitdiff
path: root/benchmarks
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 /benchmarks
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 'benchmarks')
-rw-r--r--benchmarks/gem_syslatency.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/benchmarks/gem_syslatency.c b/benchmarks/gem_syslatency.c
index d7cf0ed4..40230630 100644
--- a/benchmarks/gem_syslatency.c
+++ b/benchmarks/gem_syslatency.c
@@ -79,17 +79,6 @@ static void force_low_latency(void)
#define ENGINE_FLAGS (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK)
-static bool ignore_engine(int fd, unsigned engine)
-{
- if (engine == 0)
- return true;
-
- if (gem_has_bsd2(fd) && engine == I915_EXEC_BSD)
- return true;
-
- return false;
-}
-
static void *gem_busyspin(void *arg)
{
const uint32_t bbe = MI_BATCH_BUFFER_END;
@@ -100,14 +89,13 @@ static void *gem_busyspin(void *arg)
bs->sz ? bs->sz + sizeof(bbe) : bs->leak ? 16 << 20 : 4 << 10;
unsigned engines[16];
unsigned nengine;
- unsigned engine;
int fd;
fd = drm_open_driver(DRIVER_INTEL);
nengine = 0;
- for_each_engine(fd, engine)
- if (!ignore_engine(fd, engine)) engines[nengine++] = engine;
+ for_each_physical_engine(e, fd)
+ engines[nengine++] = eb_ring(e);
memset(obj, 0, sizeof(obj));
obj[0].handle = gem_create(fd, 4096);