Re: [PATCH i-g-t v2 09/16] tests/kms_vblank: split outer test loop into two

"Thasleem, Mohammed" <[email protected]> Thu, 30 Jul 2026 15:07:26 +0530
Newsgroups org.freedesktop.lists.igt-dev
Message-ID <[email protected]>
--------------CvZwitXTqKvHKa9etl0PxSXI
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: 8bit


On 13-07-2026 02:25 pm, Michał Grzelak wrote:
> for_each_crtc_with_valid_output() iterates over every crtc with
> connected output. Split it into two loops. This is needed to handle
> cases per output.
>
> Signed-off-by: Michał Grzelak<[email protected]>

LGTM:

Reviewed-by: Mohammed Thasleem <[email protected]>

> ---
>   tests/kms_vblank.c | 41 ++++++++++++++++++++++-------------------
>   1 file changed, 22 insertions(+), 19 deletions(-)
>
> diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c
> index 7fb7de0a70..47b733af15 100644
> --- a/tests/kms_vblank.c
> +++ b/tests/kms_vblank.c
> @@ -515,25 +515,28 @@ static void run_subtests(data_t *data)
>   
>   			igt_describe("Check if test run while hanging by introducing NOHANG flag.");
>   			igt_subtest_with_dynamic_f("%s-%s", f->name, m->name) {
> -				for_each_crtc_with_valid_output(&data->display,
> -								crtc,
> -								data->output) {
> -					data->crtc = crtc;
> -					if (!crtc_output_combo_valid(&data->display, crtc, data->output))
> -						continue;
> -
> -					if (!all_pipes && crtc->crtc_index != active_crtcs[0] &&
> -					    crtc->crtc_index != active_crtcs[last_crtc_index]) {
> -						igt_info("Skipping pipe %s\n",
> -							 igt_crtc_name(crtc));
> -						continue;
> -					}
> -
> -					igt_dynamic_f("pipe-%s-%s",
> -						      igt_crtc_name(crtc),
> -						      data->output->name) {
> -						data->flags = m->flags | NOHANG;
> -						run_test(data, f->func);
> +				for_each_connected_output(&data->display, data->output) {
> +					for_each_crtc(&data->display, crtc) {
> +						if(!igt_crtc_connector_valid(crtc, data->output))
> +							continue;
> +
> +						data->crtc = crtc;
> +						if (!crtc_output_combo_valid(&data->display, crtc, data->output))
> +							continue;
> +
> +						if (!all_pipes && crtc->crtc_index != active_crtcs[0] &&
> +						    crtc->crtc_index != active_crtcs[last_crtc_index]) {
> +							igt_info("Skipping pipe %s\n",
> +								 igt_crtc_name(crtc));
> +							continue;
> +						}
> +
> +						igt_dynamic_f("pipe-%s-%s",
> +							      igt_crtc_name(crtc),
> +							      data->output->name) {
> +							data->flags = m->flags | NOHANG;
> +							run_test(data, f->func);
> +						}
>   					}
>   				}
>   			}
--------------CvZwitXTqKvHKa9etl0PxSXI
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: 8bit

<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 13-07-2026 02:25 pm, Michał Grzelak
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:[email protected]">
      <pre wrap="" class="moz-quote-pre">for_each_crtc_with_valid_output() iterates over every crtc with
connected output. Split it into two loops. This is needed to handle
cases per output.

Signed-off-by: Michał Grzelak <a class="moz-txt-link-rfc2396E" href="mailto:[email protected]">&lt;[email protected]&gt;</a></pre>
    </blockquote>
    <pre wrap="" class="moz-quote-pre"><span style="white-space: normal">LGTM:</span></pre>
    <p class="MsoPlainText">Reviewed-by: Mohammed Thasleem &lt;<a href="mailto:[email protected]" class="moz-txt-link-freetext">[email protected]</a>&gt;</p>
    <blockquote type="cite" cite="mid:[email protected]">
      <pre wrap="" class="moz-quote-pre">
---
 tests/kms_vblank.c | 41 ++++++++++++++++++++++-------------------
 1 file changed, 22 insertions(+), 19 deletions(-)

diff --git a/tests/kms_vblank.c b/tests/kms_vblank.c
index 7fb7de0a70..47b733af15 100644
--- a/tests/kms_vblank.c
+++ b/tests/kms_vblank.c
@@ -515,25 +515,28 @@ static void run_subtests(data_t *data)
 
 			igt_describe(&quot;Check if test run while hanging by introducing NOHANG flag.&quot;);
 			igt_subtest_with_dynamic_f(&quot;%s-%s&quot;, f-&gt;name, m-&gt;name) {
-				for_each_crtc_with_valid_output(&amp;data-&gt;display,
-								crtc,
-								data-&gt;output) {
-					data-&gt;crtc = crtc;
-					if (!crtc_output_combo_valid(&amp;data-&gt;display, crtc, data-&gt;output))
-						continue;
-
-					if (!all_pipes &amp;&amp; crtc-&gt;crtc_index != active_crtcs[0] &amp;&amp;
-					    crtc-&gt;crtc_index != active_crtcs[last_crtc_index]) {
-						igt_info(&quot;Skipping pipe %s\n&quot;,
-							 igt_crtc_name(crtc));
-						continue;
-					}
-
-					igt_dynamic_f(&quot;pipe-%s-%s&quot;,
-						      igt_crtc_name(crtc),
-						      data-&gt;output-&gt;name) {
-						data-&gt;flags = m-&gt;flags | NOHANG;
-						run_test(data, f-&gt;func);
+				for_each_connected_output(&amp;data-&gt;display, data-&gt;output) {
+					for_each_crtc(&amp;data-&gt;display, crtc) {
+						if(!igt_crtc_connector_valid(crtc, data-&gt;output))
+							continue;
+
+						data-&gt;crtc = crtc;
+						if (!crtc_output_combo_valid(&amp;data-&gt;display, crtc, data-&gt;output))
+							continue;
+
+						if (!all_pipes &amp;&amp; crtc-&gt;crtc_index != active_crtcs[0] &amp;&amp;
+						    crtc-&gt;crtc_index != active_crtcs[last_crtc_index]) {
+							igt_info(&quot;Skipping pipe %s\n&quot;,
+								 igt_crtc_name(crtc));
+							continue;
+						}
+
+						igt_dynamic_f(&quot;pipe-%s-%s&quot;,
+							      igt_crtc_name(crtc),
+							      data-&gt;output-&gt;name) {
+							data-&gt;flags = m-&gt;flags | NOHANG;
+							run_test(data, f-&gt;func);
+						}
 					}
 				}
 			}
</pre>
    </blockquote>
  </body>
</html>

--------------CvZwitXTqKvHKa9etl0PxSXI--