From patchwork Thu Jun 30 14:33:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9208273 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 1910960752 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 09EA828673 for ; Thu, 30 Jun 2016 14:36:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F2D822867D; Thu, 30 Jun 2016 14:36:45 +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 A60FE28673 for ; Thu, 30 Jun 2016 14:36:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 185BF6E8E9; Thu, 30 Jun 2016 14:36:32 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id 73DD96E8D6 for ; Thu, 30 Jun 2016 14:34:39 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id 187so23416674wmz.1 for ; Thu, 30 Jun 2016 07:34:39 -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=hceKzvW0o4jQTeW4Iv25OtdGzwmRqIAh5rlE8bIer1Q=; b=xk8/GFBf+OR0nN48qs4oXGrlaOWH6lUVIx59sU1bAxsfAmCG3gcud8Tj2Pl8leu71K 2M0dRGjDAseHnWfTKZJVg6LOB0uG9eoumsISSJH6cQu/JA6uHhtSX/rDW2BKAjDnUP+u m7eB/3cuvoy+9gT7azjuCQpsk7d7+Zq71QGdRGDuRSFBMFArvgX1b+ZBZrGoHuLSIms6 FZb/8e4s1lFE/im5pgkyfym0cF0GgT5SQMI96XYLwU9k8s4q1GtXvGKC350+LHLd+ZlX kOIpyG3n86a/2mK1PbzSkC8AA+ODPUW6vmIFJ1og7RiYf+HANs0tRfjOYSxgi0lgOK2S 1lVA== 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=hceKzvW0o4jQTeW4Iv25OtdGzwmRqIAh5rlE8bIer1Q=; b=VSgk7JixA4mi/je4VDoktXmrW+9MTJ+qCpZx2VmbAsVTJhyUdBQCPTjbQ5vPcdoJfR 0OsZkrOqTsnL1GsdTrG92R7rnQZsh6heJvsKmvnegxievJCtiTFjFGryjRnfWmFYcASP gmVU9r2fcnv1C7lH5qnz4pfXFWVsTNR0XLqYrrlafvWiumFA8P5VPBEGIvgX0QiPntq5 8Qh4Qdq+GkIvUdFqhY7wKo44ms6Bv498Ng2IA/ZlzNgryh4pTHVeuWVXICsrH9QCJ8dq 1nU129EP13Mo9VXuYAiLm+FIdSnIsEyipu7DM2Y4qeMkUs8n72D4TJECe5pyVUtsqHa0 a3Jw== X-Gm-Message-State: ALyK8tKOJOt6M6i8Lty7JKzC06bFh4NdgCkfzSxXag/IAG/Dt3qjm63LAfTlSTa0ioi5IA== X-Received: by 10.28.134.199 with SMTP id i190mr28606593wmd.26.1467297277635; Thu, 30 Jun 2016 07:34:37 -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.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jun 2016 07:34:36 -0700 (PDT) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Thu, 30 Jun 2016 15:33:27 +0100 Message-Id: <1467297225-21379-44-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 44/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 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_psr.c b/drivers/gpu/drm/i915/intel_psr.c index d299a3d95cfa..bce44ecc9409 100644 --- a/drivers/gpu/drm/i915/intel_psr.c +++ b/drivers/gpu/drm/i915/intel_psr.c @@ -531,9 +531,11 @@ static void hsw_psr_disable(struct intel_dp *intel_dp) I915_READ(EDP_PSR_CTL) & ~EDP_PSR_ENABLE); /* Wait till PSR is idle */ - if (_wait_for((I915_READ(EDP_PSR_STATUS_CTL) & - EDP_PSR_STATUS_STATE_MASK) == 0, - 2 * USEC_PER_SEC, 10 * USEC_PER_MSEC)) + if (intel_wait_for_register(dev_priv, + EDP_PSR_STATUS_CTL, + EDP_PSR_STATUS_STATE_MASK, + 0, + 2000)) DRM_ERROR("Timed out waiting for PSR Idle State\n"); dev_priv->psr.active = false;