diff options
author | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2017-01-05 15:23:06 +0100 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2017-01-05 15:25:15 +0100 |
commit | 4e9524d2b8edee8e15ceb93ec14190232d66fce3 (patch) | |
tree | 21da768eebe0d1940a9aa013cc388316d86c463c /tests/kms_ccs.c | |
parent | 20258f2353a266f8fe19e7392eb282e58dd87f6a (diff) |
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 <maarten.lankhorst@linux.intel.com>
Diffstat (limited to 'tests/kms_ccs.c')
-rw-r--r-- | tests/kms_ccs.c | 24 |
1 files changed, 14 insertions, 10 deletions
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); |