diff options
author | Arkadiusz Hiler <arkadiusz.hiler@intel.com> | 2019-03-15 14:53:33 +0200 |
---|---|---|
committer | Petri Latvala <petri.latvala@intel.com> | 2019-03-19 11:34:58 +0200 |
commit | d38957ffb07b48e8db523fd31896df1efba22deb (patch) | |
tree | a4e4c8f293e48bf7de83d94c197e2b6aee0063b6 /tests/kms_plane.c | |
parent | 356b9409f0ec25e6e2fa65ef3040b902a3e5204a (diff) |
tests/kms_plane: Use just one valid output
Since those are just pipe CRC tests output does not really matter.
Instead of running the test number-of-connected-outputs times per pipe,
let's run them just once.
Cc: Martin Peres <martin.peres@free.fr>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Diffstat (limited to 'tests/kms_plane.c')
-rw-r--r-- | tests/kms_plane.c | 78 |
1 files changed, 32 insertions, 46 deletions
diff --git a/tests/kms_plane.c b/tests/kms_plane.c index 82d4d1d0..d8a14ecb 100644 --- a/tests/kms_plane.c +++ b/tests/kms_plane.c @@ -219,28 +219,23 @@ test_plane_position_with_output(data_t *data, static void test_plane_position(data_t *data, enum pipe pipe, unsigned int flags) { + int n_planes = data->display.pipes[pipe].n_planes; igt_output_t *output; - int connected_outs = 0; - - for_each_valid_output_on_pipe(&data->display, pipe, output) { - int n_planes = data->display.pipes[pipe].n_planes; - igt_crc_t reference_crc; - - test_init(data, pipe); + igt_crc_t reference_crc; - test_grab_crc(data, output, pipe, &green, &reference_crc); + output = igt_get_single_output_for_pipe(&data->display, pipe); + igt_require(output); - for (int plane = 1; plane < n_planes; plane++) - test_plane_position_with_output(data, pipe, plane, - output, &reference_crc, - flags); + test_init(data, pipe); - test_fini(data); + test_grab_crc(data, output, pipe, &green, &reference_crc); - connected_outs++; - } + for (int plane = 1; plane < n_planes; plane++) + test_plane_position_with_output(data, pipe, plane, + output, &reference_crc, + flags); - igt_skip_on(connected_outs == 0); + test_fini(data); } /* @@ -340,31 +335,24 @@ test_plane_panning_with_output(data_t *data, static void test_plane_panning(data_t *data, enum pipe pipe, unsigned int flags) { + int n_planes = data->display.pipes[pipe].n_planes; igt_output_t *output; - int connected_outs = 0; - - for_each_valid_output_on_pipe(&data->display, pipe, output) { - int n_planes = data->display.pipes[pipe].n_planes; - igt_crc_t red_crc; - igt_crc_t blue_crc; - - test_init(data, pipe); + igt_crc_t red_crc; + igt_crc_t blue_crc; - test_grab_crc(data, output, pipe, &red, &red_crc); - test_grab_crc(data, output, pipe, &blue, &blue_crc); + output = igt_get_single_output_for_pipe(&data->display, pipe); + igt_require(output); - for (int plane = 1; plane < n_planes; plane++) - test_plane_panning_with_output(data, pipe, plane, - output, - &red_crc, &blue_crc, - flags); + test_init(data, pipe); - test_fini(data); + test_grab_crc(data, output, pipe, &red, &red_crc); + test_grab_crc(data, output, pipe, &blue, &blue_crc); - connected_outs++; - } + for (int plane = 1; plane < n_planes; plane++) + test_plane_panning_with_output(data, pipe, plane, output, + &red_crc, &blue_crc, flags); - igt_skip_on(connected_outs == 0); + test_fini(data); } static const color_t colors[] = { @@ -601,22 +589,20 @@ static bool test_format_plane(data_t *data, enum pipe pipe, static void test_pixel_formats(data_t *data, enum pipe pipe) { + bool result; igt_output_t *output; + igt_plane_t *plane; - igt_display_require_output_on_pipe(&data->display, pipe); - - for_each_valid_output_on_pipe(&data->display, pipe, output) { - bool result = true; - igt_plane_t *plane; + output = igt_get_single_output_for_pipe(&data->display, pipe); + igt_require(output); - for_each_plane_on_pipe(&data->display, pipe, plane) - result &= test_format_plane(data, pipe, output, plane); + result = true; + for_each_plane_on_pipe(&data->display, pipe, plane) + result &= test_format_plane(data, pipe, output, plane); - igt_assert_f(result, "At least one CRC mismatch happened\n"); + igt_assert_f(result, "At least one CRC mismatch happened\n"); - - igt_output_set_pipe(output, PIPE_ANY); - } + igt_output_set_pipe(output, PIPE_ANY); } static void |