From patchwork Wed Aug 5 13:23:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 6949051 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 56656C05AC for ; Wed, 5 Aug 2015 13:23:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7471B2035E for ; Wed, 5 Aug 2015 13:23:17 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 83C22202DD for ; Wed, 5 Aug 2015 13:23:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C2A926E026; Wed, 5 Aug 2015 06:23:15 -0700 (PDT) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id D05AC6E026 for ; Wed, 5 Aug 2015 06:23:14 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga103.fm.intel.com with ESMTP; 05 Aug 2015 06:23:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,617,1432623600"; d="scan'208";a="536457601" Received: from tursulin-linux.isw.intel.com ([10.102.226.59]) by FMSMGA003.fm.intel.com with ESMTP; 05 Aug 2015 06:23:15 -0700 From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org Date: Wed, 5 Aug 2015 14:23:09 +0100 Message-Id: <1438780989-4067-1-git-send-email-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.4.6 Subject: [Intel-gfx] [PATCH i-g-t] kms_rotation_crc: Test 90 and 270 degree rotation in sequence 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-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00,HK_RANDOM_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Tvrtko Ursulin Sounds like a useful thing to test going straight from 90 to 270 degrees, without resetting to no rotation in between. Signed-off-by: Tvrtko Ursulin --- tests/kms_rotation_crc.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c index 3fd77c42b803..5e32eb6911b2 100644 --- a/tests/kms_rotation_crc.c +++ b/tests/kms_rotation_crc.c @@ -36,8 +36,10 @@ typedef struct { struct igt_fb fb; struct igt_fb fb_modeset; igt_crc_t ref_crc; + igt_crc_t ref_crc2; igt_pipe_crc_t *pipe_crc; igt_rotation_t rotation; + igt_rotation_t rotation2; int pos_x; int pos_y; unsigned int w, h; @@ -174,6 +176,12 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe, commit_crtc(data, output, plane); igt_pipe_crc_collect_crc(data->pipe_crc, &data->ref_crc); + if (data->rotation2 != IGT_ROTATION_0) { + paint_squares(data, mode, data->rotation2, plane); + commit_crtc(data, output, plane); + igt_pipe_crc_collect_crc(data->pipe_crc, &data->ref_crc2); + } + /* * Step 2: prepare the plane with an non-rotated fb let the hw * rotate it. @@ -249,6 +257,21 @@ static void test_plane_rotation(data_t *data, enum igt_plane plane_type) &crc_output); } + if (data->rotation2 != IGT_ROTATION_0) { + igt_plane_set_rotation(plane, data->rotation2); + ret = igt_display_try_commit2(display, commit); + if (data->override_fmt || + data->override_tiling) { + igt_assert(ret == -EINVAL); + } else { + igt_assert(ret == 0); + igt_pipe_crc_collect_crc(data->pipe_crc, + &crc_output); + igt_assert_crc_equal(&data->ref_crc2, + &crc_output); + } + } + /* * check the rotation state has been reset when the VT * mode is restored @@ -284,7 +307,10 @@ igt_main igt_require_pipe_crc(); igt_display_init(&data.display, data.gfx_fd); + + data.rotation2 = IGT_ROTATION_0; } + igt_subtest_f("primary-rotation-180") { data.rotation = IGT_ROTATION_180; test_plane_rotation(&data, IGT_PLANE_PRIMARY); @@ -312,9 +338,17 @@ igt_main test_plane_rotation(&data, IGT_PLANE_PRIMARY); } + igt_subtest_f("primary-rotation-90-270") { + igt_require(gen >= 9); + data.rotation = IGT_ROTATION_90; + data.rotation2 = IGT_ROTATION_270; + test_plane_rotation(&data, IGT_PLANE_PRIMARY); + } + igt_subtest_f("sprite-rotation-90") { igt_require(gen >= 9); data.rotation = IGT_ROTATION_90; + data.rotation2 = IGT_ROTATION_0; test_plane_rotation(&data, IGT_PLANE_2); } @@ -324,9 +358,17 @@ igt_main test_plane_rotation(&data, IGT_PLANE_2); } + igt_subtest_f("sprite-rotation-90-270") { + igt_require(gen >= 9); + data.rotation = IGT_ROTATION_90; + data.rotation2 = IGT_ROTATION_270; + test_plane_rotation(&data, IGT_PLANE_2); + } + igt_subtest_f("sprite-rotation-90-pos-100-0") { igt_require(gen >= 9); data.rotation = IGT_ROTATION_90; + data.rotation2 = IGT_ROTATION_0; data.pos_x = 100, data.pos_y = 0; test_plane_rotation(&data, IGT_PLANE_2);