public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH i-g-t 4/7] kms_vblank: Make the -hang tests work as intended
Date: Thu,  4 Jan 2018 14:15:06 +0100	[thread overview]
Message-ID: <20180104131509.10198-5-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20180104131509.10198-1-maarten.lankhorst@linux.intel.com>

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 tests/kms_vblank.c | 31 ++++++++++++++++++++++---------
 1 file changed, 22 insertions(+), 9 deletions(-)

diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c
index a83500635976..45301ca5110f 100644
--- a/tests/kms_vblank.c
+++ b/tests/kms_vblank.c
@@ -54,7 +54,7 @@ typedef struct {
 #define IDLE 1
 #define BUSY 2
 #define FORKED 4
-#define HANG 8
+#define NOHANG 8
 } data_t;
 
 static double elapsed(const struct timespec *start,
@@ -128,7 +128,7 @@ static void run_test(data_t *data, int fd, void (*testfunc)(data_t *, int, int))
 		 igt_subtest_name(), kmstest_pipe_name(data->pipe),
 		 igt_output_name(output), nchildren);
 
-	if (data->flags & HANG)
+	if (!(data->flags & NOHANG))
 		hang = igt_hang_ring(display->drm_fd, I915_EXEC_DEFAULT);
 
 	if (data->flags & BUSY) {
@@ -153,7 +153,7 @@ static void run_test(data_t *data, int fd, void (*testfunc)(data_t *, int, int))
 
 	igt_assert(poll(&(struct pollfd){fd, POLLIN}, 1, 0) == 0);
 
-	if (data->flags & HANG)
+	if (!(data->flags & NOHANG))
 		igt_post_hang_ring(fd, hang);
 
 	igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
@@ -324,9 +324,9 @@ igt_main
 		void (*func)(data_t *, int, int);
 		unsigned int valid;
 	} funcs[] = {
-		{ "accuracy", accuracy, IDLE | HANG },
-		{ "query", vblank_query, IDLE | FORKED | BUSY | HANG },
-		{ "wait", vblank_wait, IDLE | FORKED | BUSY | HANG },
+		{ "accuracy", accuracy, IDLE },
+		{ "query", vblank_query, IDLE | FORKED | BUSY },
+		{ "wait", vblank_wait, IDLE | FORKED | BUSY },
 		{ }
 	}, *f;
 	enum pipe p;
@@ -365,15 +365,28 @@ igt_main
 				if (m->flags & ~f->valid)
 					continue;
 
-				igt_subtest_f("pipe-%s-%s-%s%s",
+				igt_subtest_f("pipe-%s-%s-%s",
 					      kmstest_pipe_name(data.pipe),
-					      f->name, m->name,
-					      m->flags & HANG ? "-hang" : "") {
+					      f->name, m->name) {
+					for_each_valid_output_on_pipe(&data.display, data.pipe, data.output) {
+						data.flags = m->flags | NOHANG;
+						run_test(&data, fd, f->func);
+					}
+				}
+
+				/* Skip the -hang version if NOHANG flag is set */
+				if (f->valid & NOHANG)
+					continue;
+
+				igt_subtest_f("pipe-%s-%s-%s-hang",
+					      kmstest_pipe_name(data.pipe),
+					      f->name, m->name) {
 					for_each_valid_output_on_pipe(&data.display, data.pipe, data.output) {
 						data.flags = m->flags;
 						run_test(&data, fd, f->func);
 					}
 				}
+
 			}
 		}
 	}
-- 
2.15.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2018-01-04 13:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-04 13:15 [PATCH i-g-t 0/7] kms_vblank: Move tests over from kms_flip Maarten Lankhorst
2018-01-04 13:15 ` [PATCH i-g-t 1/7] tests/kms_flip: Remove blt/rcs flip tests Maarten Lankhorst
2018-01-04 13:15 ` [PATCH i-g-t 2/7] tests/kms_flip: Move kms_flip.vblank-vs-hang to kms_vblank Maarten Lankhorst
2018-01-04 13:15 ` [PATCH i-g-t 3/7] kms_vblank: Reorganize subtests by pipe Maarten Lankhorst
2018-01-04 13:15 ` Maarten Lankhorst [this message]
2018-01-04 13:15 ` [PATCH i-g-t 5/7] kms_vblank: Add tests implemented in kms_flip Maarten Lankhorst
2018-01-04 13:15 ` [PATCH i-g-t 6/7] kms_flip: Remove redundant vblank tests Maarten Lankhorst
2018-01-04 13:15 ` [PATCH i-g-t 7/7] kms_vblank: Remove teardown code from cleanup_crtc Maarten Lankhorst
2018-01-04 13:36 ` ✗ Fi.CI.BAT: failure for kms_vblank: Move tests over from kms_flip Patchwork

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=20180104131509.10198-5-maarten.lankhorst@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=intel-gfx@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