From patchwork Wed Mar 25 21:50:37 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 6095331 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5C5D19F399 for ; Wed, 25 Mar 2015 21:51:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 709822035E for ; Wed, 25 Mar 2015 21:51:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 8CBAB202F2 for ; Wed, 25 Mar 2015 21:51:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1791F6E93E; Wed, 25 Mar 2015 14:51:53 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qg0-f50.google.com (mail-qg0-f50.google.com [209.85.192.50]) by gabe.freedesktop.org (Postfix) with ESMTP id 93EC96E93B for ; Wed, 25 Mar 2015 14:51:47 -0700 (PDT) Received: by qgfa8 with SMTP id a8so63253679qgf.0 for ; Wed, 25 Mar 2015 14:51:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7gFX63nu3pwb5RBXzxM9HIauqE1uciYuXNgvkkpYJ/0=; b=tvNjWVW3a3qkP/1migF6xK+k20GvQ3GaF7TrLSqm+LP7GpyWD1lPuoHZS0qtZ07xBZ 7Z/w1tZ2WfrXlR4wmJ9hfqg8c9eCRcaDFVIWdOAZnVSlZWjx3foB8mlmNFY3IqdEmDtG QzvareeLMHGdALdbOsOU/3XjIqWwkBnpSqj+ZpQnNeyg7KZIf3T4EQeEKgsLSwUHZLZi ZIaTncfMWs/Ryqla9MfMRwUK6dsn4vXwjDhscbdVK5uIyz6ip5/UbCUysTiitw8fMjyk 66DejR3nD2TVob5Oq6qwvRI7SSyrhIyUtzsOEeQ3sUw+VEi8Ysok75SZwEupyZroqbIC p15g== X-Received: by 10.55.42.39 with SMTP id q39mr22345074qkh.99.1427320307259; Wed, 25 Mar 2015 14:51:47 -0700 (PDT) Received: from localhost.localdomain ([187.121.139.226]) by mx.google.com with ESMTPSA id b52sm2308334qgb.16.2015.03.25.14.51.45 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 25 Mar 2015 14:51:46 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Wed, 25 Mar 2015 18:50:37 -0300 Message-Id: <1427320239-25667-5-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1427320239-25667-1-git-send-email-przanoni@gmail.com> References: <1427320239-25667-1-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH 5/7] tests/kms_fbc_crc: use igt_pipe_crc_collect_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-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_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 From: Paulo Zanoni Instead of its hardcoded implementation. Signed-off-by: Paulo Zanoni --- tests/kms_fbc_crc.c | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) diff --git a/tests/kms_fbc_crc.c b/tests/kms_fbc_crc.c index d81f4a2..f1888c4 100644 --- a/tests/kms_fbc_crc.c +++ b/tests/kms_fbc_crc.c @@ -215,7 +215,7 @@ static void test_crc(data_t *data, enum test_mode mode) { uint32_t crtc_id = data->output->config.crtc->crtc_id; igt_pipe_crc_t *pipe_crc = data->pipe_crc; - igt_crc_t *crcs = NULL; + igt_crc_t crc; uint32_t handle = data->handle[0]; igt_assert(fbc_enabled(data)); @@ -271,14 +271,11 @@ static void test_crc(data_t *data, enum test_mode mode) igt_wait_for_vblank(data->drm_fd, data->pipe); igt_wait_for_vblank(data->drm_fd, data->pipe); - igt_pipe_crc_start(pipe_crc); - igt_pipe_crc_get_crcs(pipe_crc, 1, &crcs); - igt_pipe_crc_stop(pipe_crc); + igt_pipe_crc_collect_crc(pipe_crc, &crc); if (mode == TEST_PAGE_FLIP) - igt_assert_crc_equal(&crcs[0], &data->ref_crc[1]); + igt_assert_crc_equal(&crc, &data->ref_crc[1]); else ;/* FIXME: missing reference CRCs */ - free(crcs); /* * Allow time for FBC to kick in again if it @@ -286,14 +283,11 @@ static void test_crc(data_t *data, enum test_mode mode) */ igt_assert(wait_for_fbc_enabled(data)); - igt_pipe_crc_start(pipe_crc); - igt_pipe_crc_get_crcs(pipe_crc, 1, &crcs); - igt_pipe_crc_stop(pipe_crc); + igt_pipe_crc_collect_crc(pipe_crc, &crc); if (mode == TEST_PAGE_FLIP) - igt_assert_crc_equal(&crcs[0], &data->ref_crc[1]); + igt_assert_crc_equal(&crc, &data->ref_crc[1]); else ;/* FIXME: missing reference CRCs */ - free(crcs); } static bool prepare_crtc(data_t *data) @@ -320,7 +314,6 @@ static bool prepare_test(data_t *data, enum test_mode test_mode) igt_output_t *output = data->output; drmModeModeInfo *mode; igt_pipe_crc_t *pipe_crc; - igt_crc_t *crcs = NULL; data->primary = igt_output_get_plane(data->output, IGT_PLANE_PRIMARY); mode = igt_output_get_mode(data->output); @@ -367,11 +360,7 @@ static bool prepare_test(data_t *data, enum test_mode test_mode) igt_wait_for_vblank(data->drm_fd, data->pipe); /* get reference crc for fb[1] */ - igt_pipe_crc_start(pipe_crc); - igt_pipe_crc_get_crcs(pipe_crc, 1, &crcs); - data->ref_crc[1] = crcs[0]; - igt_pipe_crc_stop(pipe_crc); - free(crcs); + igt_pipe_crc_collect_crc(pipe_crc, &data->ref_crc[1]); if (test_mode == TEST_CONTEXT || test_mode == TEST_PAGE_FLIP_AND_CONTEXT) { data->ctx[0] = drm_intel_gem_context_create(data->bufmgr); @@ -406,11 +395,7 @@ static bool prepare_test(data_t *data, enum test_mode test_mode) igt_wait_for_vblank(data->drm_fd, data->pipe); /* get reference crc for fb[0] */ - igt_pipe_crc_start(pipe_crc); - igt_pipe_crc_get_crcs(pipe_crc, 1, &crcs); - data->ref_crc[0] = crcs[0]; - igt_pipe_crc_stop(pipe_crc); - free(crcs); + igt_pipe_crc_collect_crc(pipe_crc, &data->ref_crc[0]); return true; }