From patchwork Thu Aug 14 15:40:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Wood X-Patchwork-Id: 4724571 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C5ED2C0338 for ; Thu, 14 Aug 2014 15:40:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1AD9220160 for ; Thu, 14 Aug 2014 15:40:49 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1B4FA20108 for ; Thu, 14 Aug 2014 15:40:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A192A6E6D6; Thu, 14 Aug 2014 08:40:47 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-we0-f172.google.com (mail-we0-f172.google.com [74.125.82.172]) by gabe.freedesktop.org (Postfix) with ESMTP id 863A36E6D6 for ; Thu, 14 Aug 2014 08:40:44 -0700 (PDT) Received: by mail-we0-f172.google.com with SMTP id x48so1283448wes.3 for ; Thu, 14 Aug 2014 08:40:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=8f75R7AiAoA+lJozGpOg2ZckiW+4I1hQZvWfsYk9HgY=; b=X5Y8AznNseYUuGQy6J7LICLsDaqpcCf+t1EcWfccjRbyfGSyOuTm7raVBRYklYQ9gO CwIlEcCf8Pq2E5Q2zdEYDG7diVCzTjj/vTGfn4MuHZ00HWht8wevWFEVXnw0VZ54TB/m PAI6H0I6HKPsYonUZoq1IzeJpysMf+GVdEjWUl7z+EH+xGAaZrgZpafJRgmHNM4s8p9C shoJ9ijBLEjMm3EM4Dd1XCB5drUcdfmj4GN7eW1hyogm9ehxBPAq0YT7Z3it/vRS+/x1 qBH8gaJGwfgkpVT2up5zrkO6M6wbEIc2GNL0gsM+yvHeFXP4MNXbvk0FUibG64v2mX72 XA0w== X-Gm-Message-State: ALoCoQlp4CFbW57rPFKIybRMAFNELatbrXGGm9DEsR/cHye2mzaV6nP3gnmtJ79oyr37nfi0GMUJ X-Received: by 10.181.5.39 with SMTP id cj7mr48128859wid.79.1408030843818; Thu, 14 Aug 2014 08:40:43 -0700 (PDT) Received: from pistachio.icx.intel.com ([83.217.123.106]) by mx.google.com with ESMTPSA id kz6sm796558wjb.47.2014.08.14.08.40.42 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Aug 2014 08:40:43 -0700 (PDT) From: Thomas Wood To: intel-gfx@lists.freedesktop.org Date: Thu, 14 Aug 2014 16:40:38 +0100 Message-Id: <1408030838-19097-3-git-send-email-thomas.wood@intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1408030838-19097-1-git-send-email-thomas.wood@intel.com> References: <1408030838-19097-1-git-send-email-thomas.wood@intel.com> Subject: [Intel-gfx] [PATCH i-g-t 2/2] tests: check plane rotation is reset after the VT mode is restored X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 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=-4.9 required=5.0 tests=BAYES_00, 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 Make sure the rotation is reset after the VT mode is restored by collecting the unrotated CRC and comparing with the CRC value after VT mode has been restored. The CRC is used to ensure the hardware state is checked, rather than any software state. References: https://bugs.freedesktop.org/show_bug.cgi?id=82236 Signed-off-by: Thomas Wood --- tests/kms_rotation_crc.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c index 9146b4f..9f272fa 100644 --- a/tests/kms_rotation_crc.c +++ b/tests/kms_rotation_crc.c @@ -153,7 +153,7 @@ static void test_plane_rotation(data_t *data, enum igt_plane plane_type) igt_output_t *output; enum pipe pipe; int valid_tests = 0; - igt_crc_t crc_output; + igt_crc_t crc_output, crc_unrotated; enum igt_commit_style commit = COMMIT_LEGACY; if (plane_type == IGT_PLANE_PRIMARY) { @@ -173,12 +173,25 @@ static void test_plane_rotation(data_t *data, enum igt_plane plane_type) if (!prepare_crtc(data, output, pipe, plane)) continue; + /* collect unrotated CRC */ + igt_display_commit2(display, commit); + igt_pipe_crc_collect_crc(data->pipe_crc, &crc_unrotated); + igt_plane_set_rotation(plane, IGT_ROTATION_180); igt_display_commit2(display, commit); igt_pipe_crc_collect_crc(data->pipe_crc, &crc_output); igt_assert(igt_crc_equal(&data->ref_crc, &crc_output)); + /* check the rotation state has been reset when the VT + * mode is restored */ + kmstest_restore_vt_mode(); + kmstest_set_vt_graphics_mode(); + prepare_crtc(data, output, pipe, plane); + igt_pipe_crc_collect_crc(data->pipe_crc, &crc_output); + igt_assert(igt_crc_equal(&crc_unrotated, &crc_output)); + + valid_tests++; cleanup_crtc(data, output, plane); }