From: Thomas Wood Subject: [PATCH i-g-t 2/2] tests: check plane rotation is reset after the VT mode is restored Date: Thu, 14 Aug 2014 16:40:38 +0100 Message-ID: <1408030838-19097-3-git-send-email-thomas.wood@intel.com> References: <1408030838-19097-1-git-send-email-thomas.wood@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: 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) In-Reply-To: <1408030838-19097-1-git-send-email-thomas.wood@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org 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); } -- 1.9.3