From 4e9524d2b8edee8e15ceb93ec14190232d66fce3 Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Thu, 5 Jan 2017 15:23:06 +0100 Subject: kms_ccs: Fix testcase. Use for_each_pipe_with_valid_output, and iterate correctly over all crtc's. pipe-*-crc-* didn't show up in the test list either because display is not initialized, fix that one too. Signed-off-by: Maarten Lankhorst --- tests/kms_ccs.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'tests/kms_ccs.c') diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c index 7e7255c3..047a3e87 100644 --- a/tests/kms_ccs.c +++ b/tests/kms_ccs.c @@ -202,7 +202,7 @@ static void display_fb(data_t *data, int compressed) #define TEST_UNCOMPRESSED 0 #define TEST_COMPRESSED 1 -static bool test_output(data_t *data) +static void test_output(data_t *data) { igt_display_t *display = &data->display; igt_plane_t *primary; @@ -234,24 +234,28 @@ static bool test_output(data_t *data) primary = igt_output_get_plane(data->output, IGT_PLANE_PRIMARY); igt_plane_set_fb(primary, NULL); igt_plane_set_rotation(primary, IGT_ROTATION_0); + if (!display->is_atomic) + igt_display_commit2(display, COMMIT_UNIVERSAL); + igt_output_set_pipe(data->output, PIPE_ANY); - igt_display_commit2(display, COMMIT_UNIVERSAL); + igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY); if (data->flags & TEST_CRC) igt_remove_fb(data->drm_fd, &data->fb); - - return true; } static void test(data_t *data) { igt_display_t *display = &data->display; int valid_tests = 0; + enum pipe wanted_pipe = data->pipe; - for_each_connected_output(display, data->output) { - if (!test_output(data)) + for_each_pipe_with_valid_output(display, data->pipe, data->output) { + if (wanted_pipe != PIPE_NONE && data->pipe != wanted_pipe) continue; + test_output(data); + valid_tests++; igt_info("\n%s on pipe %s, connector %s: PASSED\n\n", @@ -279,23 +283,23 @@ igt_main igt_subtest_f("bad-pixel-format") { data.flags = TEST_BAD_PIXEL_FORMAT; - data.pipe = PIPE_A; + data.pipe = PIPE_NONE; test(&data); } igt_subtest_f("bad-rotation-90") { data.flags = TEST_BAD_ROTATION_90; - data.pipe = PIPE_A; + data.pipe = PIPE_NONE; test(&data); } - for_each_pipe(&data.display, data.pipe) { + for (data.pipe = PIPE_A; data.pipe < I915_MAX_PIPES; data.pipe++) { data.flags = TEST_CRC; igt_subtest_f("pipe-%s-crc-basic", kmstest_pipe_name(data.pipe)) test(&data); } - for_each_pipe(&data.display, data.pipe) { + for (data.pipe = PIPE_A; data.pipe < I915_MAX_PIPES; data.pipe++) { data.flags = TEST_CRC | TEST_ROTATE_180; igt_subtest_f("pipe-%s-crc-rotation-180", kmstest_pipe_name(data.pipe)) test(&data); -- cgit v1.2.3