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 v3 i-g-t] tests/kms_flip: Move kms_flip.vblank-vs-hang to kms_vblank, v3.
Date: Mon,  8 Jan 2018 11:23:14 +0100	[thread overview]
Message-ID: <20180108102314.76238-1-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20180104141243.15098-4-maarten.lankhorst@linux.intel.com>

There's no need to test this more than once. Add a NOHANG
flag which can be used to specify that a subtest can not
be run when hanging. If it's set on either the subtest or
the mode, the -hang test for this combination will not be
generated.

Changes since v1:
- Merge the patch that renamed HANG to NOHANG.
- Rebase after 'reorganize subtests by type'.
- Allow subtests to specify NOHANG too.
Changes since v2:
- Mark accuracy test with NOHANG, gpu reset disables interrupts,
  causing the test to fail.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
---
 tests/kms_flip.c   | 10 +---------
 tests/kms_vblank.c | 25 +++++++++++++++++++++++--
 2 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 7689e65b521a..50c16b0debbf 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -72,7 +72,7 @@
 #define TEST_SUSPEND		(1 << 26)
 #define TEST_TS_CONT		(1 << 27)
 #define TEST_BO_TOOBIG		(1 << 28)
-#define TEST_HANG_ONCE		(1 << 29)
+
 #define TEST_BASIC		(1 << 30)
 
 #define EVENT_FLIP		(1 << 0)
@@ -1071,13 +1071,8 @@ static unsigned int wait_for_events(struct test_output *o)
 static unsigned event_loop(struct test_output *o, unsigned duration_ms)
 {
 	unsigned long start, end;
-	igt_hang_t hang;
 	int count = 0;
 
-	memset(&hang, 0, sizeof(hang));
-	if (o->flags & TEST_HANG_ONCE)
-		hang = hang_gpu(drm_fd);
-
 	start = gettime_us();
 
 	while (1) {
@@ -1097,8 +1092,6 @@ static unsigned event_loop(struct test_output *o, unsigned duration_ms)
 
 	end = gettime_us();
 
-	unhang_gpu(drm_fd, hang);
-
 	/* Flush any remaining events */
 	if (o->pending_events)
 		wait_for_events(o);
@@ -1565,7 +1558,6 @@ int main(int argc, char **argv)
 			TEST_CHECK_TS, "flip-vs-blocking-wf-vblank" },
 		{ 30, TEST_FLIP | TEST_MODESET | TEST_HANG | TEST_NOEVENT, "flip-vs-modeset-vs-hang" },
 		{ 30, TEST_FLIP | TEST_PAN | TEST_HANG, "flip-vs-panning-vs-hang" },
-		{ 30, TEST_VBLANK | TEST_HANG_ONCE, "vblank-vs-hang" },
 		{ 1, TEST_FLIP | TEST_EINVAL | TEST_FB_BAD_TILING, "flip-vs-bad-tiling" },
 
 		{ 1, TEST_DPMS_OFF | TEST_MODESET | TEST_FLIP,
diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c
index e51e96c7f061..c56b82033b75 100644
--- a/tests/kms_vblank.c
+++ b/tests/kms_vblank.c
@@ -54,6 +54,7 @@ typedef struct {
 #define IDLE 1
 #define BUSY 2
 #define FORKED 4
+#define NOHANG 8
 } data_t;
 
 static double elapsed(const struct timespec *start,
@@ -119,6 +120,7 @@ static void run_test(data_t *data, int fd, void (*testfunc)(data_t *, int, int))
 		data->flags & FORKED ? sysconf(_SC_NPROCESSORS_ONLN) : 1;
 	igt_display_t *display = &data->display;
 	igt_output_t *output = data->output;
+	igt_hang_t hang;
 
 	prepare_crtc(data, fd, output);
 
@@ -126,6 +128,9 @@ 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 & NOHANG))
+		hang = igt_hang_ring(display->drm_fd, I915_EXEC_DEFAULT);
+
 	if (data->flags & BUSY) {
 		union drm_wait_vblank vbl;
 
@@ -148,6 +153,9 @@ 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 & NOHANG))
+		igt_post_hang_ring(fd, hang);
+
 	igt_info("\n%s on pipe %s, connector %s: PASSED\n\n",
 		 igt_subtest_name(), kmstest_pipe_name(data->pipe), igt_output_name(output));
 
@@ -316,7 +324,7 @@ igt_main
 		void (*func)(data_t *, int, int);
 		unsigned int valid;
 	} funcs[] = {
-		{ "accuracy", accuracy, IDLE },
+		{ "accuracy", accuracy, IDLE | NOHANG },
 		{ "query", vblank_query, IDLE | FORKED | BUSY },
 		{ "wait", vblank_wait, IDLE | FORKED | BUSY },
 		{ }
@@ -354,12 +362,25 @@ igt_main
 
 		for (f = funcs; f->name; f++) {
 			for (m = modes; m->name; m++) {
-				if (m->flags & ~f->valid)
+				if (m->flags & ~(f->valid | NOHANG))
 					continue;
 
 				igt_subtest_f("pipe-%s-%s-%s",
 					      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 | NOHANG;
+						run_test(&data, fd, f->func);
+					}
+				}
+
+				/* Skip the -hang version if NOHANG flag is set */
+				if (f->valid & NOHANG || m->flags & 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

  reply	other threads:[~2018-01-08 10:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-04 14:12 [PATCH i-g-t v2 0/6] kms_vblank: Move tests over from kms_flip Maarten Lankhorst
2018-01-04 14:12 ` [PATCH i-g-t v2 1/6] tests/kms_flip: Remove blt/rcs flip tests Maarten Lankhorst
2018-01-10  8:50   ` Daniel Vetter
2018-01-04 14:12 ` [PATCH i-g-t v2 2/6] kms_vblank: Reorganize subtests by pipe Maarten Lankhorst
2018-01-10  8:57   ` Daniel Vetter
2018-01-10  9:04     ` Daniel Vetter
2018-01-10 10:59       ` Maarten Lankhorst
2018-01-10 12:57         ` Daniel Vetter
2018-01-04 14:12 ` [PATCH i-g-t v2 3/6] tests/kms_flip: Move kms_flip.vblank-vs-hang to kms_vblank, v2 Maarten Lankhorst
2018-01-08 10:23   ` Maarten Lankhorst [this message]
2018-01-10  9:30     ` [PATCH v3 i-g-t] tests/kms_flip: Move kms_flip.vblank-vs-hang to kms_vblank, v3 Daniel Vetter
2018-01-04 14:12 ` [PATCH i-g-t v2 4/6] kms_vblank: Add tests implemented in kms_flip Maarten Lankhorst
2018-01-04 14:12 ` [PATCH i-g-t v2 5/6] kms_flip: Remove redundant vblank tests Maarten Lankhorst
2018-01-04 14:12 ` [PATCH i-g-t v2 6/6] kms_vblank: Remove teardown code from cleanup_crtc Maarten Lankhorst
2018-01-10  9:32   ` Daniel Vetter
2018-01-04 14:49 ` ✓ Fi.CI.BAT: success for kms_vblank: Move tests over from kms_flip. (rev2) Patchwork
2018-01-04 16:52 ` ✓ Fi.CI.IGT: " Patchwork
2018-01-08 13:50 ` ✗ Fi.CI.BAT: failure for kms_vblank: Move tests over from kms_flip. (rev3) Patchwork
2018-01-08 15:08 ` ✓ Fi.CI.BAT: success " Patchwork
2018-01-08 20:00 ` ✗ Fi.CI.IGT: warning " 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=20180108102314.76238-1-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