From patchwork Thu May 7 18:56:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 6360601 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B664EBEEE1 for ; Thu, 7 May 2015 18:57:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EE89820303 for ; Thu, 7 May 2015 18:57:35 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 23072200ED for ; Thu, 7 May 2015 18:57:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id AF8F97213E; Thu, 7 May 2015 11:57:34 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qk0-f175.google.com (mail-qk0-f175.google.com [209.85.220.175]) by gabe.freedesktop.org (Postfix) with ESMTP id 70EDE72143 for ; Thu, 7 May 2015 11:57:33 -0700 (PDT) Received: by qkgx75 with SMTP id x75so34020424qkg.1 for ; Thu, 07 May 2015 11:57:33 -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=k3cUAbNLBylzYJnARur2enLlGOuO6HsE6FfI0fchCLM=; b=TWwrqqF98d09GbtUUo26ogx9P+raxeQR3lwJ1jpGZ6ZqT91DmDmnmgODn2KalCvHfX BpomSs3OMiSInDY8sNUpFDQrzhByNuDFIglQZFJBT7ZvLvm4+yMOA4mAbRPie9/+Vb3F 7UgyjVvUbpxXpMmPJOTFC1gKFWzmuqoeEWnSS1LSPZ1lrDthCYw984Joepqhq2wKnhQK SC0mMUYTT/IJ9LNZkwyUhqd7bio9gTSxGT1bd10g8dzI+skTpvI0pdO9Y2UrGz5GghSR nOkTd93sVeoLe9RWpeoYAM/8MUg3pUwtAT/i6Semaa114bSxaDhKCFj9IdkF3s7gaNk8 fHQA== X-Received: by 10.55.49.147 with SMTP id x141mr105293qkx.23.1431025053070; Thu, 07 May 2015 11:57:33 -0700 (PDT) Received: from localhost.localdomain ([187.121.142.45]) by mx.google.com with ESMTPSA id a8sm1955331qkh.43.2015.05.07.11.57.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 May 2015 11:57:32 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Thu, 7 May 2015 15:56:33 -0300 Message-Id: <1431024996-2267-6-git-send-email-przanoni@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1431024996-2267-1-git-send-email-przanoni@gmail.com> References: <1431024996-2267-1-git-send-email-przanoni@gmail.com> Cc: Paulo Zanoni Subject: [Intel-gfx] [PATCH igt 5/8] tests/kms_fbc_crc: extract check_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 To remove some duplicated code. When we finally fix that FIXME, the code will get a little bigger too. Signed-off-by: Paulo Zanoni --- tests/kms_fbc_crc.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/tests/kms_fbc_crc.c b/tests/kms_fbc_crc.c index 0f09a60..d36cf02 100644 --- a/tests/kms_fbc_crc.c +++ b/tests/kms_fbc_crc.c @@ -207,11 +207,21 @@ static bool wait_for_fbc_enabled(data_t *data) return igt_wait(fbc_enabled(data), 3000, 30); } -static void test_crc(data_t *data, enum test_mode mode) +static void check_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 crc; + + igt_pipe_crc_collect_crc(pipe_crc, &crc); + if (mode == TEST_PAGE_FLIP) + igt_assert_crc_equal(&crc, &data->ref_crc[1]); + else + ;/* FIXME: missing reference CRCs */ +} + +static void test_crc(data_t *data, enum test_mode mode) +{ + uint32_t crtc_id = data->output->config.crtc->crtc_id; uint32_t handle = data->fb[0].gem_handle; igt_assert(fbc_enabled(data)); @@ -266,11 +276,7 @@ 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_collect_crc(pipe_crc, &crc); - if (mode == TEST_PAGE_FLIP) - igt_assert_crc_equal(&crc, &data->ref_crc[1]); - else - ;/* FIXME: missing reference CRCs */ + check_crc(data, mode); /* * Allow time for FBC to kick in again if it @@ -278,11 +284,7 @@ static void test_crc(data_t *data, enum test_mode mode) */ igt_assert(wait_for_fbc_enabled(data)); - igt_pipe_crc_collect_crc(pipe_crc, &crc); - if (mode == TEST_PAGE_FLIP) - igt_assert_crc_equal(&crc, &data->ref_crc[1]); - else - ;/* FIXME: missing reference CRCs */ + check_crc(data, mode); } static bool prepare_crtc(data_t *data)