diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-01-29 09:53:29 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-02-12 23:11:31 +0000 |
commit | 368237db1149033d8274248489ffec671ea1f7d8 (patch) | |
tree | ed735f1b0a17d0de7e3aa54fe79010f501819e16 | |
parent | 4de1c1e1669fc25cbcafbd5b149c2894e3f430fd (diff) |
i915/gem_exec_latency: Eliminate the wakeup penalty
The first dispatch incurs the cost of waking up the device, so also
measure after issuing a spinner to keep the device awake as we submit.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
-rw-r--r-- | tests/i915/gem_exec_latency.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/i915/gem_exec_latency.c b/tests/i915/gem_exec_latency.c index 931af75e..6dd191ec 100644 --- a/tests/i915/gem_exec_latency.c +++ b/tests/i915/gem_exec_latency.c @@ -55,8 +55,9 @@ #define ENGINE_FLAGS (I915_EXEC_RING_MASK | LOCAL_I915_EXEC_BSD_MASK) -#define CORK 0x1 -#define PREEMPT 0x2 +#define LIVE 0x1 +#define CORK 0x2 +#define PREEMPT 0x4 static unsigned int ring_size; static double rcs_clock; @@ -120,6 +121,7 @@ static void latency_on_ring(int fd, struct drm_i915_gem_exec_object2 obj[3]; struct drm_i915_gem_relocation_entry reloc; struct drm_i915_gem_execbuffer2 execbuf; + igt_spin_t *spin = NULL; IGT_CORK_HANDLE(c); volatile uint32_t *reg; unsigned repeats = ring_size; @@ -189,6 +191,9 @@ static void latency_on_ring(int fd, execbuf.buffer_count = 3; } + if (flags & LIVE) + spin = igt_spin_batch_new(fd, .engine = ring); + start = *reg; for (j = 0; j < repeats; j++) { uint64_t presumed_offset = reloc.presumed_offset; @@ -204,6 +209,7 @@ static void latency_on_ring(int fd, end = *reg; igt_assert(reloc.presumed_offset == obj[1].offset); + igt_spin_batch_free(fd, spin); if (flags & CORK) igt_cork_unplug(&c); @@ -704,6 +710,11 @@ igt_main e->exec_id | e->flags, e->name, 0); + igt_subtest_f("%s-live-dispatch", e->name) + latency_on_ring(device, + e->exec_id | e->flags, + e->name, LIVE); + igt_subtest_f("%s-poll", e->name) poll_ring(device, e->exec_id | e->flags, @@ -723,6 +734,10 @@ igt_main e->name, 0); + igt_subtest_f("%s-live-dispatch-queued", e->name) + latency_on_ring(device, + e->exec_id | e->flags, + e->name, LIVE | CORK); igt_subtest_f("%s-dispatch-queued", e->name) latency_on_ring(device, e->exec_id | e->flags, |