[i-g-t v3 2/3] tests/kms_flip: Restrict the hang tests execution to two pipes

Bhanuprakash Modem bhanuprakash.modem at intel.com
Fri Jul 2 21:27:15 UTC 2021


To save the CI execution time, instead of running on all pipes
restrict the hang tests execution to two pipes (first & last).

If we want to execute on all pipes, we need to pass an extra
argument "-e" indicates extended.

Example: ./build/tests/kms_flip -e --r flip-vs-modeset-vs-hang

v2, v3:
* Fix the typo in args handler (Petri)
v4:
* Refactor to run on first & last pipes.

Cc: Uma Shankar <uma.shankar at intel.com>
Cc: Petri Latvala <petri.latvala at intel.com>
Cc: Karthik B S <karthik.b.s at intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
 tests/kms_flip.c | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 8f736652be..944617723d 100755
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -85,6 +85,8 @@
 #define DRM_CAP_TIMESTAMP_MONOTONIC 6
 #endif
 
+static bool all_pipes = false;
+
 drmModeRes *resources;
 int drm_fd;
 static struct buf_ops *bops;
@@ -1450,6 +1452,11 @@ static int run_test(int duration, int flags)
 	/* Count output configurations to scale test runtime. */
 	for (i = 0; i < resources->count_connectors; i++) {
 		for (n = 0; n < resources->count_crtcs; n++) {
+			/* Limit the execution to 2 CRTCs (first & last) for hang tests */
+			if (((flags & TEST_HANG) && !all_pipes) &&
+			    (n != 0 || n != resources->count_crtcs - 1))
+				continue;
+
 			memset(&o, 0, sizeof(o));
 			o.count = 1;
 			o._connector[0] = resources->connectors[i];
@@ -1474,6 +1481,11 @@ static int run_test(int duration, int flags)
 		for (n = 0; n < resources->count_crtcs; n++) {
 			int crtc_idx;
 
+			/* Limit the execution to 2 CRTCs (first & last) for hang tests */
+			if (((flags & TEST_HANG) && !all_pipes) &&
+			    (n != 0 || n != resources->count_crtcs - 1))
+				continue;
+
 			memset(&o, 0, sizeof(o));
 			o.count = 1;
 			o._connector[0] = resources->connectors[i];
@@ -1604,7 +1616,23 @@ static void test_nonblocking_read(int in)
 	close(fd);
 }
 
-igt_main
+static int opt_handler(int opt, int opt_index, void *data)
+{
+	switch (opt) {
+		case 'e':
+			all_pipes = true;
+			break;
+		default:
+			return IGT_OPT_HANDLER_ERROR;
+	}
+
+	return IGT_OPT_HANDLER_SUCCESS;
+}
+
+const char *help_str =
+	"  -e \tRun on all pipes. (By default subtests will run on two pipes)\n";
+
+igt_main_args("e", NULL, help_str, opt_handler, NULL)
 {
 	struct {
 		int duration;
-- 
2.20.1



More information about the Intel-gfx-trybot mailing list