<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Calibri;font-size:10pt;color:#0000FF;margin:5pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[AMD Official Use Only - AMD Internal Distribution Only]<br>
</p>
<br>
<div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com></div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature" style="color: inherit;">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
--</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Regards,</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Aurabindo<br>
</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Kunal Joshi <kunal1.joshi@intel.com><br>
<b>Sent:</b> Monday, June 17, 2024 12:10 PM<br>
<b>To:</b> igt-dev@lists.freedesktop.org <igt-dev@lists.freedesktop.org><br>
<b>Cc:</b> Kunal Joshi <kunal1.joshi@intel.com>; Pillai, Aurabindo <Aurabindo.Pillai@amd.com><br>
<b>Subject:</b> [PATCH i-g-t 1/2] tests/kms_bw: add subtest for only connected outputs</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">forcing DP connector doesn't work well and tests are skipping<br>
with unsupported mode, add new test which runs test on connected<br>
outputs only.<br>
<br>
v2: added debug print for better clarity of skips on unsupported mode<br>
<br>
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com><br>
Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com><br>
Reviewed-by: Aurabindo Pillai <aurabindo.pillai@amd.com><br>
---<br>
 tests/kms_bw.c | 43 +++++++++++++++++++++++++++++++++++++------<br>
 1 file changed, 37 insertions(+), 6 deletions(-)<br>
<br>
diff --git a/tests/kms_bw.c b/tests/kms_bw.c<br>
index 05f7e79ad..9f376bfe3 100644<br>
--- a/tests/kms_bw.c<br>
+++ b/tests/kms_bw.c<br>
@@ -48,6 +48,19 @@<br>
  * @2560x1440p:       2560x1440 resolution<br>
  * @3840x2160p:       3840x2160 resolution<br>
  * @2160x1440p:       2160x1440 resolution<br>
+ *<br>
+ * SUBTEST: connected-linear-tiling-%d-displays-%s<br>
+ * Description: bw test with %arg[2]<br>
+ *<br>
+ * arg[1].values: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16<br>
+ *<br>
+ * arg[2]:<br>
+ *<br>
+ * @1920x1080p:       1920x1080 resolution<br>
+ * @2560x1440p:       2560x1440 resolution<br>
+ * @3840x2160p:       3840x2160 resolution<br>
+ * @2160x1440p:       2160x1440 resolution<br>
+ *<br>
  */<br>
 <br>
 /* Common test data. */<br>
