From patchwork Thu May 7 18:56:32 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paulo Zanoni X-Patchwork-Id: 6360591 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 EBC09BEEE1 for ; Thu, 7 May 2015 18:57:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2C76C20376 for ; Thu, 7 May 2015 18:57:34 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5474020303 for ; Thu, 7 May 2015 18:57:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D91607213B; Thu, 7 May 2015 11:57:32 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-qc0-f180.google.com (mail-qc0-f180.google.com [209.85.216.180]) by gabe.freedesktop.org (Postfix) with ESMTP id A63F97213E for ; Thu, 7 May 2015 11:57:31 -0700 (PDT) Received: by qcbgu10 with SMTP id gu10so26072865qcb.2 for ; Thu, 07 May 2015 11:57:31 -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=MKY6VYEm1jERR7x0D8Z8+FLeyGpwNge6Ph9SoEo3+Wo=; b=P8QsgFccWspcgedD+5k7tHtLLzOhypy7NNDzrENCeIIbQeMVBlr4JuUDY3vRjx0Knv yVcoR68QFqLANcNNpCv6+ECglx1zsAeXKCAFUxEnctzRCdnYxqJyGDkB6cyidlyQJwtk z3rdwZJdkAqSAxXlmvSv0JMSliXs+QYD01so0GMK5wxyDJfTH6rwn0L3405xgq/pTF4j 3k8dUUAdIUivESXdK4igASZjJYvNHaRotqMnYT0jfUsevUYopkvCqIXpCPtKdE5IB8wH cqTe6mA3av8qpiZ/MkaOZBLCU/jaE3OCKnAe2SQl+V0yT8z+l7nJ66lqz8v2h5WccvuZ lKrg== X-Received: by 10.140.94.104 with SMTP id f95mr117729qge.38.1431025051333; Thu, 07 May 2015 11:57:31 -0700 (PDT) Received: from localhost.localdomain ([187.121.142.45]) by mx.google.com with ESMTPSA id a8sm1955331qkh.43.2015.05.07.11.57.29 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 May 2015 11:57:30 -0700 (PDT) From: Paulo Zanoni To: intel-gfx@lists.freedesktop.org Date: Thu, 7 May 2015 15:56:32 -0300 Message-Id: <1431024996-2267-5-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 4/8] tests/kms_fbc_crc: refactor context handling code 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 Just a small modification to make the code a little easier to understand, IMHO. Signed-off-by: Paulo Zanoni --- tests/kms_fbc_crc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/kms_fbc_crc.c b/tests/kms_fbc_crc.c index 20510ff..0f09a60 100644 --- a/tests/kms_fbc_crc.c +++ b/tests/kms_fbc_crc.c @@ -227,6 +227,7 @@ static void test_crc(data_t *data, enum test_mode mode) switch (mode) { void *ptr; + drm_intel_context *context = NULL; case TEST_PAGE_FLIP: break; case TEST_MMAP_CPU: @@ -248,13 +249,12 @@ static void test_crc(data_t *data, enum test_mode mode) case TEST_PAGE_FLIP_AND_BLT: fill_blt(data, handle, data->fb, ~0); break; - case TEST_RENDER: case TEST_CONTEXT: - case TEST_PAGE_FLIP_AND_RENDER: case TEST_PAGE_FLIP_AND_CONTEXT: - fill_render(data, handle, - (mode == TEST_CONTEXT || mode == TEST_PAGE_FLIP_AND_CONTEXT) ? - data->ctx[1] : NULL, 0xff); + context = data->ctx[1]; + case TEST_RENDER: + case TEST_PAGE_FLIP_AND_RENDER: + fill_render(data, handle, context, 0xff); break; }