From 5e7519121de3c0e97ec27d33d6164278e86e75c5 Mon Sep 17 00:00:00 2001 From: Mika Kuoppala Date: Tue, 23 Apr 2019 17:15:58 +0300 Subject: lib/igt_dummyload: Introduce igt_spin_reset Libify resetting a spin for reuse. v2: use also in perf_pmu v3: s/cmd_spin/cmd_precondition v4: remove early return for !spin (Chris) Cc: Chris Wilson Cc: Tvrtko Ursulin Signed-off-by: Mika Kuoppala Reviewed-by: Chris Wilson --- tests/perf_pmu.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'tests/perf_pmu.c') diff --git a/tests/perf_pmu.c b/tests/perf_pmu.c index a8ad86ce..e719a292 100644 --- a/tests/perf_pmu.c +++ b/tests/perf_pmu.c @@ -1501,14 +1501,6 @@ test_enable_race(int gem_fd, const struct intel_execution_engine2 *e) gem_quiescent_gpu(gem_fd); } -static void __rearm_spin(igt_spin_t *spin) -{ - const uint32_t mi_arb_chk = 0x5 << 23; - - *spin->batch = mi_arb_chk; - __sync_synchronize(); -} - #define __assert_within(x, ref, tol_up, tol_down) \ igt_assert_f((double)(x) <= ((double)(ref) + (tol_up)) && \ (double)(x) >= ((double)(ref) - (tol_down)), \ @@ -1596,7 +1588,7 @@ accuracy(int gem_fd, const struct intel_execution_engine2 *e, nanosleep(&_ts, NULL); /* Restart the spinbatch. */ - __rearm_spin(spin); + igt_spin_reset(spin); __submit_spin(gem_fd, spin, e, 0); /* PWM busy sleep. */ -- cgit v1.2.3