From patchwork Thu Aug 3 06:54:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mika Kahola X-Patchwork-Id: 9878229 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 4E3C36037D for ; Thu, 3 Aug 2017 06:52:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 35D6B286F9 for ; Thu, 3 Aug 2017 06:52:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A8AA28885; Thu, 3 Aug 2017 06:52:25 +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 BBA8928883 for ; Thu, 3 Aug 2017 06:52:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8FDE26E0DD; Thu, 3 Aug 2017 06:52:22 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTPS id D5F036E0DD for ; Thu, 3 Aug 2017 06:52:20 +0000 (UTC) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Aug 2017 23:52:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,314,1498546800"; d="scan'208";a="885845545" Received: from sorvi.fi.intel.com ([10.237.72.154]) by FMSMGA003.fm.intel.com with ESMTP; 02 Aug 2017 23:52:19 -0700 From: Mika Kahola To: intel-gfx@lists.freedesktop.org Date: Thu, 3 Aug 2017 09:54:18 +0300 Message-Id: <1501743258-8971-1-git-send-email-mika.kahola@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [Intel-gfx] [PATCH i-g-t v2] tests/kms_plane_multiple: Fix reference CRC 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 kms_plane_multiple wrongly expected that igt lib function would modify the passed igt_crc_t* object. You should use igt_crc_t** instead. This patch fixes this anomaly in the test. While at it, remove unnecesary struct for test data as we only need reference CRC here. The problem was caught by CI system and at least affects on HSW platform. V2: Don't change function that collects CRC for reference CRC Fix CRC pointers Remove unnecessary struct for holding test data Signed-off-by: Mika Kahola Reviewed-by: Marta Lofstedt --- tests/kms_plane_multiple.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/tests/kms_plane_multiple.c b/tests/kms_plane_multiple.c index f6c6223..4bc26b7 100644 --- a/tests/kms_plane_multiple.c +++ b/tests/kms_plane_multiple.c @@ -51,11 +51,6 @@ typedef struct { struct igt_fb *fb; } data_t; -typedef struct { - data_t *data; - igt_crc_t reference_crc; -} test_position_t; - /* Command line parameters. */ struct { int iterations; @@ -106,7 +101,7 @@ static void test_fini(data_t *data, igt_output_t *output, int n_planes) static void test_grab_crc(data_t *data, igt_output_t *output, enum pipe pipe, bool atomic, - color_t *color, uint64_t tiling, igt_crc_t *crc /* out */) + color_t *color, uint64_t tiling, igt_crc_t **crc /* out */) { drmModeModeInfo *mode; igt_plane_t *primary; @@ -132,7 +127,7 @@ test_grab_crc(data_t *data, igt_output_t *output, enum pipe pipe, bool atomic, igt_skip_on(ret != 0); igt_pipe_crc_start(data->pipe_crc); - n = igt_pipe_crc_get_crcs(data->pipe_crc, 1, &crc); + n = igt_pipe_crc_get_crcs(data->pipe_crc, 1, crc); igt_assert_eq(n, 1); } @@ -251,8 +246,8 @@ test_atomic_plane_position_with_output(data_t *data, enum pipe pipe, { char buf[256]; struct drm_event *e = (void *)buf; - test_position_t test = { .data = data }; color_t blue = { 0.0f, 0.0f, 1.0f }; + igt_crc_t *ref = NULL; igt_crc_t *crc = NULL; unsigned int vblank_start, vblank_stop; int i, n, ret; @@ -275,8 +270,7 @@ test_atomic_plane_position_with_output(data_t *data, enum pipe pipe, test_init(data, pipe, n_planes); - test_grab_crc(data, output, pipe, true, &blue, tiling, - &test.reference_crc); + test_grab_crc(data, output, pipe, true, &blue, tiling, &ref); i = 0; while (i < iterations || loop_forever) { @@ -303,7 +297,7 @@ test_atomic_plane_position_with_output(data_t *data, enum pipe pipe, igt_assert(vblank_stop - vblank_start <= MAX_CRCS); igt_assert_eq(n, vblank_stop - vblank_start); - igt_assert_crc_equal(&test.reference_crc, crc); + igt_assert_crc_equal(ref, crc); i++; } @@ -318,9 +312,9 @@ test_legacy_plane_position_with_output(data_t *data, enum pipe pipe, igt_output_t *output, int n_planes, uint64_t tiling) { - test_position_t test = { .data = data }; color_t blue = { 0.0f, 0.0f, 1.0f }; - igt_crc_t *crc; + igt_crc_t *ref = NULL; + igt_crc_t *crc = NULL; int i, n; int iterations = opt.iterations < 1 ? 1 : opt.iterations; bool loop_forever; @@ -341,8 +335,7 @@ test_legacy_plane_position_with_output(data_t *data, enum pipe pipe, test_init(data, pipe, n_planes); - test_grab_crc(data, output, pipe, false, &blue, tiling, - &test.reference_crc); + test_grab_crc(data, output, pipe, false, &blue, tiling, &ref); i = 0; while (i < iterations || loop_forever) { @@ -354,7 +347,7 @@ test_legacy_plane_position_with_output(data_t *data, enum pipe pipe, igt_assert_eq(n, MAX_CRCS); - igt_assert_crc_equal(&test.reference_crc, crc); + igt_assert_crc_equal(ref, crc); i++; }