[igt-dev] [PATCH i-g-t] tests/amdgpu: Skip multihead MPO tests on single display

Hung, Alex Alex.Hung at amd.com
Mon Jun 13 17:19:05 UTC 2022


[AMD Official Use Only - General]

Reviewed-by: Alex Hung <alex.hung at amd.com>

________________________________
From: igt-dev <igt-dev-bounces at lists.freedesktop.org> on behalf of Maíra Canal <maira.canal at usp.br>
Sent: 11 June 2022 13:03
To: igt-dev at lists.freedesktop.org <igt-dev at lists.freedesktop.org>
Cc: magalilemes00 at gmail.com <magalilemes00 at gmail.com>; tales.aparecida at gmail.com <tales.aparecida at gmail.com>; Maíra Canal <maira.canal at usp.br>; Deucher, Alexander <Alexander.Deucher at amd.com>; Isabella Basso <isabbasso at riseup.net>; andrealmeid at riseup.net <andrealmeid at riseup.net>; Lakha, Bhawanpreet <Bhawanpreet.Lakha at amd.com>; Koenig, Christian <Christian.Koenig at amd.com>
Subject: [igt-dev] [PATCH i-g-t] tests/amdgpu: Skip multihead MPO tests on single display

[Why]
If only one output is connected, all the igt at amdgpu/amd_plane "-multihead"
subtests will result in CRASH, such as can be seen in:

Starting subtest: mpo-scale-nv12-multihead
Received signal SIGSEGV.
Stack trace:
 #0 [fatal_sig_handler+0x163]
 #1 [__sigaction+0x50]
 #2 [force_output_mode+0xa]
 #3 [test_display_mpo+0x20b]
 #4 [__igt_unique____real_main725+0x106d]
 #5 [main+0x23]
 #6 [__libc_start_call_main+0x80]
 #7 [__libc_start_main+0x89]
 #8 [_start+0x25]
Subtest mpo-scale-nv12-multihead: CRASH (0.009s)

In single-display systems, the "-multihead" subtests should SKIP.

[How]
Count the number of connected outputs on the system and compare it to the
ideal number depending on the subtest, using igt_skip_on to assure that
multiheaded subtests will SKIP on single display systems.

Signed-off-by: Maíra Canal <maira.canal at usp.br>
---
 tests/amdgpu/amd_plane.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/tests/amdgpu/amd_plane.c b/tests/amdgpu/amd_plane.c
index faaa1b87..4b2bee49 100644
--- a/tests/amdgpu/amd_plane.c
+++ b/tests/amdgpu/amd_plane.c
@@ -449,9 +449,11 @@ static void test_display_mpo(data_t *data, enum test test, uint32_t format, int
 {

         igt_display_t *display = &data->display;
+       igt_output_t *output;
         uint32_t regamma_lut_size;
         lut_t lut;
         struct fbc fb[4];
+       int valid_outputs = 0;
         int videos[][2]= {
                 {426, 240},
                 {640, 360},
@@ -464,6 +466,13 @@ static void test_display_mpo(data_t *data, enum test test, uint32_t format, int

         test_init(data);

+       /* Skip if there is less valid outputs than the required. */
+       for_each_connected_output(display, output)
+               valid_outputs++;
+
+       igt_skip_on_f(valid_outputs < display_count,
+                       "Valid outputs (%d) should be equal or greater than %d\n", valid_outputs, display_count);
+
         regamma_lut_size = igt_pipe_obj_get_prop(data->pipe[0], IGT_CRTC_GAMMA_LUT_SIZE);
         igt_assert_lt(0, regamma_lut_size);
         lut_init(&lut, regamma_lut_size);
@@ -586,9 +595,17 @@ static void test_mpo_swizzle_toggle_multihead(data_t *data)
 {
         struct amdgpu_bo_metadata meta = {};
         igt_display_t *display = &data->display;
+       igt_output_t *output;
         igt_fb_t fb_1280_xr24_tiled, fb_1280_ar24_tiled, fb_1920_xb24_tiled,
                 fb_1920_xb24_linear, fb_1920_xr24_tiled;
         int w, h;
+       int valid_outputs = 0;
+
+       /* Skip if only one display is connected. */
+       for_each_connected_output(display, output)
+               valid_outputs++;
+
+       igt_skip_on_f(valid_outputs == 1, "Must have more than one output connected\n");

         w = 2400;
         h = 1350;
--
2.36.1

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/igt-dev/attachments/20220613/135b10ed/attachment.htm>


More information about the igt-dev mailing list