From patchwork Tue Sep 20 08:46:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lionel Landwerlin X-Patchwork-Id: 9341245 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 E08256077A for ; Tue, 20 Sep 2016 08:47:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D315E29D4A for ; Tue, 20 Sep 2016 08:47:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C7EB829D4B; Tue, 20 Sep 2016 08:47:11 +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 A44C129D42 for ; Tue, 20 Sep 2016 08:47:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 281976E69B; Tue, 20 Sep 2016 08:47:08 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 66E7D6E69B for ; Tue, 20 Sep 2016 08:47:05 +0000 (UTC) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP; 20 Sep 2016 01:47:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,366,1470726000"; d="scan'208";a="170899314" Received: from jmzalesk-mobl1.ger.corp.intel.com (HELO ivy.ger.corp.intel.com) ([10.252.49.157]) by fmsmga004.fm.intel.com with ESMTP; 20 Sep 2016 01:47:02 -0700 From: Lionel Landwerlin To: intel-gfx@lists.freedesktop.org Date: Tue, 20 Sep 2016 09:46:58 +0100 Message-Id: <1474361218-32169-1-git-send-email-lionel.g.landwerlin@intel.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <87wpi7yhgi.fsf@intel.com> References: <87wpi7yhgi.fsf@intel.com> Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH i-g-t] tests: kms_pipe_color: fix ctm tests 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 of the Intel platforms have odd numbers of LUT entries and we need to tests a couple of values around the expected result. Bring back the CRC equal function we need that doesn't trigger an assert right away, while we still assert if we can't find a correct result in the outter loop. v2: update Fixes field (Jani) bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97691 Fixes: 582ce4cd19c6 ("lib/debugs: nuke igt_crc_equal again") Cc: Daniel Vetter Cc: Christophe Prigent --- tests/kms_pipe_color.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/kms_pipe_color.c b/tests/kms_pipe_color.c index b0a2f07..ebfceab 100644 --- a/tests/kms_pipe_color.c +++ b/tests/kms_pipe_color.c @@ -652,6 +652,16 @@ static void test_pipe_legacy_gamma_reset(data_t *data, free(gamma_zero); } +static bool crc_equal(igt_crc_t *a, igt_crc_t *b) +{ + int i; + + for (i = 0; i < a->n_words; i++) + if (a->crc[i] != b->crc[i]) + return false; + return true; +} + /* * Draw 3 rectangles using before colors with the ctm matrix apply and verify * the CRC is equal to using after colors with an identify ctm matrix. @@ -724,7 +734,7 @@ static bool test_pipe_ctm(data_t *data, /* Verify that the CRC of the software computed output is * equal to the CRC of the CTM matrix transformation output. */ - igt_assert_crc_equal(&crc_software, &crc_hardware); + ret &= crc_equal(&crc_software, &crc_hardware); igt_output_set_pipe(output, PIPE_ANY); }