From patchwork Tue Aug 8 16:16:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Stone X-Patchwork-Id: 9888723 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A587060363 for ; Tue, 8 Aug 2017 16:17:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97F9C28918 for ; Tue, 8 Aug 2017 16:17:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8CE7428932; Tue, 8 Aug 2017 16:17:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A296A289A9 for ; Tue, 8 Aug 2017 16:17:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B2B546E195; Tue, 8 Aug 2017 16:16:53 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) by gabe.freedesktop.org (Postfix) with ESMTPS id 927B46E19A for ; Tue, 8 Aug 2017 16:16:52 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: daniels) with ESMTPSA id 0864F26C776 From: Daniel Stone To: intel-gfx@lists.freedesktop.org Date: Tue, 8 Aug 2017 17:16:44 +0100 Message-Id: <20170808161645.25329-7-daniels@collabora.com> X-Mailer: git-send-email 2.13.4 In-Reply-To: <20170808161645.25329-1-daniels@collabora.com> References: <20170808161645.25329-1-daniels@collabora.com> Cc: daniel.vetter@ffwll.ch Subject: [Intel-gfx] [PATCH i-g-t 7/8] tests/kms_ccs: Split all tests into subtests X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP 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 --- tests/kms_ccs.c | 62 +++++++++++++++++++-------------------------------------- 1 file changed, 20 insertions(+), 42 deletions(-) diff --git a/tests/kms_ccs.c b/tests/kms_ccs.c index e74a68af..79856f97 100644 --- a/tests/kms_ccs.c +++ b/tests/kms_ccs.c @@ -369,6 +369,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) { @@ -404,31 +411,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 @@ -443,28 +425,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