diff options
author | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2018-02-21 11:35:00 +0100 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2018-03-19 16:01:17 +0100 |
commit | 45b5f49c6af589962e71cdb626173706aebdf06a (patch) | |
tree | 9cad003164cf6beeb214d30f89fd10f4058a2585 /tests | |
parent | a684c16caecbbdcd335f24b7eb56686c71cba883 (diff) |
tests/kms_chv_cursor_fail: Reorder tests, and use igt_display_require_output_on_pipe.
This test is purely about the pipe fifo underrun, so not all outputs
need to be tested. Reorder the tests to run per pipe first, this will
save a modeset for all different sizes when the tests are run per-binary,
and another modeset on each subtest when more than 1 output is connected.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/kms_chv_cursor_fail.c | 85 |
1 files changed, 34 insertions, 51 deletions
diff --git a/tests/kms_chv_cursor_fail.c b/tests/kms_chv_cursor_fail.c index ffbe39d0..0dd366c3 100644 --- a/tests/kms_chv_cursor_fail.c +++ b/tests/kms_chv_cursor_fail.c @@ -246,7 +246,7 @@ static void prepare_crtc(data_t *data) primary = igt_output_get_plane_type(data->output, DRM_PLANE_TYPE_PRIMARY); igt_plane_set_fb(primary, &data->primary_fb); - igt_display_commit(display); + igt_display_commit2(display, display->is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY); data->jump_x = (mode->hdisplay - data->curw) / 2; data->jump_y = (mode->vdisplay - data->curh) / 2; @@ -262,34 +262,15 @@ static void prepare_crtc(data_t *data) static void test_crtc(data_t *data, unsigned int edges) { - igt_display_t *display = &data->display; - int valid_tests = 0; - cleanup_crtc(data); create_cursor_fb(data, data->curw, data->curh); - for_each_valid_output_on_pipe(display, data->pipe, data->output) { - prepare_crtc(data); - - valid_tests++; - - igt_info("Beginning %s on pipe %s, connector %s\n", - igt_subtest_name(), - kmstest_pipe_name(data->pipe), - igt_output_name(data->output)); + prepare_crtc(data); - test_edges(data, edges); - - 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)); - } + test_edges(data, edges); igt_remove_fb(data->drm_fd, &data->fb); - - igt_require_f(valid_tests, "no valid crtc/connector combinations found\n"); } static int opt_handler(int opt, int opt_index, void *_data) @@ -354,36 +335,38 @@ int main(int argc, char **argv) igt_display_init(&data.display, data.drm_fd); } - for (data.curw = 64; data.curw <= 256; data.curw *= 2) { - data.curh = data.curw; - for (data.pipe = PIPE_A; data.pipe <= PIPE_C; data.pipe++) { - igt_subtest_f("pipe-%s-%dx%d-left-edge", - kmstest_pipe_name(data.pipe), - data.curw, data.curh) { - igt_require(data.pipe < data.display.n_pipes); - igt_require(data.curw <= max_curw && data.curh <= max_curh); - test_crtc(&data, EDGE_LEFT); - } - igt_subtest_f("pipe-%s-%dx%d-right-edge", - kmstest_pipe_name(data.pipe), - data.curw, data.curh) { - igt_require(data.pipe < data.display.n_pipes); - igt_require(data.curw <= max_curw && data.curh <= max_curh); - test_crtc(&data, EDGE_RIGHT); + for_each_pipe_static(data.pipe) { + igt_subtest_group { + igt_fixture { + igt_display_require_output_on_pipe(&data.display, data.pipe); + data.output = igt_get_single_output_for_pipe(&data.display, data.pipe); } - igt_subtest_f("pipe-%s-%dx%d-top-edge", - kmstest_pipe_name(data.pipe), - data.curw, data.curh) { - igt_require(data.pipe < data.display.n_pipes); - igt_require(data.curw <= max_curw && data.curh <= max_curh); - test_crtc(&data, EDGE_TOP); - } - igt_subtest_f("pipe-%s-%dx%d-bottom-edge", - kmstest_pipe_name(data.pipe), - data.curw, data.curh) { - igt_require(data.pipe < data.display.n_pipes); - igt_require(data.curw <= max_curw && data.curh <= max_curh); - test_crtc(&data, EDGE_BOTTOM); + + for (data.curw = 64; data.curw <= 256; data.curw *= 2) { + data.curh = data.curw; + + igt_fixture + igt_require(data.curw <= max_curw && data.curh <= max_curh); + + igt_subtest_f("pipe-%s-%dx%d-left-edge", + kmstest_pipe_name(data.pipe), + data.curw, data.curh) + test_crtc(&data, EDGE_LEFT); + + igt_subtest_f("pipe-%s-%dx%d-right-edge", + kmstest_pipe_name(data.pipe), + data.curw, data.curh) + test_crtc(&data, EDGE_RIGHT); + + igt_subtest_f("pipe-%s-%dx%d-top-edge", + kmstest_pipe_name(data.pipe), + data.curw, data.curh) + test_crtc(&data, EDGE_TOP); + + igt_subtest_f("pipe-%s-%dx%d-bottom-edge", + kmstest_pipe_name(data.pipe), + data.curw, data.curh) + test_crtc(&data, EDGE_BOTTOM); } } } |