On 20-02-2026 08:52 pm, Kunal Joshi wrote:
Add igt_display_has_mst_output() helper function to check
if a display has at least one DP MST output connected.
This is useful for tests that need to verify MST output
availability before running.

Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
---
 tests/intel/kms_mst_helper.c | 19 +++++++++++++++++++
 tests/intel/kms_mst_helper.h |  1 +
 2 files changed, 20 insertions(+)

diff --git a/tests/intel/kms_mst_helper.c b/tests/intel/kms_mst_helper.c
index aef74cd31..6b986a45c 100644
--- a/tests/intel/kms_mst_helper.c
+++ b/tests/intel/kms_mst_helper.c
@@ -46,3 +46,22 @@ int igt_find_all_mst_output_in_topology(int drm_fd, igt_display_t *display,
 	}
 	return 0;
 }
+
/**
 * igt_display_has_mst_output:
-->with above two lines addition, LGTM:

Reviewed-by: Mohammed Thasleem <mohammed.thasleem@intel.com>

+/*
+ * @display: pointer to #igt_display_t structure
+ *
+ * Iterates over all connected outputs and checks if any of them
+ * is a DP MST output.
+ *
+ * Returns: true if at least one MST output is found, false otherwise
+ */
+bool igt_display_has_mst_output(igt_display_t *display)
+{
+    igt_output_t *output;
+
+    for_each_connected_output(display, output) {
+        if (igt_check_output_is_dp_mst(output))
+            return true;
+    }
+    return false;
+}
diff --git a/tests/intel/kms_mst_helper.h b/tests/intel/kms_mst_helper.h
index 7391494ab..0e8ece0a0 100644
--- a/tests/intel/kms_mst_helper.h
+++ b/tests/intel/kms_mst_helper.h
@@ -12,4 +12,5 @@ int igt_find_all_mst_output_in_topology(int drm_fd, igt_display_t *display,
 					igt_output_t *output,
 					igt_output_t *mst_outputs[],
 					int *num_mst_outputs);
+bool igt_display_has_mst_output(igt_display_t *display);
 #endif