diff mbox

[i-g-t,2/2] igt/perf_pmu: Fast slow then meander

Message ID 20180620115706.4087-2-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson June 20, 2018, 11:57 a.m. UTC
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 tests/perf_pmu.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c
index 4570f926d..a2e20b8fc 100644
--- a/tests/perf_pmu.c
+++ b/tests/perf_pmu.c
@@ -206,11 +206,15 @@  static unsigned long __spin_wait(int fd, igt_spin_t *spin)
 
 static igt_spin_t * __spin_sync(int fd, uint32_t ctx, unsigned long flags)
 {
-	igt_spin_t *spin = __spin_poll(fd, ctx, flags);
+	igt_spin_t *spin[2];
+
+	spin[0] = __spin_poll(fd, ctx, flags);
+	spin[1] = __igt_spin_batch_new(fd, ctx, flags, 0);
 
-	__spin_wait(fd, spin);
+	__spin_wait(fd, spin[0]);
+	igt_spin_batch_free(fd, spin[0]);
 
-	return spin;
+	return spin[1];
 }
 
 static igt_spin_t * spin_sync(int fd, uint32_t ctx, unsigned long flags)