@@ -55,6 +68,7 @@ typedef struct data {<br>
         igt_display_t display;<br>
         igt_plane_t *primary[IGT_MAX_PIPES];<br>
         igt_output_t *output[IGT_MAX_PIPES];<br>
+       igt_output_t *connected_output[IGT_MAX_PIPES];<br>
         igt_pipe_t *pipe[IGT_MAX_PIPES];<br>
         igt_pipe_crc_t *pipe_crc[IGT_MAX_PIPES];<br>
         drmModeModeInfo mode[IGT_MAX_PIPES];<br>
@@ -62,6 +76,7 @@ typedef struct data {<br>
         int w[IGT_MAX_PIPES];<br>
         int h[IGT_MAX_PIPES];<br>
         int fd;<br>
+       int connected_outputs;<br>
 } data_t;<br>
 <br>
 static drmModeModeInfo test_mode[] = {<br>
@@ -108,6 +123,7 @@ static void test_init(data_t *data)<br>
         igt_display_t *display = &data->display;<br>
         int i, max_pipes = display->n_pipes;<br>
         igt_output_t *output;<br>
+       data->connected_outputs = 0;<br>
 <br>
         for_each_pipe(display, i) {<br>
                 data->pipe_id[i] = i;<br>
@@ -124,12 +140,12 @@ static void test_init(data_t *data)<br>
                         continue;<br>
 <br>
                 output = &display->outputs[i];<br>
-<br>
                 data->output[i] = output;<br>
 <br>
                 /* Only allow physically connected displays for the tests. */<br>
                 if (!igt_output_is_connected(output))<br>
                         continue;<br>
+               data->connected_output[data->connected_outputs++] = output;<br>
 <br>
                 igt_assert(kmstest_get_connector_default_mode(<br>
                         data->fd, output->config.connector, &data->mode[i]));<br>
@@ -173,7 +189,7 @@ static void force_output_mode(data_t *d, igt_output_t *output,<br>
         igt_output_override_mode(output, mode);<br>
 }<br>
 <br>
-static void run_test_linear_tiling(data_t *data, int pipe, const drmModeModeInfo *mode) {<br>
+static void run_test_linear_tiling(data_t *data, int pipe, const drmModeModeInfo *mode, bool physical) {<br>
         igt_display_t *display = &data->display;<br>
         igt_output_t *output;<br>
         struct igt_fb buffer[IGT_MAX_PIPES];<br>
@@ -189,11 +205,15 @@ static void run_test_linear_tiling(data_t *data, int pipe, const drmModeModeInfo<br>
         igt_skip_on_f(pipe >= num_pipes,<br>
                       "ASIC does not have %d pipes\n", pipe);<br>
 <br>
+        igt_skip_on_f(physical && pipe > data->connected_outputs ,<br>
+                      "Only %d connected need %d pipes\n",data->connected_outputs, pipe);<br>
+<br>
+<br>
         test_init(data);<br>
 <br>
         /* create buffers */<br>
         for (i = 0; i <= pipe; i++) {<br>
-               output = data->output[i];<br>
+               output = physical ? data->connected_output[i] : data->output[i];<br>
                 if (!output) {<br>
                         continue;<br>
                 }<br>
@@ -208,6 +228,8 @@ static void run_test_linear_tiling(data_t *data, int pipe, const drmModeModeInfo<br>
                 igt_output_set_pipe(output, i);<br>
 <br>
                 igt_plane_set_fb(data->primary[i], &buffer[i]);<br>
+               igt_info("Assigning pipe %s to output %s with mode %s",<br>
+                                kmstest_pipe_name(i), igt_output_name(output), mode->name);<br>
         }<br>
 <br>
         ret = igt_display_try_commit_atomic(display,<br>
@@ -219,7 +241,7 @@ static void run_test_linear_tiling(data_t *data, int pipe, const drmModeModeInfo<br>
         igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, NULL);<br>
 <br>
         for (i = 0; i <= pipe; i++) {<br>
-               output = data->output[i];<br>
+               output = physical ? data->connected_output[i] : data->output[i];<br>
                 if (!output) {<br>
                         continue;<br>
                 }<br>
@@ -230,7 +252,7 @@ static void run_test_linear_tiling(data_t *data, int pipe, const drmModeModeInfo<br>
         }<br>
 <br>
         for (i = pipe; i >= 0; i--) {<br>
-               output = data->output[i];<br>
+               output = physical ? data->connected_output[i] : data->output[i];<br>
                 if (!output)<br>
                         continue;<br>
 <br>
@@ -265,10 +287,19 @@ igt_main<br>
                 for (j = 0; j < ARRAY_SIZE(test_mode); j++) {<br>
                         igt_subtest_f("linear-tiling-%d-displays-%s", i+1,<br>
                               test_mode[j].name)<br>
-                       run_test_linear_tiling(&data, i, &test_mode[j]);<br>
+                       run_test_linear_tiling(&data, i, &test_mode[j], false);<br>
                 }<br>
         }<br>
 <br>
+        for (i = 0; i < IGT_MAX_PIPES; i++) {<br>
+                for (j = 0; j < ARRAY_SIZE(test_mode); j++) {<br>
+                        igt_subtest_f("connected-linear-tiling-%d-displays-%s", i+1,<br>
+                              test_mode[j].name)<br>
+                        run_test_linear_tiling(&data, i, &test_mode[j], true);<br>
+                }<br>
+        }<br>
+<br>
+<br>
         igt_fixture<br>
         {<br>
                 igt_display_fini(&data.display);<br>
-- <br>
2.25.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>