From patchwork Mon Sep 26 16:35:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lionel Landwerlin X-Patchwork-Id: 9350999 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 82633607D6 for ; Mon, 26 Sep 2016 16:35:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 75BE628A58 for ; Mon, 26 Sep 2016 16:35:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6AB5728A81; Mon, 26 Sep 2016 16:35:24 +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 0CD0E28A56 for ; Mon, 26 Sep 2016 16:35:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9452289054; Mon, 26 Sep 2016 16:35:23 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id D482A89054 for ; Mon, 26 Sep 2016 16:35:22 +0000 (UTC) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP; 26 Sep 2016 09:35:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.30,400,1470726000"; d="scan'208"; a="1036696650" Received: from ivy.ld.intel.com ([10.103.238.158]) by orsmga001.jf.intel.com with ESMTP; 26 Sep 2016 09:35:21 -0700 From: Lionel Landwerlin To: intel-gfx@lists.freedesktop.org Date: Mon, 26 Sep 2016 17:35:22 +0100 Message-Id: <1474907722-28111-1-git-send-email-lionel.g.landwerlin@intel.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <20160920102100.GA4329@intel.com> References: <20160920102100.GA4329@intel.com> MIME-Version: 1.0 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: , 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) v3: Use memcmp (Ville) 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 Cc: Ville Syrjälä --- tests/kms_pipe_color.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/kms_pipe_color.c b/tests/kms_pipe_color.c index b0a2f07..f120e26 100644 --- a/tests/kms_pipe_color.c +++ b/tests/kms_pipe_color.c @@ -652,6 +652,13 @@ 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; + + return memcmp(a->crc, b->crc, sizeof(a->crc[0]) * a->n_words) == 0; +} + /* * 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 +731,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); }