<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<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 style="font-family: "Segoe UI", "Segoe UI Web (West European)", "Helvetica Neue", sans-serif; font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof">
Reviewed-by: Alex Hung <alex.hung@amd.com><br>
</div>
<div id="appendonsend"></div>
<div style="font-family:"Segoe UI","Segoe UI Web (West European)","Helvetica Neue",sans-serif; font-size:12pt; color:rgb(0,0,0)" class="elementToProof">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt" class="elementToProof"><b>From:</b> igt-dev <igt-dev-bounces@lists.freedesktop.org> on behalf of Maíra Canal <maira.canal@usp.br><br>
<b>Sent:</b> 11 June 2022 13:03<br>
<b>To:</b> igt-dev@lists.freedesktop.org <igt-dev@lists.freedesktop.org><br>
<b>Cc:</b> magalilemes00@gmail.com <magalilemes00@gmail.com>; tales.aparecida@gmail.com <tales.aparecida@gmail.com>; Maíra Canal <maira.canal@usp.br>; Deucher, Alexander <Alexander.Deucher@amd.com>; Isabella Basso <isabbasso@riseup.net>; andrealmeid@riseup.net
<andrealmeid@riseup.net>; Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com>; Koenig, Christian <Christian.Koenig@amd.com><br>
<b>Subject:</b> [igt-dev] [PATCH i-g-t] tests/amdgpu: Skip multihead MPO tests on single display</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText elementToProof">[Why]<br>
If only one output is connected, all the igt@amdgpu/amd_plane "-multihead"<br>
subtests will result in CRASH, such as can be seen in:<br>
<br>
Starting subtest: mpo-scale-nv12-multihead<br>
Received signal SIGSEGV.<br>
Stack trace:<br>
#0 [fatal_sig_handler+0x163]<br>
#1 [__sigaction+0x50]<br>
#2 [force_output_mode+0xa]<br>
#3 [test_display_mpo+0x20b]<br>
#4 [__igt_unique____real_main725+0x106d]<br>
#5 [main+0x23]<br>
#6 [__libc_start_call_main+0x80]<br>
#7 [__libc_start_main+0x89]<br>
#8 [_start+0x25]<br>
Subtest mpo-scale-nv12-multihead: CRASH (0.009s)<br>
<br>
In single-display systems, the "-multihead" subtests should SKIP.<br>
<br>
[How]<br>
Count the number of connected outputs on the system and compare it to the<br>
ideal number depending on the subtest, using igt_skip_on to assure that<br>
multiheaded subtests will SKIP on single display systems.<br>
<br>
Signed-off-by: Maíra Canal <maira.canal@usp.br><br>
---<br>
tests/amdgpu/amd_plane.c | 17 +++++++++++++++++<br>
1 file changed, 17 insertions(+)<br>
<br>
diff --git a/tests/amdgpu/amd_plane.c b/tests/amdgpu/amd_plane.c<br>
index faaa1b87..4b2bee49 100644<br>
--- a/tests/amdgpu/amd_plane.c<br>
+++ b/tests/amdgpu/amd_plane.c<br>
@@ -449,9 +449,11 @@ static void test_display_mpo(data_t *data, enum test test, uint32_t format, int<br>
{<br>
<br>
igt_display_t *display = &data->display;<br>
+ igt_output_t *output;<br>
uint32_t regamma_lut_size;<br>
lut_t lut;<br>
struct fbc fb[4];<br>
+ int valid_outputs = 0;<br>
int videos[][2]= {<br>
{426, 240},<br>
{640, 360},<br>
@@ -464,6 +466,13 @@ static void test_display_mpo(data_t *data, enum test test, uint32_t format, int<br>
<br>
test_init(data);<br>
<br>
+ /* Skip if there is less valid outputs than the required. */<br>
+ for_each_connected_output(display, output)<br>
+ valid_outputs++;<br>
+<br>
+ igt_skip_on_f(valid_outputs < display_count,<br>
+ "Valid outputs (%d) should be equal or greater than %d\n", valid_outputs, display_count);<br>
+<br>
regamma_lut_size = igt_pipe_obj_get_prop(data->pipe[0], IGT_CRTC_GAMMA_LUT_SIZE);<br>
igt_assert_lt(0, regamma_lut_size);<br>
lut_init(&lut, regamma_lut_size);<br>
@@ -586,9 +595,17 @@ static void test_mpo_swizzle_toggle_multihead(data_t *data)<br>
{<br>
struct amdgpu_bo_metadata meta = {};<br>
igt_display_t *display = &data->display;<br>
+ igt_output_t *output;<br>
igt_fb_t fb_1280_xr24_tiled, fb_1280_ar24_tiled, fb_1920_xb24_tiled,<br>
fb_1920_xb24_linear, fb_1920_xr24_tiled;<br>
int w, h;<br>
+ int valid_outputs = 0;<br>
+<br>
+ /* Skip if only one display is connected. */<br>
+ for_each_connected_output(display, output)<br>
+ valid_outputs++;<br>
+<br>
+ igt_skip_on_f(valid_outputs == 1, "Must have more than one output connected\n");<br>
<br>
w = 2400;<br>
h = 1350;<br>
-- <br>
2.36.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>