[PATCH 2/2] tests/chamelium/kms_chamelium_color: plug ports and prefer HDMI

Kunal Joshi kunal1.joshi at intel.com
Mon Jun 24 07:18:05 UTC 2024


plug port before starting the test and prefer HDMI connector
as we face DP FSM issues on DP connector

Cc: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
Signed-off-by: Kunal Joshi <kunal1.joshi at intel.com>
---
 tests/chamelium/kms_chamelium_color.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/tests/chamelium/kms_chamelium_color.c b/tests/chamelium/kms_chamelium_color.c
index 4156023da..f8e80f350 100644
--- a/tests/chamelium/kms_chamelium_color.c
+++ b/tests/chamelium/kms_chamelium_color.c
@@ -468,6 +468,19 @@ static int test_setup(data_t *data, enum pipe p)
 
 	data->primary = igt_pipe_get_plane_type(pipe, DRM_PLANE_TYPE_PRIMARY);
 
+	/*
+	 * Prefer to run this test on HDMI connector if its connected, since on DP we
+	 * sometimes face DP FSM issue
+	 */
+        for_each_valid_output_on_pipe(&data->display, p, data->output) {
+                for (i = 0; i < data->port_count; i++) {
+                        if ((data->output->config.connector->connector_type == DRM_MODE_CONNECTOR_HDMIA ||
+			    data->output->config.connector->connector_type == DRM_MODE_CONNECTOR_HDMIB) &&
+			    strcmp(data->output->name, chamelium_port_get_name(data->ports[i])) == 0)
+                                return i;
+                }
+        }
+
 	for_each_valid_output_on_pipe(&data->display, p, data->output) {
 		for (i = 0; i < data->port_count; i++) {
 			if (strcmp(data->output->name,
@@ -709,6 +722,7 @@ run_tests_for_pipe(data_t *data)
 
 igt_main
 {
+	int i;
 	data_t data = {};
 
 	igt_fixture {
@@ -731,6 +745,9 @@ igt_main
 		if (!data.port_count)
 			igt_skip("No ports connected\n");
 
+		for( i = 0; i < data.port_count; i++)
+			chamelium_plug(data.chamelium, data.ports[i]);
+
 		kmstest_set_vt_graphics_mode();
 	}
 
-- 
2.25.1



More information about the igt-dev mailing list