<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:Arial;font-size:10pt;color:#0000FF;margin:5pt;" align="Left">
[AMD Official Use Only - General]<br>
</p>
<br>
<div>
<div class="elementToProof" style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Helvetica Neue", sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">
Thanks for the feedback. I will drop patch 2</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> Petri Latvala <petri.latvala@intel.com><br>
<b>Sent:</b> 14 December 2022 01:30<br>
<b>To:</b> Hung, Alex <Alex.Hung@amd.com><br>
<b>Cc:</b> igt-dev@lists.freedesktop.org <igt-dev@lists.freedesktop.org><br>
<b>Subject:</b> Re: [igt-dev] [PATCH 2/2] tests/kms_bw: Run tests on available pipes only</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">On Tue, Dec 13, 2022 at 04:43:32PM -0700, Alex Hung wrote:<br>
> This cleans up unnecessary skips during executions.<br>
> <br>
> Signed-off-by: Alex Hung <alex.hung@amd.com><br>
> ---<br>
> tests/kms_bw.c | 16 ++++------------<br>
> 1 file changed, 4 insertions(+), 12 deletions(-)<br>
> <br>
> diff --git a/tests/kms_bw.c b/tests/kms_bw.c<br>
> index 27100587..ac801746 100644<br>
> --- a/tests/kms_bw.c<br>
> +++ b/tests/kms_bw.c<br>
> @@ -145,17 +145,9 @@ static void run_test_linear_tiling(data_t *data, int pipe, const drmModeModeInfo<br>
> igt_output_t *output;<br>
> struct igt_fb buffer[IGT_MAX_PIPES];<br>
> igt_crc_t zero, captured[IGT_MAX_PIPES];<br>
> - int i = 0, num_pipes = 0;<br>
> - enum pipe p;<br>
> + int i = 0;<br>
> int ret;<br>
> <br>
> - /* Cannot use igt_display_get_n_pipes() due to fused pipes on i915 where they do<br>
> - * not give the numver of valid crtcs and always return IGT_MAX_PIPES */<br>
> - for_each_pipe(display, p) num_pipes++;<br>
> -<br>
> - igt_skip_on_f(pipe > num_pipes,<br>
> - "ASIC does not have %d pipes\n", pipe);<br>
> -<br>
> test_init(data);<br>
> <br>
> /* create buffers */<br>
> @@ -204,6 +196,7 @@ igt_main<br>
> {<br>
> data_t data;<br>
> int i = 0, j = 0;<br>
> + enum pipe p;<br>
> <br>
> memset(&data, 0, sizeof(data));<br>
> <br>
> @@ -219,14 +212,13 @@ igt_main<br>
> <br>
> }<br>
> <br>
> - /* We're not using for_each_pipe_static because we need the<br>
> - * _amount_ of pipes */<br>
> - for (i = 0; i < IGT_MAX_PIPES; i++) {<br>
> + for_each_pipe(&data.display, p) {<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>
> }<br>
> + i++;<br>
> }<br>
<br>
<br>
When enumerating tests with --list-subtests you don't have<br>
data.display valid. As gitlab pipeline relay warned for this series.<br>
<br>
What you can do is make this an igt_subtest_with_dynamic, and<br>
<br>
igt_subtest_with_dynamic_f("linear-tiling-multiple-displays-%s", test_mode[j].name) {<br>
for_each_pipe(&data.display, p) {<br>
igt_dynamic_f("%d-displays", i+1) {<br>
run_test_linear_tiling(&data, i, &test_mode[j]);<br>
}<br>
}<br>
}<br>
<br>
However, even with that in place, using for_each_pipe sounds wrong. As<br>
the comment says, this is using an _amount_ of pipes, not one<br>
particular pipe.<br>
<br>
<br>
-- <br>
Petri Latvala<br>
</div>
</span></font></div>
</div>
</body>
</html>