summaryrefslogtreecommitdiff
path: root/tests/kms_ccs.c
diff options
context:
space:
mode:
authorDaniel Stone <daniels@collabora.com>2017-08-08 12:39:36 +0100
committerDaniel Stone <daniels@collabora.com>2017-08-10 10:47:27 +0100
commit5c6ff1facb85fcef84ebbce1f9d9cb245041e729 (patch)
tree709c299bbbe65c78c7bc4cfeee528a41bf2758cd /tests/kms_ccs.c
parent7ffe63c4d4c2c8b1204145cf32f2eb7e13fcff25 (diff)
tests/kms_ccs: Split all tests into subtests
Some subtests were magically doing a for-each-pipe loop. Remove that, and have all multi-pipe tests actually work across all pipes. Signed-off-by: Daniel Stone <daniels@collabora.com> Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Diffstat (limited to 'tests/kms_ccs.c')
-rw-r--r--tests/kms_ccs.c62
1 files changed, 20 insertions, 42 deletions
diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c
index a8f40bb4..c9ab5068 100644
--- a/tests/kms_ccs.c
+++ b/tests/kms_ccs.c
@@ -373,6 +373,13 @@ static void test_output(data_t *data)
igt_pipe_crc_t *pipe_crc;
enum test_fb_flags fb_flags = 0;
+ igt_display_require_output_on_pipe(display, data->pipe);
+
+ /* Sets data->output with a valid output. */
+ for_each_valid_output_on_pipe(display, data->pipe, data->output) {
+ break;
+ }
+
igt_output_set_pipe(data->output, data->pipe);
if (data->flags & TEST_CRC) {
@@ -408,31 +415,6 @@ static void test_output(data_t *data)
igt_remove_fb(data->drm_fd, &data->fb);
}
-static void test(data_t *data)
-{
- igt_display_t *display = &data->display;
- int valid_tests = 0;
- enum pipe wanted_pipe = data->pipe;
-
- igt_skip_on(wanted_pipe >= display->n_pipes);
-
- 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",
- igt_subtest_name(),
- kmstest_pipe_name(data->pipe),
- igt_output_name(data->output));
- }
-
- igt_require_f(valid_tests, "no valid crtc/connector combinations found\n");
-}
-
static data_t data;
igt_main
@@ -447,28 +429,24 @@ igt_main
igt_display_init(&data.display, data.drm_fd);
}
- igt_subtest_f("bad-pixel-format") {
+ for_each_pipe(&data.display, data.pipe) {
+ const char *pipe_name = kmstest_pipe_name(data.pipe);
+
data.flags = TEST_BAD_PIXEL_FORMAT;
- data.pipe = PIPE_NONE;
- test(&data);
- }
+ igt_subtest_f("pipe-%s-bad-pixel-format", pipe_name)
+ test_output(&data);
- igt_subtest_f("bad-rotation-90") {
data.flags = TEST_BAD_ROTATION_90;
- data.pipe = PIPE_NONE;
- test(&data);
- }
+ igt_subtest_f("pipe-%s-bad-rotation-90", pipe_name)
+ test_output(&data);
- for (data.pipe = PIPE_A; data.pipe < IGT_MAX_PIPES; data.pipe++) {
data.flags = TEST_CRC;
- igt_subtest_f("pipe-%s-crc-primary-basic",
- kmstest_pipe_name(data.pipe))
- test(&data);
-
- data.flags |= TEST_ROTATE_180;
- igt_subtest_f("pipe-%s-crc-primary-rotation-180",
- kmstest_pipe_name(data.pipe))
- test(&data);
+ igt_subtest_f("pipe-%s-crc-primary-basic", pipe_name)
+ test_output(&data);
+
+ data.flags = TEST_CRC | TEST_ROTATE_180;
+ igt_subtest_f("pipe-%s-crc-primary-rotation-180", pipe_name)
+ test_output(&data);
}
igt_fixture