Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t 2/2] tests/kms_flip: Check for link reset during expired seq vblank wait
Date: Tue, 30 Jun 2020 19:03:44 +0300	[thread overview]
Message-ID: <20200630160344.15886-2-imre.deak@intel.com> (raw)
In-Reply-To: <20200630160344.15886-1-imre.deak@intel.com>

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>
---
 tests/kms_flip.c | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 86c5e871..3d60eb58 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);
 
-- 
2.20.1

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2020-06-30 16:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-30 16:03 [igt-dev] [PATCH i-g-t 1/2] tests/kms_flip: Check for link reset during TS calibration as well Imre Deak
2020-06-30 16:03 ` Imre Deak [this message]
2020-06-30 16:40 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/2] " Patchwork
2020-06-30 22:30 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2020-07-01 11:25   ` Imre Deak
2020-07-01 21:42 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork
2020-07-06 14:07   ` Imre Deak
2020-07-02 20:17 ` [igt-dev] [PATCH i-g-t 1/2] " Shankar, Uma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200630160344.15886-2-imre.deak@intel.com \
    --to=imre.deak@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox