[i-g-t v2 35/51] tests/kms_vblank: Add support for Bigjoiner

Bhanuprakash Modem bhanuprakash.modem at intel.com
Fri Aug 12 05:20:09 UTC 2022


Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
 tests/kms_vblank.c | 39 +++++++++++++++++++++++++++++++++++++--
 1 file changed, 37 insertions(+), 2 deletions(-)

diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c
index e65e8522..45475e90 100644
--- a/tests/kms_vblank.c
+++ b/tests/kms_vblank.c
@@ -188,6 +188,12 @@ static void crtc_id_subtest(data_t *data, int fd)
 		uint64_t val;
 		union drm_wait_vblank vbl;
 
+		igt_display_reset(display);
+
+		igt_output_set_pipe(output, p);
+		if (!igt_test_constraint(display))
+			continue;
+
 		crtc_id = display->pipes[p].crtc_id;
 		if (drmGetCap(display->drm_fd, DRM_CAP_CRTC_IN_VBLANK_EVENT, &val) == 0)
 			expected_crtc_id = crtc_id;
@@ -449,10 +455,21 @@ static void run_subtests_for_pipe(data_t *data)
 			igt_subtest_f("pipe-%s-%s-%s",
 				      kmstest_pipe_name(data->pipe),
 				      f->name, m->name) {
+				int success = 0;
+
 				for_each_valid_output_on_pipe(&data->display, data->pipe, data->output) {
+					igt_display_reset(&data->display);
+
+					igt_output_set_pipe(data->output, data->pipe);
+					if (!igt_test_constraint(&data->display))
+						continue;
+
 					data->flags = m->flags | NOHANG;
 					run_test(data, f->func);
+
+					success++;
 				}
+				igt_require(success);
 			}
 
 			/* Skip the -hang version if NOHANG flag is set */
@@ -464,13 +481,23 @@ static void run_subtests_for_pipe(data_t *data)
 				      kmstest_pipe_name(data->pipe),
 				      f->name, m->name) {
 				igt_hang_t hang;
+				int success = 0;
 
 				hang = igt_allow_hang(data->display.drm_fd, 0, 0);
 				for_each_valid_output_on_pipe(&data->display, data->pipe, data->output) {
+					igt_display_reset(&data->display);
+
+					igt_output_set_pipe(data->output, data->pipe);
+					if (!igt_test_constraint(&data->display))
+						continue;
+
 					data->flags = m->flags;
 					run_test(data, f->func);
+
+					success++;
 				}
 				igt_disallow_hang(data->display.drm_fd, hang);
+				igt_require(success);
 			}
 		}
 	}
@@ -482,12 +509,20 @@ static void invalid_subtest(data_t *data, int fd)
 	unsigned long valid_flags;
 	igt_display_t* display = &data->display;
 	enum pipe pipe = 0;
-	igt_output_t* output = igt_get_single_output_for_pipe(display, pipe);
+	igt_output_t *output;
+
+	igt_display_reset(display);
+	igt_display_require_output_on_pipe(display, pipe);
+
+	output = igt_get_single_output_for_pipe(display, pipe);
+	igt_require(output);
 
 	data->pipe = pipe;
 	data->output = output;
+
 	igt_output_set_pipe(output, pipe);
-	igt_display_require_output_on_pipe(display, pipe);
+	igt_require(igt_test_constraint(display));
+
 	prepare_crtc(data, fd, output);
 
 	/* First check all is well with a simple query */
-- 
2.35.1



More information about the Intel-gfx-trybot mailing list