From patchwork Wed Feb 1 14:12:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kahola X-Patchwork-Id: 9549787 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 ECFAD60415 for ; Wed, 1 Feb 2017 14:16:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE8AE28440 for ; Wed, 1 Feb 2017 14:16:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D304C28464; Wed, 1 Feb 2017 14:16:04 +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 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 543D128440 for ; Wed, 1 Feb 2017 14:16:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CA52E6E7E7; Wed, 1 Feb 2017 14:16:02 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id E4F526E7E7 for ; Wed, 1 Feb 2017 14:16:00 +0000 (UTC) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP; 01 Feb 2017 06:16:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.33,320,1477983600"; d="scan'208"; a="1101631395" Received: from sorvi.fi.intel.com ([10.237.72.109]) by fmsmga001.fm.intel.com with ESMTP; 01 Feb 2017 06:15:59 -0800 From: Mika Kahola To: intel-gfx@lists.freedesktop.org Date: Wed, 1 Feb 2017 16:12:42 +0200 Message-Id: <1485958362-20409-1-git-send-email-mika.kahola@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [Intel-gfx] [PATCH] tests/kms_plane_multiple: Test only with maximum number of planes 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 To be more suitable for BAT testing, let's modify the test such a way that it only uses the maximum number of available planes. This reduces the total number of subtests. Cc: Robert Foss Signed-off-by: Mika Kahola --- tests/kms_plane_multiple.c | 91 +++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 54 deletions(-) diff --git a/tests/kms_plane_multiple.c b/tests/kms_plane_multiple.c index bb84878..48f870e 100644 --- a/tests/kms_plane_multiple.c +++ b/tests/kms_plane_multiple.c @@ -171,7 +171,7 @@ create_fb_for_mode_position(data_t *data, igt_output_t *output, drmModeModeInfo mode->hdisplay, mode->vdisplay, color->red, color->green, color->blue); - for (int i = 0; i <= max_planes; i++) { + for (int i = 0; i < max_planes; i++) { if (data->plane[i]->type == DRM_PLANE_TYPE_PRIMARY) continue; igt_paint_color(cr, rect_x[i], rect_y[i], @@ -211,7 +211,7 @@ prepare_planes(data_t *data, enum pipe pipe_id, color_t *color, /* planes with random positions */ x[primary->index] = 0; y[primary->index] = 0; - for (i = 1; i <= max_planes; i++) { + for (i = 0; i < max_planes; i++) { igt_plane_t *plane = igt_output_get_plane(output, i); if (plane->type == DRM_PLANE_TYPE_PRIMARY) @@ -247,7 +247,7 @@ prepare_planes(data_t *data, enum pipe pipe_id, color_t *color, static void test_atomic_plane_position_with_output(data_t *data, enum pipe pipe, igt_output_t *output, int n_planes, - int max_planes, uint64_t tiling) + uint64_t tiling) { char buf[256]; struct drm_event *e = (void *)buf; @@ -270,7 +270,7 @@ test_atomic_plane_position_with_output(data_t *data, enum pipe pipe, } igt_info("Testing connector %s using pipe %s with %d planes %s with seed %d\n", - igt_output_name(output), kmstest_pipe_name(pipe), max_planes, + igt_output_name(output), kmstest_pipe_name(pipe), n_planes, info, opt.seed); test_init(data, pipe, n_planes); @@ -280,7 +280,7 @@ test_atomic_plane_position_with_output(data_t *data, enum pipe pipe, i = 0; while (i < iterations || loop_forever) { - prepare_planes(data, pipe, &blue, tiling, max_planes, output); + prepare_planes(data, pipe, &blue, tiling, n_planes, output); vblank_start = kmstest_get_vblank(data->display.drm_fd, pipe, DRM_VBLANK_NEXTONMISS); @@ -316,7 +316,7 @@ test_atomic_plane_position_with_output(data_t *data, enum pipe pipe, static void test_legacy_plane_position_with_output(data_t *data, enum pipe pipe, igt_output_t *output, int n_planes, - int max_planes, uint64_t tiling) + uint64_t tiling) { test_position_t test = { .data = data }; color_t blue = { 0.0f, 0.0f, 1.0f }; @@ -336,7 +336,7 @@ test_legacy_plane_position_with_output(data_t *data, enum pipe pipe, } igt_info("Testing connector %s using pipe %s with %d planes %s with seed %d\n", - igt_output_name(output), kmstest_pipe_name(pipe), max_planes, + igt_output_name(output), kmstest_pipe_name(pipe), n_planes, info, opt.seed); test_init(data, pipe, n_planes); @@ -346,7 +346,7 @@ test_legacy_plane_position_with_output(data_t *data, enum pipe pipe, i = 0; while (i < iterations || loop_forever) { - prepare_planes(data, pipe, &blue, tiling, max_planes, output); + prepare_planes(data, pipe, &blue, tiling, n_planes, output); igt_display_commit2(&data->display, COMMIT_LEGACY); @@ -366,7 +366,7 @@ test_legacy_plane_position_with_output(data_t *data, enum pipe pipe, static void test_plane_position(data_t *data, enum pipe pipe, bool atomic, int n_planes, - int max_planes, uint64_t tiling) + uint64_t tiling) { igt_output_t *output; int connected_outs; @@ -376,7 +376,6 @@ test_plane_position(data_t *data, enum pipe pipe, bool atomic, int n_planes, igt_require(data->display.is_atomic); igt_skip_on(pipe >= data->display.n_pipes); - igt_skip_on(max_planes >= data->display.pipes[pipe].n_planes); if ((tiling == LOCAL_I915_FORMAT_MOD_Y_TILED || tiling == LOCAL_I915_FORMAT_MOD_Yf_TILED)) @@ -392,14 +391,12 @@ test_plane_position(data_t *data, enum pipe pipe, bool atomic, int n_planes, if (atomic) test_atomic_plane_position_with_output(data, pipe, output, - n_planes, - max_planes, + n_planes, tiling); else test_legacy_plane_position_with_output(data, pipe, output, - n_planes, - max_planes, + n_planes, tiling); connected_outs++; @@ -412,68 +409,54 @@ test_plane_position(data_t *data, enum pipe pipe, bool atomic, int n_planes, static void run_tests_for_pipe_plane(data_t *data, enum pipe pipe) { - igt_subtest_f("legacy-pipe-%s-tiling-none-planes", + int n_planes = data->display.pipes[pipe].n_planes; + + igt_subtest_f("legacy-pipe-%s-tiling-none", kmstest_pipe_name(pipe)) { - int n_planes = data->display.pipes[pipe].n_planes; - for (int planes = 0; planes < n_planes; planes++) - test_plane_position(data, pipe, false, n_planes, - planes, LOCAL_DRM_FORMAT_MOD_NONE); + test_plane_position(data, pipe, false, n_planes, + LOCAL_DRM_FORMAT_MOD_NONE); } - igt_subtest_f("atomic-pipe-%s-tiling-none-planes", + igt_subtest_f("atomic-pipe-%s-tiling-none", kmstest_pipe_name(pipe)) { - int n_planes = data->display.pipes[pipe].n_planes; - for (int planes = 0; planes < n_planes; planes++) - test_plane_position(data, pipe, true, n_planes, - planes, LOCAL_I915_FORMAT_MOD_X_TILED); + test_plane_position(data, pipe, true, n_planes, + LOCAL_I915_FORMAT_MOD_X_TILED); } - igt_subtest_f("legacy-pipe-%s-tiling-x-planes", + igt_subtest_f("legacy-pipe-%s-tiling-x", kmstest_pipe_name(pipe)) { - int n_planes = data->display.pipes[pipe].n_planes; - for (int planes = 0; planes < n_planes; planes++) - test_plane_position(data, pipe, false, n_planes, - planes, LOCAL_I915_FORMAT_MOD_X_TILED); + test_plane_position(data, pipe, false, n_planes, + LOCAL_I915_FORMAT_MOD_X_TILED); } - igt_subtest_f("atomic-pipe-%s-tiling-x-planes", + igt_subtest_f("atomic-pipe-%s-tiling-x", kmstest_pipe_name(pipe)) { - int n_planes = data->display.pipes[pipe].n_planes; - for (int planes = 0; planes < n_planes; planes++) - test_plane_position(data, pipe, true, n_planes, - planes, LOCAL_I915_FORMAT_MOD_X_TILED); + test_plane_position(data, pipe, true, n_planes, + LOCAL_I915_FORMAT_MOD_X_TILED); } - igt_subtest_f("legacy-pipe-%s-tiling-y-planes", + igt_subtest_f("legacy-pipe-%s-tiling-y", kmstest_pipe_name(pipe)) { - int n_planes = data->display.pipes[pipe].n_planes; - for (int planes = 0; planes < n_planes; planes++) - test_plane_position(data, pipe, false, n_planes, - planes, LOCAL_I915_FORMAT_MOD_Y_TILED); + test_plane_position(data, pipe, false, n_planes, + LOCAL_I915_FORMAT_MOD_Y_TILED); } - igt_subtest_f("atomic-pipe-%s-tiling-y-planes", + igt_subtest_f("atomic-pipe-%s-tiling-y", kmstest_pipe_name(pipe)) { - int n_planes = data->display.pipes[pipe].n_planes; - for (int planes = 0; planes < n_planes; planes++) - test_plane_position(data, pipe, true, n_planes, - planes, LOCAL_I915_FORMAT_MOD_Y_TILED); + test_plane_position(data, pipe, true, n_planes, + LOCAL_I915_FORMAT_MOD_Y_TILED); } - igt_subtest_f("legacy-pipe-%s-tiling-yf-planes", + igt_subtest_f("legacy-pipe-%s-tiling-yf", kmstest_pipe_name(pipe)) { - int n_planes = data->display.pipes[pipe].n_planes; - for (int planes = 0; planes < n_planes; planes++) - test_plane_position(data, pipe, false, n_planes, - planes, LOCAL_I915_FORMAT_MOD_Yf_TILED); + test_plane_position(data, pipe, false, n_planes, + LOCAL_I915_FORMAT_MOD_Yf_TILED); } - igt_subtest_f("atomic-pipe-%s-tiling-yf-planes", + igt_subtest_f("atomic-pipe-%s-tiling-yf", kmstest_pipe_name(pipe)) { - int n_planes = data->display.pipes[pipe].n_planes; - for (int planes = 0; planes < n_planes; planes++) - test_plane_position(data, pipe, true, n_planes, - planes, LOCAL_I915_FORMAT_MOD_Yf_TILED); + test_plane_position(data, pipe, true, n_planes, + LOCAL_I915_FORMAT_MOD_Yf_TILED); } }