From 0cfd3ee746f9b809e5d58f307cc24996facaa5ac Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 20 Feb 2018 14:28:17 +0000 Subject: igt/kms_frontbuffer_tracking: Wait for PSR to be disabled PSR may not exit instantaneously, so while asserting that PSR is disabled after an action, we may have to wait a short while. Currently that wait is waiting for PSR to enabled and expecting to timeout; this fails when we start the assertion with PSR already enabled. Fix the wait to wait until PSR is disabled rather than timeout. Signed-off-by: Chris Wilson Reviewed-by: Daniel Vetter --- tests/kms_frontbuffer_tracking.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'tests/kms_frontbuffer_tracking.c') diff --git a/tests/kms_frontbuffer_tracking.c b/tests/kms_frontbuffer_tracking.c index 6c4071de..57ae047b 100644 --- a/tests/kms_frontbuffer_tracking.c +++ b/tests/kms_frontbuffer_tracking.c @@ -1002,6 +1002,11 @@ static bool psr_wait_until_enabled(void) return igt_wait(psr_is_enabled(), 5000, 1); } +static bool psr_wait_until_disabled(void) +{ + return igt_wait(!psr_is_enabled(), 5000, 1); +} + static bool drrs_wait_until_rr_switch_to_low(void) { return igt_wait(is_drrs_low(), 5000, 1); @@ -1845,10 +1850,13 @@ static void do_status_assertions(int flags) if (flags & ASSERT_PSR_ENABLED) { if (!psr_wait_until_enabled()) { psr_print_status(); - igt_assert_f(psr_is_enabled(), "PSR disabled\n"); + igt_assert_f(psr_is_enabled(), "PSR still disabled\n"); } } else if (flags & ASSERT_PSR_DISABLED) { - igt_assert(!psr_wait_until_enabled()); + if (!psr_wait_until_disabled()) { + psr_print_status(); + igt_assert_f(!psr_is_enabled(), "PSR still enabled\n"); + } } } -- cgit v1.2.3