kms_flip: limit number of subtests run
v4 cover kms_flip: limit number of subtests run
Next version of [1]. This series addresses both 2x-* and single output tests. This series has been tested on config with 4 outputs connected.
[1] https://lore.kernel.org/igt-dev/[email protected]
BR,
Michał
---
Changelog:v3->v4
- change \gt into \ge sign
v2->v3
- ease counting of pairs of outputs
- limit number of tested outputs
- narrow pair & output limiting to suspend subtests
- add separate param for pair and connector limiting
v1->v2
- split pipe limiting into 2x- and single subtests
- add output pair limiting
Michał Grzelak (4):
tests/kms_flip: test suspend on one pair of pipes tests/kms_flip: run suspend tests on one pipe per output tests/kms_flip: limit output pairs when testing suspend tests/kms_flip: limit number of outputs wrt suspend
tests/kms_flip.c | 74 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 61 insertions(+), 13 deletions(-)
Signature · 1 line
2.45.2
PATCH v4 1/4 tests/kms_flip: test suspend on one pair of pipes
Currently, every pair of ({pipe1, pipe2}, {output1, output2}) is being tested in 2x-* subtests. Since suspend shouldn't be tested per pipe, it causes unnecessary overhead: with 4 pipes & 4 displays it runs up to 36 tests. Given that each suspend's dynamic subtest can take up to tens of seconds, total duration of the test easily exceeds timeout.
When testing suspend, for each pair of outputs test only first and last pipe unless it is said to run on all pipes.
--- tests/kms_flip.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
tests/kms_flip.c +8 -2
@@ -1920,6 +1920,12 @@ static void run_pair(int duration, int flags)for (n =0 ; n < resources->count_crtcs; n++) {for (j = i +1 ; j < resources->count_connectors; j++) {for (m = n +1 ; m < resources->count_crtcs; m++) { +/* Limit the execution to 2 CRTCs (first & last) for hang and suspend tests */ +if (((flags &TEST_HANG ) || (flags &TEST_SUSPEND )) && !all_pipes && + ((n !=0 && n != resources->count_crtcs) || + m != resources->count_crtcs -1 )) +continue ; +memset (&o,0 ,sizeof (o)); o.count =2 ; o._connector[0 ] = resources->connectors[i];
@@ -1965,8 +1971,8 @@ static void run_pair(int duration, int flags) crtc_idxs[0 ] = n; crtc_idxs[1 ] = m; -/* Limit the execution to 2 CRTCs (first & last) for hang tests */ -if ((flags &TEST_HANG ) && !all_pipes && +/* Limit the execution to 2 CRTCs (first & last) for hang and suspend tests */ +if (((flags &TEST_HANG ) || (flags &TEST_SUSPEND )) && !all_pipes && ((n !=0 && n != resources->count_crtcs) || m != resources->count_crtcs -1 ))continue ;
Signature · 1 line
2.45.2
PATCH v4 2/4 tests/kms_flip: run suspend tests on one pipe per output
In reply to Michał GrzelakIt is not necessary to test suspend on same output but different pipe. In case of suspend tests, limit number of dynamic subtests run per output when any pipe has already been tested.
--- tests/kms_flip.c | 8 ++++++++ 1 file changed, 8 insertions(+)
tests/kms_flip.c +8 -0
@@ -1846,6 +1846,10 @@ static void run_test(int duration, int flags) n != 0 && n != (resources->count_crtcs - 1))continue ; +/* Limit the execution to 1 CRTC (first) for suspend tests */ +if ((flags &TEST_SUSPEND ) && !all_pipes && n !=0 ) +continue ; +memset (&o,0 ,sizeof (o)); o.count =1 ; o._connector[0 ] = resources->connectors[i];
@@ -1878,6 +1882,10 @@ static void run_test(int duration, int flags) n != 0 && n != (resources->count_crtcs - 1))continue ; +/* Limit the execution to 1 CRTC (first) for suspend tests */ +if ((flags &TEST_SUSPEND ) && !all_pipes && n !=0 ) +continue ; +memset (&o,0 ,sizeof (o)); o.count =1 ; o._connector[0 ] = resources->connectors[i];
Signature · 1 line
2.45.2
PATCH v4 3/4 tests/kms_flip: limit output pairs when testing suspend
In reply to Michał GrzelakCurrently 2x- subtests can still exceed timeout, even with limited number of pipes pair. It can be seen when number of outputs is greater than 3.
Default to testing at max 3 pairs of outputs. Add a commandline parameter enabling suspend testing on all possible output pairs. Add a LIMIT_PAIR macro which controls maximum number of output pairs to test.
--- tests/kms_flip.c | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-)
tests/kms_flip.c +30 -11
@@ -263,11 +263,14 @@#define RUN_TEST 1#define RUN_PAIR 2 +#define PAIR_LIMIT 3 +#ifndef DRM_CAP_TIMESTAMP_MONOTONIC #define DRM_CAP_TIMESTAMP_MONOTONIC 6#endif static bool all_pipes = false; +static bool all_pairs = false;drmModeRes *resources;int drm_fd;
@@ -1906,6 +1909,7 @@ static void run_pair(int duration, int flags) {struct test_output o;int i, j, m, n, modes =0 ; +int pair_count =0 ;/* No tiling support in XE. */ if (is_xe_device (drm_fd) && flags &TEST_FENCE_STRESS )
@@ -1968,6 +1972,16 @@ static void run_pair(int duration, int flags)for (m = n +1 ; m < resources->count_crtcs; m++) {int crtc_idxs[2 ]; +/* Limit the execution to 2 CRTCs (first & last) for hang and suspend tests */ +if (((flags &TEST_HANG ) || (flags &TEST_SUSPEND )) && !all_pipes && + ((n !=0 && n != resources->count_crtcs) || + m != resources->count_crtcs -1 )) +continue ; + +/* Limit number of suspend tests */ +if ((flags &TEST_SUSPEND ) && !all_pairs && pair_count >=PAIR_LIMIT ) +continue ; +memset (&o,0 ,sizeof (o)); o.count =2 ; o._connector[0 ] = resources->connectors[i];
@@ -1979,16 +1993,17 @@ static void run_pair(int duration, int flags) crtc_idxs[0 ] = n; crtc_idxs[1 ] = m; -/* Limit the execution to 2 CRTCs (first & last) for hang and suspend tests */ -if (((flags &TEST_HANG ) || (flags &TEST_SUSPEND )) && !all_pipes && - ((n !=0 && n != resources->count_crtcs) || - m != resources->count_crtcs -1 )) -continue ; +connector_find_compatible_mode (n, m, &o); -run_test_on_crtc_set (&o, crtc_idxs, -RUN_PAIR , - resources->count_crtcs, - duration); +if (o.mode_valid) { +run_test_on_crtc_set (&o, crtc_idxs, +RUN_PAIR , + resources->count_crtcs, + duration); + pair_count++; + }else { +free_test_output (&o); + } } } }
@@ -2046,6 +2061,9 @@ static int opt_handler(int opt, int opt_index, void *data)case 'e' : all_pipes = true;break ; +case 'p' : + all_pairs = true; +break ;default :return IGT_OPT_HANDLER_ERROR ; }
@@ -2054,9 +2072,10 @@ static int opt_handler(int opt, int opt_index, void *data) }const char *help_str = -" -e \tRun on all pipes. (By default subtests will run on two pipes)\n" ; +" -e \tRun on all pipes. (By default subtests will run on two pipes)\n" +" -p \tRun on all output pairs. (By default 2x-* suspend subtests will run on 3 pairs)\n" ; -int igt_main_args("e", NULL, help_str, opt_handler, NULL) +int igt_main_args("ep", NULL, help_str, opt_handler, NULL) { struct { int duration;
Signature · 1 line
2.45.2
PATCH v4 4/4 tests/kms_flip: limit number of outputs wrt suspend
In reply to Michał GrzelakWhen running suspend subtests on single output, we can still hit the timeout by testing too much outputs. Default to testing 3 outputs. Add commandline parameter to run on all outputs.
--- tests/kms_flip.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-)
tests/kms_flip.c +18 -3
@@ -264,12 +264,14 @@#define RUN_PAIR 2#define PAIR_LIMIT 3 +#define CONN_LIMIT 3#ifndef DRM_CAP_TIMESTAMP_MONOTONIC #define DRM_CAP_TIMESTAMP_MONOTONIC 6#endif static bool all_pipes = false; +static bool all_conns = false;static bool all_pairs = false;drmModeRes *resources;
@@ -1824,6 +1826,7 @@ static void run_test(int duration, int flags) {struct test_output o;int i, n, modes =0 ; +int conn_count =0 ;/* No tiling support in XE. */ if (is_xe_device (drm_fd) && flags &TEST_FENCE_STRESS )
@@ -1889,6 +1892,10 @@ static void run_test(int duration, int flags)if ((flags &TEST_SUSPEND ) && !all_pipes && n !=0 )continue ; +/* Limit number of displays run */ +if ((flags &TEST_SUSPEND ) && !all_conns && conn_count >=CONN_LIMIT ) +continue ; +memset (&o,0 ,sizeof (o)); o.count =1 ; o._connector[0 ] = resources->connectors[i];
@@ -1897,8 +1904,15 @@ static void run_test(int duration, int flags) o.depth =24 ; crtc_idx = n; -run_test_on_crtc_set (&o, &crtc_idx,RUN_TEST , - resources->count_crtcs, duration); + +connector_find_preferred_mode (o._connector[0 ], n, &o); +if (o.mode_valid) { +run_test_on_crtc_set (&o, &crtc_idx,RUN_TEST , + resources->count_crtcs, duration); + conn_count++; + }else { +free_test_output (&o); + } } }
@@ -2072,10 +2086,11 @@ static int opt_handler(int opt, int opt_index, void *data) }const char *help_str = +" -c \tRun on all connectors. (By default suspend subtests will run on 3 connectors)\n" " -e \tRun on all pipes. (By default subtests will run on two pipes)\n" " -p \tRun on all output pairs. (By default 2x-* suspend subtests will run on 3 pairs)\n" ; -int igt_main_args("ep", NULL, help_str, opt_handler, NULL) +int igt_main_args("cep", NULL, help_str, opt_handler, NULL) { struct { int duration;
Signature · 1 line
2.45.2
Patchwork
CI✗ Fi.CI.BUILD: failure for kms_flip: limit number of subtests run (rev3)
In reply to Michał Grzelak== Series Details ==
== Series Details ==
Series: kms_flip: limit number of subtests run (rev3)
URL : https://patchwork.freedesktop.org/series/161389/
State : failure
== Summary ==
Applying: tests/kms_flip: test suspend on one pair of pipes Using index info to reconstruct a base tree...
M tests/kms_flip.c
Falling back to patching base and 3-way merge... Auto-merging tests/kms_flip.c
CONFLICT (content): Merge conflict in tests/kms_flip.c
Patch failed at 0001 tests/kms_flip: test suspend on one pair of pipes When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".
Hi Michal,
There seems to be build failure with your patches, can you please float new rev?
Quoted 34 lines · Michał Grzelak
Next version of [1]. This series addresses both 2x-* and single output tests. This series has been tested on config with 4 outputs connected.
[1] https://lore.kernel.org/igt-dev/[email protected]
BR,
Michał---
Changelog:v3->v4
- change \gt into \ge sign
v2->v3
- ease counting of pairs of outputs
- limit number of tested outputs
- narrow pair & output limiting to suspend subtests
- add separate param for pair and connector limiting
v1->v2
- split pipe limiting into 2x- and single subtests
- add output pair limitingMichał Grzelak (4):
tests/kms_flip: test suspend on one pair of pipes tests/kms_flip: run suspend tests on one pipe per output tests/kms_flip: limit output pairs when testing suspend tests/kms_flip: limit number of outputs wrt suspendtests/kms_flip.c | 74 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 61 insertions(+), 13 deletions(-)
Quoted 3 lines · On Thu, 12 Feb 2026, Sharma, Swati2 wrote:
Hi Michal,
There seems to be build failure with your patches, can you please float new rev?
Huh, interesting because I git fetch'ed && git rebase'ed straight before sending patches. Apparently some conflicting changes must have been merged after I sent patches, but before they have been applied by Patchwork, which resulted in build failure:
Patchwork, timestamp of sending to ML:
Subject: [PATCH i-g-t v4 0/4] kms_flip: limit number of subtests run Date: Thu, 12 Feb 2026 12:10:18 +0100
Conflicting change, git log --oneline --pretty=fuller -- tests/kms_flip.c:
commit 2978b9a78 [...] CommitDate: Thu Feb 12 13:20:19 2026 +0200
Patchwork, timestamp of patch application:
Subject: ✗ Fi.CI.BUILD: failure for kms_flip: limit number of subtests run (rev3) Date: Thu, 12 Feb 2026 15:47:28 -0000
Almost impossible to happen, yet still non-zero chances. Let's hope it won't happen for second time in a row. :)
BR,
Michał
Quoted 37 lines · Michał Grzelak
Quoted 34 lines
Next version of [1]. This series addresses both 2x-* and single output tests. This series has been tested on config with 4 outputs connected.
[1] https://lore.kernel.org/igt-dev/[email protected]
BR,
Michał---
Changelog:v3->v4
- change \gt into \ge sign
v2->v3
- ease counting of pairs of outputs
- limit number of tested outputs
- narrow pair & output limiting to suspend subtests
- add separate param for pair and connector limiting
v1->v2
- split pipe limiting into 2x- and single subtests
- add output pair limitingMichał Grzelak (4):
tests/kms_flip: test suspend on one pair of pipes tests/kms_flip: run suspend tests on one pipe per output tests/kms_flip: limit output pairs when testing suspend tests/kms_flip: limit number of outputs wrt suspendtests/kms_flip.c | 74 +++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 61 insertions(+), 13 deletions(-)