[i-g-t V2 6/6] HAX: Test force joiner on BAT

Bhanuprakash Modem bhanuprakash.modem at intel.com
Thu Apr 18 09:19:59 UTC 2024


Expectation: All pipe-D tests should skip.

Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
---
 tests/kms_flip.c           | 26 +++++++++++++++++++++++++-
 tests/kms_pipe_crc_basic.c |  6 ++++++
 2 files changed, 31 insertions(+), 1 deletion(-)

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 57f6cff7a..24844fc39 100755
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -1748,12 +1748,15 @@ static void run_test_on_crtc_set(struct test_output *o, int *crtc_idxs,
 			 "%s-%d",
 			 kmstest_connector_type_str(o->kconnector[i]->connector_type),
 			 o->kconnector[i]->connector_type_id);
+		igt_force_and_check_bigjoiner_status(drm_fd, conn_name, true);
 
-		if (i > 0)
+		if (i > 0) {
 			snprintf(prev_conn_name, sizeof(prev_conn_name),
 				 "%s-%d",
 				 kmstest_connector_type_str(o->kconnector[i - 1]->connector_type),
 				 o->kconnector[i - 1]->connector_type_id);
+			igt_force_and_check_bigjoiner_status(drm_fd, prev_conn_name, true);
+		}
 
 		if (((igt_check_force_joiner_status(drm_fd, conn_name) ||
 		      igt_bigjoiner_possible(&o->kmode[i], max_dotclock)) &&
@@ -2124,6 +2127,27 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL)
 	igt_stop_signal_helper();
 
 	igt_fixture {
+		resources = drmModeGetResources(drm_fd);
+		if (resources) {
+			for (i = 0; i < resources->count_connectors; i++) {
+				drmModeConnector *connector = drmModeGetConnectorCurrent(drm_fd, resources->connectors[i]);
+				char conn_name[24];
+
+				if (!connector)
+					continue;
+
+				if (connector->connection == DRM_MODE_CONNECTED) {
+					snprintf(conn_name, sizeof(conn_name),
+						 "%s-%d",
+						 kmstest_connector_type_str(connector->connector_type),
+						 connector->connector_type_id);
+					igt_force_and_check_bigjoiner_status(drm_fd, conn_name, false);
+				}
+			}
+
+			drmModeFreeResources(resources);
+		}
+
 		igt_display_fini(&display);
 		drm_close_driver(drm_fd);
 	}
diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
index 0c19745bc..65b9647ec 100644
--- a/tests/kms_pipe_crc_basic.c
+++ b/tests/kms_pipe_crc_basic.c
@@ -411,6 +411,9 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL)
 
 		data.debugfs = igt_debugfs_dir(data.drm_fd);
 
+		for_each_connected_output(&data.display, output)
+			igt_force_and_check_bigjoiner_status(data.drm_fd, output->name, true);
+
 		/* Get active pipes. */
 		for_each_pipe(&data.display, pipe)
 			active_pipes[last_pipe++] = pipe;
@@ -499,6 +502,9 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL)
 	}
 
 	igt_fixture {
+		for_each_connected_output(&data.display, output)
+			igt_force_and_check_bigjoiner_status(data.drm_fd, output->name, false);
+
 		igt_display_fini(&data.display);
 		drm_close_driver(data.drm_fd);
 	}
-- 
2.43.2



More information about the igt-dev mailing list