<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p>Hi Pranay,</p>
    <div class="moz-cite-prefix">On 7/8/2025 9:34 AM, Pranay Samala
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:20250708040425.950013-1-pranay.samala@intel.com">
      <pre wrap="" class="moz-quote-pre">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 <a class="moz-txt-link-rfc2396E" href="mailto:pranay.samala@intel.com"><pranay.samala@intel.com></a>
---
 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));
+               }</pre>
    </blockquote>
    <pre class="content" style="box-sizing: border-box; overflow: auto; font-family: Menlo, Monaco, Consolas, "Courier New", monospace; font-size: 13px; display: block; padding: 9.5px; margin: 0px 0px 10px; line-height: 14.3px; color: rgb(51, 51, 51); word-break: break-all; overflow-wrap: break-word; background-color: white; border: 0px; border-radius: 0px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial;">LGTM,<span class="reviewed-by" style="box-sizing: border-box;">
Reviewed-by: Naladala Ramanaidu <a class="moz-txt-link-rfc2396E" href="mailto:ramanaidu.naladala@intel.com"><ramanaidu.naladala@intel.com></a></span></pre>
    <blockquote type="cite" cite="mid:20250708040425.950013-1-pranay.samala@intel.com">
      <pre wrap="" class="moz-quote-pre">
 
                igt_create_color_fb(display->drm_fd, mode->hdisplay,
                                    mode->vdisplay, DRM_FORMAT_XRGB8888,
</pre>
    </blockquote>
  </body>
</html>