From patchwork Thu Jun 30 14:33:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9208251 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 97EBA60752 for ; Thu, 30 Jun 2016 14:36:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88DA828596 for ; Thu, 30 Jun 2016 14:36:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7DDBE2867C; Thu, 30 Jun 2016 14:36:38 +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 3EB9428596 for ; Thu, 30 Jun 2016 14:36:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7BAD96E8D4; Thu, 30 Jun 2016 14:36:30 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-wm0-x241.google.com (mail-wm0-x241.google.com [IPv6:2a00:1450:400c:c09::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id E14786E8C1 for ; Thu, 30 Jun 2016 14:34:44 +0000 (UTC) Received: by mail-wm0-x241.google.com with SMTP id c82so23413455wme.3 for ; Thu, 30 Jun 2016 07:34:44 -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=dCPbtUM/VKrZTEWy2qUBLsfRL27joUObr4iTQbImI4k=; b=Un35vMbzTkiUWTjljYXQ3vlN4Ng8Ydq5PKZsaIFbQ2FMkwuLTQs5LuPjQhM27FZzJs uxyAb28bxsJ/JLC2SYW3MUyJTflt7yQbkdGX0ZaSCciBouLwiGu2z8QfQNgQgEI6YIB7 LvoiLiB6txuEqeW0EVV/z2iXlM51nDQIbW9hPQkyeJZyKCll3m9uGwGrhM5epi8ignFo kgjYf1qkHIcuQ84XVc9YwyXHLyEEnZhvJh/vMXv6CyIXJ9m9P+/lqS3B9YjZ5zSL/jlN eNQbi1GHqJfdKsok7mySTPuR/8OFk+QKNe1GOC9f/5pTJWUUZh3XKUvll1AqLkvHOnmE EWdg== 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=dCPbtUM/VKrZTEWy2qUBLsfRL27joUObr4iTQbImI4k=; b=PYcsiNx3WVG/vOVpbPqZDOYp0ujxOZz1Eh4jMw3LKUqNXO8jGekE37tQhUv/vDZwCM DgwgOfs64n2gabns2aliPMn0aGg4msLRIcy7S0Mf3/mpcQ2QLS4C5hSHsNdSLJJyu2Tr ZMLXjTovfmnwy53c/ctyVZA97CT8NFp9mRt1o0ORcvOjGynTIK2rxjqL95GQg7Ac3cqp p1nvUEdUVgRzVdXJAWFUz6RCD8PZ7YMK5omYXTtn3/MumuOD28XOmcfigQ9VaYpscoIf QceRVlsMVZYiF3BCL/kr9H2KxMPHu3fq5O+zp3DxcdGpfxHsiQeaEn0X96SjgOd5onPT QcNw== X-Gm-Message-State: ALyK8tJlXrk2WP9QCR5jpxiohoPvu+A062AGhhcREBp4tZ/0ecxu6UWPq7Fk1JhBoGJ1pw== X-Received: by 10.194.80.70 with SMTP id p6mr13911287wjx.45.1467297283274; Thu, 30 Jun 2016 07:34:43 -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.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jun 2016 07:34:42 -0700 (PDT) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Thu, 30 Jun 2016 15:33:32 +0100 Message-Id: <1467297225-21379-49-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 49/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_runtime_pm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_runtime_pm.c b/drivers/gpu/drm/i915/intel_runtime_pm.c index 22b46f5f0273..cc8766df8a37 100644 --- a/drivers/gpu/drm/i915/intel_runtime_pm.c +++ b/drivers/gpu/drm/i915/intel_runtime_pm.c @@ -365,8 +365,11 @@ static void hsw_set_power_well(struct drm_i915_private *dev_priv, if (!is_enabled) { DRM_DEBUG_KMS("Enabling power well\n"); - if (wait_for((I915_READ(HSW_PWR_WELL_DRIVER) & - HSW_PWR_WELL_STATE_ENABLED), 20)) + if (intel_wait_for_register(dev_priv, + HSW_PWR_WELL_DRIVER, + HSW_PWR_WELL_STATE_ENABLED, + HSW_PWR_WELL_STATE_ENABLED, + 20)) DRM_ERROR("Timeout enabling power well\n"); hsw_power_well_post_enable(dev_priv); }