diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2018-02-20 14:28:17 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-02-21 08:05:04 +0000 |
commit | 0cfd3ee746f9b809e5d58f307cc24996facaa5ac (patch) | |
tree | 2ae7cef6d35f8ff014346e413d6c3bf06da03f8d /tests/kms_frontbuffer_tracking.c | |
parent | 4340b479e7769eb619249600328b916fb16949da (diff) |
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 <chris@chris-wilson.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/kms_frontbuffer_tracking.c')
-rw-r--r-- | tests/kms_frontbuffer_tracking.c | 12 |
1 files changed, 10 insertions, 2 deletions
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"); + } } } |