tests: limiting suspend tests
v4 cover tests: limiting suspend tests
Next version of [1].
BR,
Michał
[1] https://lore.kernel.org/igt-dev/[email protected]
Michał Grzelak (17):
lib/igt_aux: remove typos
lib/igt_kms: s/pipe/crtc/
tests/kms_async_flips: split outer test loop into two tests/kms_async_flips: limit S/R to first and last CRTC tests/kms_frontbuffer_tracking: remove TEST_MODE_ITER_BEGIN() from
suspend
tests/kms_frontbuffer_tracking: remove TEST_MODE_ITER_BEGIN() from
fliptrack
tests/kms_pipe_crc_basic: limit #crtcs tested during suspend tests/kms_psr: limit #outputs tested during suspend tests/kms_vblank: split outer test loop into two tests/kms_vblank: limit #outputs tested during suspend tests/kms_sharpness_filter: fix typo tests/kms_sharpness_filter: limit #outputs tested during suspend tests/kms_sharpness_filter: limit #crtcs tested during suspend tests/intel/kms_ccs: split outer test loop into two tests/intel/kms_ccs: limit #outputs tested during suspend tests/intel/kms_ccs: limit #crtcs tested during suspend tests/kms_hdr: run on 3 outputs when testing suspend
lib/igt_aux.c | 2 +- lib/igt_kms.h | 2 +- tests/intel/kms_ccs.c | 92 ++++++++++++++++++-------- tests/intel/kms_frontbuffer_tracking.c | 63 ++++++++++++------ tests/intel/kms_psr.c | 28 +++++++- tests/intel/kms_sharpness_filter.c | 29 +++++++- tests/kms_async_flips.c | 68 +++++++++++-------- tests/kms_hdr.c | 30 ++++++++- tests/kms_pipe_crc_basic.c | 13 ++++ tests/kms_vblank.c | 54 ++++++++++----- 10 files changed, 276 insertions(+), 105 deletions(-)
Signature · 1 line
2.45.2
PATCH v4 1/17 lib/igt_aux: remove typos
Fix typos found in comments.
--- lib/igt_aux.c | 2 +- tests/intel/kms_frontbuffer_tracking.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
lib/igt_aux.c +1 -1
@@ -978,7 +978,7 @@ static void igt_aux_enable_pm_suspend_dbg(int power_dir)* cycle * * Execute a system suspend cycle targeting the given @state optionally -* completing the cycle at the given @test point and automaically wake up +* completing the cycle at the given @test point and automatically wake up * again. Waking up is either achieved using the RTC wake-up alarm for a full * suspend cycle or a kernel timer for a suspend test cycle. The kernel timer * delay for a test cycle can be configured by the suspend.pm_test_delay
tests/intel/kms_frontbuffer_tracking.c +1 -1
@@ -3844,7 +3844,7 @@ static void suspend_subtest(const struct test_mode *t)* Everything succeeds. * * FAILURES -* If you're getting wrong CRC calulations, then the hardware tracking might +* If you're getting wrong CRC calculations, then the hardware tracking might * be misconfigured and needs to be checked. If we're failing because FBC is * disabled and the reason is that there's not enough stolen memory, then the * Kernel might be calculating the amount of stolen memory needed based on the
Signature · 1 line
2.45.2
PATCH v4 2/17 lib/igt_kms: s/pipe/crtc/
In reply to Michał GrzelakRefer to crtc instead of pipe.
--- lib/igt_kms.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/igt_kms.h +1 -1
@@ -774,7 +774,7 @@ static inline bool igt_crtc_connector_valid(igt_crtc_t *crtc, igt_output_t *outp* * If you only need to test a single output for each pipe, use * for_each_crtc_with_single_output(), if you only need an -* output for a single CRTC, use igt_get_single_output_for_pipe(). +* output for a single CRTC, use igt_get_single_output_for_crtc(). */ #define for_each_crtc_with_valid_output (display, crtc, output) \ for ((output) = &(display)->outputs[0], (crtc) = &(display)->crtcs[0]; \
Signature · 1 line
2.45.2
PATCH v4 3/17 tests/kms_async_flips: split outer test loop into two
In reply to Michał Grzelakfor_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.
v3->v4
- break outer loop as well (Mohammed)
- add missing space (Mohammed)
--- tests/kms_async_flips.c | 63 ++++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 29 deletions(-)
tests/kms_async_flips.c +34 -29
@@ -877,39 +877,44 @@ static void run_test(data_t *data, void (*test)(data_t *))if (data->atomic_path)require_atomic_async_cap (data); -for_each_crtc_with_valid_output (display, crtc, data->output) { - data->crtc = crtc; -igt_display_reset (display); +for_each_connected_output (display, data->output) { +for_each_crtc (&data->display, crtc) { +if (!igt_crtc_connector_valid (crtc, data->output)) +continue ; -igt_output_set_crtc (data->output, - crtc); -if (!intel_pipe_output_combo_valid (display)) -continue ; + data->crtc = crtc; +igt_display_reset (display); -test_init (data); +igt_output_set_crtc (data->output, + crtc); +if (!intel_pipe_output_combo_valid (display)) +continue ; -if (data->linear_modifier) - data->modifier =DRM_FORMAT_MOD_LINEAR ; -else - data->modifier =default_modifier (data); - -igt_require (igt_format_mods_has_modifier (&data->plane->format_mods_async, - data->modifier)); - -igt_dynamic_f ("pipe-%s-%s" ,igt_crtc_name (crtc), - data->output->name) { -/* -* FIXME: joiner+async flip is busted currently in KMD. -* Remove this check once the issues are fixed in KMD. -*/ -igt_skip_on_f (is_joiner_mode (data->drm_fd, data->output), -"Skipping, async flip not supported on joiner mode\n" ); -test_init_fbs (data); -test (data); +test_init (data); + +if (data->linear_modifier) + data->modifier =DRM_FORMAT_MOD_LINEAR ; +else + data->modifier =default_modifier (data); + +igt_require (igt_format_mods_has_modifier (&data->plane->format_mods_async, + data->modifier)); + +igt_dynamic_f ("pipe-%s-%s" ,igt_crtc_name (crtc), + data->output->name) { +/* +* FIXME: joiner+async flip is busted currently in KMD. +* Remove this check once the issues are fixed in KMD. +*/ +igt_skip_on_f (is_joiner_mode (data->drm_fd, data->output), +"Skipping, async flip not supported on joiner mode\n" ); +test_init_fbs (data); +test (data); + } +/* Restrict to single pipe in simulation */ +if (data->single_pipe) +return ; } -/* Restrict to single pipe in simulation */ -if (data->single_pipe) -break ; } }
Signature · 1 line
2.45.2
PATCH v4 4/17 tests/kms_async_flips: limit S/R to first and last CRTC
In reply to Michał GrzelakIn order to increase tests performance limit suspend-resume's execution to only first and last CRTC.
v3->v4
- use crtc instead of display->crtcs (Mohammed)
- use proper logic operator (Mohammed)
v2->v3
- add missing S-O-B
--- tests/kms_async_flips.c | 5 +++++ 1 file changed, 5 insertions(+)
tests/kms_async_flips.c +5 -0
@@ -873,6 +873,7 @@ static void run_test(data_t *data, void (*test)(data_t *)) {igt_crtc_t *crtc;igt_display_t *display = &data->display; +int idx;if (data->atomic_path)require_atomic_async_cap (data);
@@ -885,6 +886,10 @@ static void run_test(data_t *data, void (*test)(data_t *)) data->crtc = crtc;igt_display_reset (display); + idx = crtc->crtc_index; +if (data->suspend_resume && idx !=0 && idx != display->n_crtcs -1 ) +continue ; +igt_output_set_crtc (data->output, crtc);if (!intel_pipe_output_combo_valid (display))
Signature · 1 line
2.45.2
PATCH v4 5/17 tests/kms_frontbuffer_tracking: remove TEST_MODE_ITER_BEGIN() from `suspend`
In reply to Michał Grzelakigt@kms_frontbuffer_tracking uses TEST_MODE_ITER_BEGIN(t) which consists of nested for loops. However many loops can be omitted due to continue statements. This obfuscates following the execution of any given codepath. Replace TEST_MODE_ITER_BEGIN(t) for fliptrack tests with macro definition and remove loops that are skipped.
v1->v2
- remove blank line (Mohammed)
--- tests/intel/kms_frontbuffer_tracking.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-)
tests/intel/kms_frontbuffer_tracking.c +14 -7
@@ -4646,12 +4646,19 @@ int igt_main_args("", long_options, help_str, opt_handler, NULL) }TEST_MODE_ITER_END - TEST_MODE_ITER_BEGIN(t) - if (t.pipes != PIPE_SINGLE || - t.screen != SCREEN_PRIM || - t.plane != PLANE_PRI || - t.fbs != FBS_INDIVIDUAL || - t.method != IGT_DRAW_BLT) + t.format = FORMAT_DEFAULT; + t.flip =FLIP_PAGEFLIP ; + t.tiling = opt.tiling; + t.pipes =PIPE_SINGLE ; + t.screen =SCREEN_PRIM ; + t.plane =PLANE_PRI ; + t.fbs =FBS_INDIVIDUAL ; + t.method =IGT_DRAW_BLT ; + +for (t.feature =0 ; t.feature <FEATURE_COUNT ; t.feature++) { +if (!opt.show_hidden && t.feature ==FEATURE_NONE ) +continue ; +if ((t.feature &FEATURE_PSR ) && (t.feature &FEATURE_DRRS ))continue ;igt_subtest_f ("%s-modesetfrombusy" ,feature_str (t.feature))
@@ -4712,7 +4719,7 @@ int igt_main_args("", long_options, help_str, opt_handler, NULL)igt_require (igt_draw_supports_method (drm.fd, t.method));suspend_subtest (&t); } -TEST_MODE_ITER_END + } t.pipes =PIPE_SINGLE ; t.screen =SCREEN_PRIM ;
Signature · 1 line
2.45.2
PATCH v4 6/17 tests/kms_frontbuffer_tracking: remove TEST_MODE_ITER_BEGIN() from `fliptrack`
In reply to Michał Grzelakigt@kms_frontbuffer_tracking uses TEST_MODE_ITER_BEGIN(t) which consists of nested for loops. However many loops can be omitted due to continue statements. This obfuscates following the execution of any given codepath. Replace TEST_MODE_ITER_BEGIN(t) for fliptrack tests with macro definition and remove loops that are skipped.
v2->v3
- identation cleanups (Mohammed)
- pull conditions after first loop (Mohammed)
v1->v2
- indent for-loops (Mohammed)
--- tests/intel/kms_frontbuffer_tracking.c | 40 +++++++++++++++++--------- 1 file changed, 26 insertions(+), 14 deletions(-)
tests/intel/kms_frontbuffer_tracking.c +26 -14
@@ -4502,23 +4502,35 @@ int igt_main_args("", long_options, help_str, opt_handler, NULL) }TEST_MODE_ITER_END - TEST_MODE_ITER_BEGIN(t) - if (t.plane != PLANE_PRI || - t.screen != SCREEN_PRIM || - t.method != IGT_DRAW_MMAP_GTT || - (t.feature & FEATURE_FBC) == 0) + t.format = FORMAT_DEFAULT; + t.flip =FLIP_PAGEFLIP ; + t.tiling = opt.tiling; + t.plane =PLANE_PRI ; + t.screen =SCREEN_PRIM ; + t.method =IGT_DRAW_MMAP_GTT ; + +for (t.feature =0 ; t.feature <FEATURE_COUNT ; t.feature++) { +if (!opt.show_hidden && t.feature ==FEATURE_NONE ) +continue ; +if ((t.feature &FEATURE_PSR ) && (t.feature &FEATURE_DRRS )) +continue ; +if ((t.feature &FEATURE_FBC ) ==0 )continue ; - igt_subtest_f("%s-%s-%s-fliptrack-%s", - feature_str(t.feature), - pipes_str(t.pipes), - fbs_str(t.fbs), - igt_draw_get_method_name(t.method)) - { -igt_require (igt_draw_supports_method (drm.fd, t.method)); -fliptrack_subtest (&t,FLIP_PAGEFLIP ); +for (t.pipes =0 ; t.pipes <PIPE_COUNT ; t.pipes++) { +for (t.fbs =0 ; t.fbs <FBS_COUNT ; t.fbs++) { +igt_subtest_f ("%s-%s-%s-fliptrack-%s" , +feature_str (t.feature), +pipes_str (t.pipes), +fbs_str (t.fbs), + igt_draw_get_method_name(t.method)) + { +igt_require (igt_draw_supports_method (drm.fd, t.method)); +fliptrack_subtest (&t,FLIP_PAGEFLIP ); + } + } } - TEST_MODE_ITER_END + } TEST_MODE_ITER_BEGIN(t) if (t.screen == SCREEN_OFFSCREEN ||
Signature · 1 line
2.45.2
PATCH v4 7/17 tests/kms_pipe_crc_basic: limit #crtcs tested during suspend
In reply to Michał GrzelakLimit execution of suspend tests to first and last active CRTC unless using extended flag. This helps with reducing default execution time of the test which can lower number of hitting CI timeout.
v1->v2
- move constraint before crtc_output_combo_valid() (Mohammed)
--- tests/kms_pipe_crc_basic.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
tests/kms_pipe_crc_basic.c +13 -0
@@ -127,6 +127,16 @@ enum { TEST_HANG = 1 << 3, }; +static bool suspend_constraint (unsigned flags,igt_crtc_t *crtc) +{ +if (!extended && (flags &TEST_SUSPEND ) && + crtc->crtc_index != active_crtcs[0 ] && + crtc->crtc_index != active_crtcs[last_crtc_index]) +return true; + +return false; +} +static void test_read_crc (data_t *data,igt_crtc_t *crtc,igt_output_t *output,unsigned flags) {
@@ -425,6 +435,9 @@ int igt_main_args("e", NULL, help_str, opt_handler, NULL)if (simulation_constraint (crtc))continue ; +if (suspend_constraint (tests[i].flags, crtc)) +continue ; +if (!crtc_output_combo_valid (&data.display, crtc, output))continue ;
Signature · 1 line
2.45.2
PATCH v4 8/17 tests/kms_psr: limit #outputs tested during suspend
In reply to Michał GrzelakWe are iterating through each output while testing suspend. This results in extended execution time. In turn this leads to hitting CI enforced timeout.
By default limit number of tested outputs to 2. Test each connected output when passing command-line parameter.
v3->v4
- indent `case' at same level as switch (Mohammed)
v2->v3
- remove blank line (Mohammed)
- change output format of help string (Mohammed)
v1->v2
- s/OUTPUT_LIMIT/SUSPEND_OUTPUT_LIMIT/ (Mohammed)
- fix typos (Mohammed)
- fix off-by-one error (Mohammed)
--- tests/intel/kms_psr.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-)
tests/intel/kms_psr.c +27 -1
@@ -275,6 +275,8 @@* @plane-move: Move plane position */ +#define SUSPEND_OUTPUT_LIMIT 2 +enum operations {PAGE_FLIP ,MMAP_GTT ,
@@ -318,6 +320,7 @@ typedef struct {drmModeModeInfo *mode;igt_output_t *output;bool fbc_flag; +bool all_outputs; } data_t;static void create_cursor_fb (data_t *data)
@@ -767,9 +770,27 @@ static void dpms_off_on(data_t *data) DRM_MODE_DPMS_ON); } +static int opt_handler (int opt,int opt_index,void *opt_data) +{ +data_t *data = opt_data; + +switch (opt) { +case 'o' : + data->all_outputs = true; +break ; +default : +return IGT_OPT_HANDLER_ERROR ; + } + +return IGT_OPT_HANDLER_SUCCESS ; +} +data_t data = {}; -int igt_main () +const char *help_str = +" -o \tRun on all connectors. (By default suspend subtests will run on 2 connectors)\n" ; + +int igt_main_args("o", NULL, help_str, opt_handler, &data) {int z, y;enum operations op;
@@ -945,10 +966,15 @@ int igt_main() "performed with suspend resume cycles");igt_subtest_with_dynamic_f ("%s%ssuspend" , append_fbc_subtest[y], append_subtest_name[z]) { +int output_count =0 ; +for_each_connected_output (&data.display, output) {if (!psr_sink_support (data.drm_fd, data.debugfs_fd, data.op_psr_mode, output))continue ; +if (!data.all_outputs && output_count >=SUSPEND_OUTPUT_LIMIT ) +continue ; + output_count++;igt_display_reset (&data.display); data.output = output; igt_dynamic_f("%s", data.output->name) {
Signature · 1 line
2.45.2
PATCH v4 9/17 tests/kms_vblank: split outer test loop into two
In reply to Michał Grzelakfor_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.
--- tests/kms_vblank.c | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-)
tests/kms_vblank.c +22 -19
@@ -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); + } } } }
Signature · 1 line
2.45.2
PATCH v4 10/17 tests/kms_vblank: limit #outputs tested during suspend
In reply to Michał GrzelakWe are iterating through each output while testing suspend. This results in extended execution time. In turn this leads to hitting CI enforced timeout.
By default limit number of tested outputs to 2. Test each connected output when passing command-line parameter.
v3->v4
- reset output_count inside dynamic subtest (Mohammed)
- fix help string's description (Mohammed)
v1->v2
- fix off-by-one error (Mohammed)
- reset output_count before subtest (Mohammed)
--- tests/kms_vblank.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-)
tests/kms_vblank.c +19 -2
@@ -109,7 +109,10 @@ typedef struct {#define RPM 0x80 } data_t; +#define OUTPUT_LIMIT 2 +static bool all_pipes; +static bool all_outputs;static int active_crtcs[IGT_MAX_PIPES ];static uint32_t last_crtc_index;
@@ -476,6 +479,7 @@ static void vblank_ts_cont(data_t *data, int fd, int nchildren)static void run_subtests (data_t *data) {igt_crtc_t *crtc; +int output_count =0 ; const struct { const char *name; void (*func)(data_t *, int, int);
@@ -515,7 +519,14 @@ 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) { + output_count =0 ; +for_each_connected_output (&data->display, data->output) { +if (!all_outputs && (m->flags &SUSPEND ) && output_count >=OUTPUT_LIMIT ) { +igt_info ("Skipping output %s\n" , data->output->name); +continue ; + } +for_each_crtc (&data->display, crtc) {if (!igt_crtc_connector_valid (crtc, data->output))continue ;
@@ -538,6 +549,8 @@ static void run_subtests(data_t *data)run_test (data, f->func); } } + + output_count++; } }
@@ -628,6 +641,9 @@ static int opt_handler(int opt, int opt_index, void *data)case 'e' : all_pipes = true;break ; +case 'o' : + all_outputs = true; +break ;default :return IGT_OPT_HANDLER_ERROR ; }
@@ -636,9 +652,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" +" -o \tRun on all outputs. (By default subtests will run on two outputs)\n" ; -int igt_main_args("e", NULL, help_str, opt_handler, NULL) +int igt_main_args("eo", NULL, help_str, opt_handler, NULL) {igt_crtc_t *crtc;int fd;
Signature · 1 line
2.45.2
PATCH v4 11/17 tests/kms_sharpness_filter: fix typo
In reply to Michał GrzelakRefer to the connector instead of connecter.
--- tests/intel/kms_sharpness_filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/intel/kms_sharpness_filter.c +1 -1
@@ -456,7 +456,7 @@ static void test_sharpness_filter(data_t *data, enum test_type type)igt_plane_set_fb (data->plane[0 ], &data->fb[0 ]);if (type ==TEST_INVALID_FILTER_WITH_SCALING_MODE ) -igt_require_f (has_scaling_mode (output),"No connecter scaling mode found on %s\n" , output->name); +igt_require_f (has_scaling_mode (output),"No connector scaling mode found on %s\n" , output->name);if (type ==TEST_INVALID_FILTER_WITH_NEAREST_NEIGHBOR ) igt_require_f(igt_crtc_has_prop(data->crtc, IGT_CRTC_SCALING_FILTER),
Signature · 1 line
2.45.2
PATCH v4 12/17 tests/kms_sharpness_filter: limit #outputs tested during suspend
In reply to Michał GrzelakWe are iterating through each output while testing suspend. This results in extended execution time. In turn this leads to hitting CI enforced timeout.
By default limit number of tested outputs to 3. Test each connected output when passing command-line parameter.
v1->v2
- remove abbreviations (Jani)
--- tests/intel/kms_sharpness_filter.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
tests/intel/kms_sharpness_filter.c +16 -2
@@ -74,6 +74,8 @@ IGT_TEST_DESCRIPTION("Test to validate content adaptive sharpness filter");* is seen without corruption for each subtest. */ +#define OUTPUT_LIMIT 3 +#define TAP_3 3#define TAP_5 5#define TAP_7 7
@@ -231,6 +233,7 @@ static const struct subtest_entry { typedef struct { int drm_fd; bool limited; + bool all_outputs; struct igt_fb fb[4]; igt_crtc_t *crtc; igt_display_t display;
@@ -614,9 +617,16 @@ run_sharpness_filter_test(data_t *data, enum test_type type)igt_display_t *display = &data->display;igt_output_t *output;igt_crtc_t *crtc; +int output_counter =0 ;char name[40 ];for_each_connected_output (display, output) { +if (type ==TEST_FILTER_SUSPEND && !data->all_outputs && + output_counter >OUTPUT_LIMIT ) +continue ; + + output_counter++; +for_each_crtc (display, crtc) {igt_display_reset (display);
@@ -766,6 +776,9 @@ static int opt_handler(int opt, int opt_index, void *_data)case 'l' : data->limited = true;break ; +case 'o' : + data->all_outputs = true; +break ;default :return IGT_OPT_HANDLER_ERROR ; }
@@ -774,11 +787,12 @@ static int opt_handler(int opt, int opt_index, void *_data) }static const char help_str[] = -" --limited|-l\t\tLimit execution to 1 valid pipe-output combo\n" ; +" --limited|-l\t\tLimit execution to 1 valid pipe-output combo\n" +" --all-outputs|-o\t\tExtend suspend tests for all outputs\n" ;data_t data = {}; -int igt_main_args("l", NULL, help_str, opt_handler, &data) +int igt_main_args("lo", NULL, help_str, opt_handler, &data) { igt_fixture() { data.drm_fd =drm_open_driver_master (DRIVER_ANY );
Signature · 1 line
2.45.2
PATCH v4 13/17 tests/kms_sharpness_filter: limit #crtcs tested during suspend
In reply to Michał GrzelakWe are iterating through each crtc while testing suspend. This results in extended execution time. In turn this leads to hitting CI enforced timeout.
Limit number of tested crtcs to first and last. Test each crtc when passing commandline parameter.
v1->v2
- remove unused vars (Jani)
--- tests/intel/kms_sharpness_filter.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
tests/intel/kms_sharpness_filter.c +11 -2
@@ -233,6 +233,7 @@ static const struct subtest_entry { typedef struct { int drm_fd; bool limited; + bool all_crtcs; bool all_outputs; struct igt_fb fb[4]; igt_crtc_t *crtc;
@@ -635,6 +636,10 @@ run_sharpness_filter_test(data_t *data, enum test_type type)igt_output_set_crtc (data->output, data->crtc); +if (type ==TEST_FILTER_SUSPEND && !data->all_crtcs && crtc->crtc_index !=0 && + crtc->crtc_index != display->n_crtcs-1 ) +continue ; +/* * FIXME: Joiner + CASF currently unsupported. * Remove this check once support is implemented.
@@ -776,6 +781,9 @@ static int opt_handler(int opt, int opt_index, void *_data)case 'l' : data->limited = true;break ; +case 'c' : + data->all_crtcs = true; +break ;case 'o' : data->all_outputs = true;break ;
@@ -788,11 +796,12 @@ static int opt_handler(int opt, int opt_index, void *_data)static const char help_str[] =" --limited|-l\t\tLimit execution to 1 valid pipe-output combo\n" -" --all-outputs|-o\t\tExtend suspend tests for all outputs\n" ; +" --all-outputs|-o\t\tExtend suspend tests for all outputs\n" +" --all-crtcs|-c\t\tExtend suspend tests for all crtcs\n" ;data_t data = {}; -int igt_main_args("lo", NULL, help_str, opt_handler, &data) +int igt_main_args("loc", NULL, help_str, opt_handler, &data) { igt_fixture() { data.drm_fd =drm_open_driver_master (DRIVER_ANY );
Signature · 1 line
2.45.2
PATCH v4 14/17 tests/intel/kms_ccs: split outer test loop into two
In reply to Michał Grzelakfor_each_crtc_with_valid_output() iterates over every crtc with connected output. Split it into two loops. This is needed to handle per output and per crtc cases.
--- tests/intel/kms_ccs.c | 74 +++++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 35 deletions(-)
tests/intel/kms_ccs.c +39 -35
@@ -1152,47 +1152,51 @@ static void test_output(data_t *data, const int testnum) "Older than Xe2 platform needed.\n"); } -for_each_crtc_with_valid_output (&data->display, crtc, - data->output) { - data->crtc = crtc; -igt_display_reset (&data->display); - -igt_output_set_crtc (data->output, - crtc); -if (!intel_pipe_output_combo_valid (&data->display)) -continue ; - -igt_dynamic_f ("pipe-%s-%s" , -igt_crtc_name (crtc), - data->output->name) { -int valid_tests =0 ; - -if (data->flags ==TEST_RANDOM ) -igt_info ("Testing with seed %d\n" , data->seed); - -if (data->flags &TEST_ALL_PLANES ) { -igt_display_require_output_on_crtc (crtc); - -for_each_plane_on_crtc (crtc, - data->plane) { -if (skip_plane (data, data->plane)) -continue ; - +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; +igt_display_reset (&data->display); + +igt_output_set_crtc (data->output, + crtc); +if (!intel_pipe_output_combo_valid (&data->display)) +continue ; + +igt_dynamic_f ("pipe-%s-%s" , +igt_crtc_name (crtc), + data->output->name) { +int valid_tests =0 ; + +if (data->flags ==TEST_RANDOM ) +igt_info ("Testing with seed %d\n" , data->seed); + +if (data->flags &TEST_ALL_PLANES ) { +igt_display_require_output_on_crtc (crtc); + +for_each_plane_on_crtc (crtc, + data->plane) { +if (skip_plane (data, data->plane)) +continue ; + +for (int j =0 ; j <ARRAY_SIZE (formats); j++) { + data->format = formats[j]; + valid_tests +=test_ccs (data); + } + } + }else {for (int j =0 ; j <ARRAY_SIZE (formats); j++) { data->format = formats[j]; valid_tests +=test_ccs (data); } } - }else { -for (int j =0 ; j <ARRAY_SIZE (formats); j++) { - data->format = formats[j]; - valid_tests +=test_ccs (data); - } +igt_require_f (valid_tests >0 , +"no valid tests for %s on pipe %s\n" , + ccs_modifiers[i].str, +igt_crtc_name (crtc)); } -igt_require_f (valid_tests >0 , -"no valid tests for %s on pipe %s\n" , - ccs_modifiers[i].str, -igt_crtc_name (crtc)); } } }
Signature · 1 line
2.45.2
PATCH v4 15/17 tests/intel/kms_ccs: limit #outputs tested during suspend
In reply to Michał GrzelakEach suspend test is executed per output. Limit number of outputs tested to 3 by default. Add command-line option enabling execution on every output.
v3->v4
- reset output_count per each dynamic subtest (Mohammed)
- correct description from help string (Mohammed)
v1->v2
- fix off-by-one error
--- tests/intel/kms_ccs.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-)
tests/intel/kms_ccs.c +17 -1
@@ -141,6 +141,8 @@* @yf-tiled-ccs: YF tiled ccs */ +#define OUTPUT_LIMIT 3 +#define SDR_PLANE_BASE 3 IGT_TEST_DESCRIPTION("Test render compression (RC), in which the main surface "
@@ -188,6 +190,7 @@ typedef struct {enum igt_commit_style commit;int fb_list_length;bool do_hibernate; +bool all_outputs;struct {struct igt_fb fb;int width, height;
@@ -1128,6 +1131,7 @@ static void test_output(data_t *data, const int testnum) {igt_crtc_t *crtc;uint16_t dev_id; +int output_count =0 ;igt_fixture () dev_id = intel_get_drm_devid(data->drm_fd);
@@ -1152,7 +1156,15 @@ static void test_output(data_t *data, const int testnum) "Older than Xe2 platform needed.\n"); } + output_count =0 ; +for_each_connected_output (&data->display, data->output) { +if (!data->all_outputs && (data->flags &TEST_SUSPEND ) && + output_count >=OUTPUT_LIMIT ) +continue ; + + output_count++; +for_each_crtc (&data->display, crtc) {if (!igt_crtc_connector_valid (crtc, data->output))continue ;
@@ -1221,6 +1233,9 @@ static int opt_handler(int opt, int opt_index, void *opt_data)case 'r' : data->do_hibernate = true;break ; +case 'n' : + data->all_outputs = true; +break ;default :return IGT_OPT_HANDLER_ERROR ; }
@@ -1234,9 +1249,10 @@ static const char *help_str =" -c\t\tCheck the presence of compression meta-data\n" " -s <seed>\tSeed for random number generator\n" " -r\t\tOn suspend test do full hibernate with reboot\n" +" -n\t\tRun on all connectors. (By default suspend subtests will run on 3 connectors)\n" ; -int igt_main_args("csr:", NULL, help_str, opt_handler, &data) +int igt_main_args("csrn:", NULL, help_str, opt_handler, &data) { igt_fixture() { data.drm_fd =drm_open_driver_master (DRIVER_INTEL |DRIVER_XE );
Signature · 1 line
2.45.2
PATCH v4 16/17 tests/intel/kms_ccs: limit #crtcs tested during suspend
In reply to Michał GrzelakLimit execution of suspend tests to first and last active CRTC unless using extended flag. This reduces default execution time of the test. In turn this can lower chances of hitting CI timeout.
When first' and last' is set outside of dynamic subtest scope, it results in build failure caused by Meson receiving SIGSEGV:
FAILED: tests/kms_ccs.testlist /usr/bin/meson --internal exe --capture tests/kms_ccs.testlist -- [..]/tests/kms_ccs --show-testlist --- stderr --- Received signal SIGSEGV. ninja: build stopped: subcommand failed.
Thus set them inside dynamic subtest's scope.
v3->v4
- set first' and last' indices outside of crtc loop (Mohammed)
--- tests/intel/kms_ccs.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
tests/intel/kms_ccs.c +15 -1
@@ -191,6 +191,7 @@ typedef struct {int fb_list_length;bool do_hibernate;bool all_outputs; +bool all_crtcs;struct {struct igt_fb fb;int width, height;
@@ -1132,6 +1133,8 @@ static void test_output(data_t *data, const int testnum)igt_crtc_t *crtc;uint16_t dev_id;int output_count =0 ; +uint32_t first; +uint32_t last;igt_fixture () dev_id = intel_get_drm_devid(data->drm_fd);
@@ -1147,6 +1150,9 @@ static void test_output(data_t *data, const int testnum)igt_describe (tests[testnum].description); igt_subtest_with_dynamic_f("%s-%s", tests[testnum].testname, ccs_modifiers[i].str) { + first = data->display.crtcs[0 ].crtc_index; + last = data->display.crtcs[data->display.n_crtcs -1 ].crtc_index; +if (ccs_modifiers[i].modifier ==I915_FORMAT_MOD_4_TILED_BMG_CCS || ccs_modifiers[i].modifier ==I915_FORMAT_MOD_4_TILED_LNL_CCS ) { igt_require_f(intel_gen(dev_id) >= 20,
@@ -1177,6 +1183,10 @@ static void test_output(data_t *data, const int testnum)if (!intel_pipe_output_combo_valid (&data->display))continue ; +if (!data->all_crtcs && (data->flags &TEST_SUSPEND ) && + crtc->crtc_index != first && crtc->crtc_index != last) +continue ; +igt_dynamic_f ("pipe-%s-%s" ,igt_crtc_name (crtc), data->output->name) {
@@ -1236,6 +1246,9 @@ static int opt_handler(int opt, int opt_index, void *opt_data)case 'n' : data->all_outputs = true;break ; +case 'e' : + data->all_crtcs = true; +break ;default :return IGT_OPT_HANDLER_ERROR ; }
@@ -1250,9 +1263,10 @@ static const char *help_str =" -s <seed>\tSeed for random number generator\n" " -r\t\tOn suspend test do full hibernate with reboot\n" " -n\t\tRun on all connectors. (By default suspend subtests will run on 3 connectors)\n" +" -e\t\tRun on all CRTCs. (By default subtests will run on two CRTCs)\n" ; -int igt_main_args("csrn:", NULL, help_str, opt_handler, &data) +int igt_main_args("csrne:", NULL, help_str, opt_handler, &data) { igt_fixture() { data.drm_fd =drm_open_driver_master (DRIVER_INTEL |DRIVER_XE );
Signature · 1 line
2.45.2
PATCH v4 17/17 tests/kms_hdr: run on 3 outputs when testing suspend
In reply to Michał GrzelakEach suspend test is executed per output. Limit number of outputs tested to 3 by default. Add command-line option enabling execution on every output.
v3->v4
- declare `data' as static (Mohammed)
- add parenthesis around check (Mohammed)
v2->v3
- add patch
--- tests/kms_hdr.c | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-)
tests/kms_hdr.c +28 -2
@@ -74,6 +74,8 @@ IGT_TEST_DESCRIPTION("Test HDR metadata interfaces and bpc switch");#define BACKLIGHT_PATH "/sys/class/backlight" +#define OUTPUT_LIMIT 3 +/* HDR test formats: 10bpc + FP16 */ static const uint32_t hdr_test_formats[] = {DRM_FORMAT_XRGB2101010 ,
@@ -110,6 +112,7 @@ typedef struct data {int w;int h;igt_fb_t afb; +bool all_outputs; } data_t;/* Common test cleanup. */
@@ -250,6 +253,7 @@ static void test_bpc_switch(data_t *data, uint32_t flags) {igt_display_t *display = &data->display;igt_output_t *output; +int output_count =0 ;igt_display_reset (display);
@@ -273,6 +277,11 @@ static void test_bpc_switch(data_t *data, uint32_t flags)continue ; } +if (!data->all_outputs && (flags &TEST_SUSPEND ) && output_count >=OUTPUT_LIMIT ) +continue ; + + output_count++; +for_each_crtc (display, crtc) {igt_output_set_crtc (output, crtc);
@@ -674,10 +683,27 @@ static void test_hdr(data_t *data, uint32_t flags) } } -int igt_main () +static int opt_handler (int opt,int opt_index,void *opt_data) { -data_t data = {}; +data_t *data = opt_data; + +switch (opt) { +case 'o' : + data->all_outputs = true; +break ; +default : +return IGT_OPT_HANDLER_ERROR ; + } + +return IGT_OPT_HANDLER_SUCCESS ; +} +static const char help_str[] =" -o \tRun on all outputs instead of 3 when testing suspend.\n" ; + +static data_t data = {}; + +int igt_main_args("o", NULL, help_str, opt_handler, &data) +{ igt_fixture() { data.fd =drm_open_driver_master (DRIVER_ANY );
Signature · 1 line
2.45.2