From patchwork Thu Jun 30 14:33:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9208277 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 F06126089D for ; Thu, 30 Jun 2016 14:36:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E138C28596 for ; Thu, 30 Jun 2016 14:36:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D63E52867C; Thu, 30 Jun 2016 14:36:46 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A12528673 for ; Thu, 30 Jun 2016 14:36:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7A4FA6E904; Thu, 30 Jun 2016 14:36:33 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com [IPv6:2a00:1450:400c:c09::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 77BE56E8B5 for ; Thu, 30 Jun 2016 14:34:40 +0000 (UTC) Received: by mail-wm0-x244.google.com with SMTP id c82so23412985wme.3 for ; Thu, 30 Jun 2016 07:34:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:subject:date:message-id:in-reply-to:references; bh=hqf3FYKq6539X0BYaHQSdxqhJ02mrI5+J7mND4Q4nmU=; b=aTxBUpllHOcJSHdBDtHfatbx0MHNv4YD7niKf2xDv+6GlQ15t7Zm+msZ1ddltrUk0M L+2KV5E2Bedi7y8HJWsQejZoKjaDn+sGZLuAmDBKY8YlDmFqz6+B2pUmpVaOglpRl6YA MfDNhYsukthHIXF74RJFSMPFvboHvPrlwtJkKw5xtnETgqCZ/yS5gFg/JDxL4j4OsqON 5yTlvgoItYlKimASUsnTBLCEgJwaT1CPv2keDnR7Cs8dnx09veUXu1Ih7VvaAcn6PXLV m5/MWoQpHMeRWDwZAuB5+ETlWNExZgP3FS8cj8uhHvdDHmthxyrdjvkJ2+0soNG8YY5t Vz5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references; bh=hqf3FYKq6539X0BYaHQSdxqhJ02mrI5+J7mND4Q4nmU=; b=Xb/Pq+2u/Asx2RUGM5ynxFfXeM9ATixxm+Ki8cPe8IL4hYJk5mLKncWyfiLsnd+790 o06WAjhC94P2yy61b5IHbENCfglYNW7MNl1mUegFo+mN2tftKyAVhjQSv8iEilnl9zli KXn6zXgyf5S7jmiBM5RARrFU905UUKn/bx/tifsReZ/gvmUaL3oNOJ5iywfUHDR+/z/6 Xer/OKSJoDN2j2fEdeiccPh+CY1Ha4kJFEoyLPWllyYgUMnvrj3NumgQkHAD4gdHGLGB T1Tafdd9dHwCHW1KLNagK52tRhSXLbzxOg3cMiOlFSJmKXdIv/12orSsWkHSG80BfOyn SmaQ== X-Gm-Message-State: ALyK8tLJrpToISdmqlHnOMo8FJQ4TS2DJbptTReWecow5Qkf4jgyQq5VBZWk4rxDjsjMog== X-Received: by 10.195.11.230 with SMTP id el6mr14200252wjd.145.1467297278719; Thu, 30 Jun 2016 07:34:38 -0700 (PDT) Received: from haswell.alporthouse.com ([78.156.65.138]) by smtp.gmail.com with ESMTPSA id o2sm3878278wjp.26.2016.06.30.07.34.37 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jun 2016 07:34:37 -0700 (PDT) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Thu, 30 Jun 2016 15:33:28 +0100 Message-Id: <1467297225-21379-45-git-send-email-chris@chris-wilson.co.uk> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1467297225-21379-1-git-send-email-chris@chris-wilson.co.uk> References: <1467297225-21379-1-git-send-email-chris@chris-wilson.co.uk> Subject: [Intel-gfx] [CI 45/62] drm/i915: Convert wait_for(I915_READ(reg)) to intel_wait_for_register() 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 By using the out-of-line intel_wait_for_register() not only do we can efficiency from using the hybrid wait_for() contained within, but we avoid code bloat from the numerous inlined loops, in total (all patches): text data bss dec hex filename 1078551 4557 416 1083524 108884 drivers/gpu/drm/i915/i915.ko 1070775 4557 416 1075748 106a24 drivers/gpu/drm/i915/i915.ko Signed-off-by: Chris Wilson Reviewed-by: Tvrtko Ursulin --- drivers/gpu/drm/i915/intel_psr.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c index bce44ecc9409..8d25c45aa6fe 100644 --- a/drivers/gpu/drm/i915/intel_psr.c +++ b/drivers/gpu/drm/i915/intel_psr.c @@ -591,14 +591,20 @@ static void intel_psr_work(struct work_struct *work) * and be ready for re-enable. */ if (HAS_DDI(dev_priv)) { - if (wait_for((I915_READ(EDP_PSR_STATUS_CTL) & - EDP_PSR_STATUS_STATE_MASK) == 0, 50)) { + if (intel_wait_for_register(dev_priv, + EDP_PSR_STATUS_CTL, + EDP_PSR_STATUS_STATE_MASK, + 0, + 50)) { DRM_ERROR("Timed out waiting for PSR Idle for re-enable\n"); return; } } else { - if (wait_for((I915_READ(VLV_PSRSTAT(pipe)) & - VLV_EDP_PSR_IN_TRANS) == 0, 1)) { + if (intel_wait_for_register(dev_priv, + VLV_PSRSTAT(pipe), + VLV_EDP_PSR_IN_TRANS, + 0, + 1)) { DRM_ERROR("Timed out waiting for PSR Idle for re-enable\n"); return; }