[PATCH i-g-t] tests/kms_bw: Restrict linear-tiling subtest to HDMI outputs and improve skip logic

Pranay Samala pranay.samala at intel.com
Tue Jul 8 04:04:25 UTC 2025


This patch updates the linear-tiling subtest in kms_bw to only use HDMI
connector. If the platform does not have enough HDMI outputs to match the
number of requested pipes, the test is skipped with a clear message
indicating the requirement and the number of HDMI outputs found.

This avoids attempting to force modes on non-HDMI connectors and makes
the test results clearer and more reliable on systems that don’t have
enough HDMI connectivity.

v2:
- Skip the test instead of continue (Rama)
- Remove hdmi_count (Rama)

v3:
- Only force mode if mode is not present

Signed-off-by: Pranay Samala <pranay.samala at intel.com>
---
 tests/kms_bw.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/tests/kms_bw.c b/tests/kms_bw.c
index ca05695d3..c09b80dd7 100644
--- a/tests/kms_bw.c
+++ b/tests/kms_bw.c
@@ -195,6 +195,7 @@ static void run_test_linear_tiling(data_t *data, int pipe, const drmModeModeInfo
 	int i = 0, num_pipes = 0;
 	enum pipe p;
 	int ret;
+	bool mode_found = false;
 
 	/* Cannot use igt_display_get_n_pipes() due to fused pipes on i915 where they do
 	 * not give the numver of valid crtcs and always return IGT_MAX_PIPES */
@@ -215,7 +216,24 @@ static void run_test_linear_tiling(data_t *data, int pipe, const drmModeModeInfo
 			continue;
 		}
 
-		force_output_mode(data, output, mode);
+		// Check if the mode is present in the output's mode list
+		for (int m = 0; m < output->config.connector->count_modes; m++) {
+			if (output->config.connector->modes[m].hdisplay == mode->hdisplay &&
+			    output->config.connector->modes[m].vdisplay == mode->vdisplay){
+				mode_found = true;
+				break;
+			}
+		}
+
+		if (!mode_found) {
+			if (!physical &&
+			    output->config.connector->connector_type != DRM_MODE_CONNECTOR_HDMIA &&
+			    output->config.connector->connector_type != DRM_MODE_CONNECTOR_HDMIB)
+				force_output_mode(data, output, mode);
+		} else {
+			igt_skip("Requested mode not present, can't force mode on %s\n",
+				 igt_output_name(output));
+		}
 
 		igt_create_color_fb(display->drm_fd, mode->hdisplay,
 				    mode->vdisplay, DRM_FORMAT_XRGB8888,
-- 
2.34.1



More information about the igt-dev mailing list