From patchwork Thu Jun 30 14:33:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Wilson X-Patchwork-Id: 9208245 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 BE5C160752 for ; Thu, 30 Jun 2016 14:36:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AFB0828596 for ; Thu, 30 Jun 2016 14:36:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A451C2867C; Thu, 30 Jun 2016 14:36:35 +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 6737728596 for ; Thu, 30 Jun 2016 14:36:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0F9566E8D7; 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-x243.google.com (mail-wm0-x243.google.com [IPv6:2a00:1450:400c:c09::243]) by gabe.freedesktop.org (Postfix) with ESMTPS id D00736E8B5 for ; Thu, 30 Jun 2016 14:34:50 +0000 (UTC) Received: by mail-wm0-x243.google.com with SMTP id r201so23396398wme.0 for ; Thu, 30 Jun 2016 07:34:50 -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=uJNdgPrynj2EQZaIkNFAaZaQ+HRDPVeIlcUWN1Mjgco=; b=ljjKQAWXYmftWw5Z4EDvXxZf3XYmXepLy8E6gGP931AutowDbSNKLjQ74KvXd3+Leo rZMlJlDK22O4OMskyGYPXV4BHRe6Dpnr3y3y7GF+4W9QuT0YYFF2q6a1E4wC0skV9+7v pmSezvuP660UqER1tViHmLyh3tHjEVLVEkTmUlHG2U+339HKkU8CeArXjcB7AOLQPg1O tjOaC0LArHZcnaEH+fMKSSd0XtRdmdiGFpZEm7xZBmlQN9oihEyK5h63PgwG5JfrVCPu lrhtZfsJ/vWEdZ4N+Qu44q6zp5bmtUUDNL/LJQ+hsC4HWkqUk5cRSE9fi8H7Y4FOe8C4 o7/A== 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=uJNdgPrynj2EQZaIkNFAaZaQ+HRDPVeIlcUWN1Mjgco=; b=OX73X170tchgCa5reksP1gUZnY2QRzZiX/O+pKY7X7jday7efxujRpPzmxtfBiihpd GPKB5b6u/eN1FRZ9wz3uOQSK4hQ7F7DNPYs3xwZfJ5+B+X0Xfkexyz5Zwvfh0hVzWiLb K0yd9pG6txRnZsdfxFAmG/8DKanCgO21LP+kQv5OZCklo0Rs52lM05UvBIOENeVH3/wV lxMk5YxGQNF63XY3JGNqRpit/x9Bolq4MSIuUJ0iEvpeent1oifm31M8isNhUIQTzTI4 I8E1qbfGD2eevZrQILe5IGMm1nftgcsIhTpqwUgRcmmc8fED5cd49wNtprEElH8GH5eo xesA== X-Gm-Message-State: ALyK8tLjyP9nAB10EtiqPwtWDcM14JWsssE1S4zOKnBlCMT+NQR6mdOLwSuIypRCbEvHEQ== X-Received: by 10.28.128.69 with SMTP id b66mr19865347wmd.56.1467297289181; Thu, 30 Jun 2016 07:34:49 -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.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 30 Jun 2016 07:34:48 -0700 (PDT) From: Chris Wilson To: intel-gfx@lists.freedesktop.org Date: Thu, 30 Jun 2016 15:33:37 +0100 Message-Id: <1467297225-21379-54-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 54/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_sideband.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_sideband.c b/drivers/gpu/drm/i915/intel_sideband.c index c3998188cf35..56744471cbac 100644 --- a/drivers/gpu/drm/i915/intel_sideband.c +++ b/drivers/gpu/drm/i915/intel_sideband.c @@ -51,7 +51,9 @@ static int vlv_sideband_rw(struct drm_i915_private *dev_priv, u32 devfn, WARN_ON(!mutex_is_locked(&dev_priv->sb_lock)); - if (wait_for((I915_READ(VLV_IOSF_DOORBELL_REQ) & IOSF_SB_BUSY) == 0, 5)) { + if (intel_wait_for_register(dev_priv, + VLV_IOSF_DOORBELL_REQ, IOSF_SB_BUSY, 0, + 5)) { DRM_DEBUG_DRIVER("IOSF sideband idle wait (%s) timed out\n", is_read ? "read" : "write"); return -EAGAIN;