diff mbox series

drm/i915/selftests: Assert that the idle_pulse is sent

Message ID 20191031094212.22896-1-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show
Series drm/i915/selftests: Assert that the idle_pulse is sent | expand

Commit Message

Chris Wilson Oct. 31, 2019, 9:42 a.m. UTC
When checking the heartbeat pulse, we expect it to have been sent by the
time we have slept. We can verify this by checking the engine serial
number to see if that matches the predicted pulse serial. It will always
be true if, and only if, the pulse was sent by itself (as designed by
the test).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c b/drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c
index 9e7376b592e5..c1dbacfcdb90 100644
--- a/drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c
+++ b/drivers/gpu/drm/i915/gt/selftest_engine_heartbeat.c
@@ -97,6 +97,8 @@  static int __live_idle_pulse(struct intel_engine_cs *engine,
 		goto out;
 	}
 
+	GEM_BUG_ON(engine->wakeref_serial != engine->serial);
+
 	pulse_unlock_wait(p); /* synchronize with the retirement callback */
 
 	if (!i915_active_is_idle(&p->active)) {