diff options
author | Imre Deak <imre.deak@intel.com> | 2020-06-30 19:03:44 +0300 |
---|---|---|
committer | Imre Deak <imre.deak@intel.com> | 2020-07-06 17:03:54 +0300 |
commit | d31a5ba83d7f548c86d0e5486f1f44a5563020d6 (patch) | |
tree | 9471469d62eb2c46703fcca2bda319941b70c8b8 /tests | |
parent | 5c79c34b3d0e53a8e95d1d0453c2406730bae5b3 (diff) |
tests/kms_flip: Check for link reset during expired seq vblank wait
The expired vblank seq subtests can fail when using certain monitors with a
behavior described in
commit 60e8be7ccc72086a88d2eff3bcd02495fad5fa46
Author: Imre Deak <imre.deak@intel.com>
Date: Mon May 11 22:08:53 2020 +0300
tests/kms_flip: Retry test in case of a DP/HDMI link reset
As in the above commit, retry the test once if a hotplug was detected during
the test.
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/kms_flip.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/tests/kms_flip.c b/tests/kms_flip.c index 7f0d85b2..2b64b4f3 100755 --- a/tests/kms_flip.c +++ b/tests/kms_flip.c @@ -658,8 +658,12 @@ static int set_mode(struct test_output *o, uint32_t fb, int x, int y) return 0; } -/* Return mask of completed events. */ -static unsigned int run_test_step(struct test_output *o) +/* + * Return true if the test steps were run successfully, false in case of a + * failure that requires rerunning the test steps. On success events will + * contain the mask of completed events. + */ +static bool run_test_step(struct test_output *o, unsigned int *events) { unsigned int new_fb_id; /* for funny reasons page_flip returns -EBUSY on disabled crtcs ... */ @@ -709,7 +713,11 @@ static unsigned int run_test_step(struct test_output *o) end = gettime_us(); igt_debug("Vblank took %luus\n", end - start); igt_assert(end - start < 500); - igt_assert_eq(reply.sequence, exp_seq); + if (reply.sequence != exp_seq) { + igt_debug("unexpected vblank seq %u, should be %u\n", + reply.sequence, exp_seq); + return false; + } igt_assert(timercmp(&reply.ts, &o->flip_state.last_ts, ==)); } @@ -839,7 +847,9 @@ static unsigned int run_test_step(struct test_output *o) unhang_gpu(drm_fd, hang); - return completed_events; + *events = completed_events; + + return true; } static void update_state(struct event_state *es) @@ -1079,7 +1089,9 @@ static bool event_loop(struct test_output *o, unsigned duration_ms, while (1) { unsigned int completed_events; - completed_events = run_test_step(o); + if (!run_test_step(o, &completed_events)) + return false; + if (o->pending_events) completed_events |= wait_for_events(o); |