All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Widawsky <ben@bwidawsk.net>
To: Intel GFX <intel-gfx@lists.freedesktop.org>,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	dri-devel@lists.freedesktop.org
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>,
	Greg Kroah-Hartman <greg@kroah.com>,
	Ben Widawsky <ben@bwidawsk.net>,
	linux-pm@vger.kernel.org
Subject: [PATCH] drm/i915: make forcewake work again
Date: Mon,  6 Aug 2012 12:31:31 -0700	[thread overview]
Message-ID: <1344281491-3129-1-git-send-email-ben@bwidawsk.net> (raw)
In-Reply-To: <1343808372.3047.1.camel@dabdike.int.hansenpartnership.com>

While trying to track down the power regression, I noticed that on my
SNB I had more severe problems, ie. forcewake seemed to never happen
once i915 was loaded. After a bit of bisection, I tracked the bad commit
to:

commit 7b0cfee1a24efdfe0235bac62e53f686fe8a8e24
Merge: 9756fe3 6b16351
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Mon Jun 25 19:06:12 2012 +0200

    Merge tag 'v3.5-rc4' into drm-intel-next-queued

I changed the macro to the inline statement to debug a little better and
noticed that the problem went away. It's a bit embarrassing, but I can't
figure out what is wrong with the old macro.

In any case, I think this warrants further review.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
---
 drivers/gpu/drm/i915/i915_drv.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index ff569cc..a859169 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -1020,10 +1020,13 @@ MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL and additional rights");
 
 /* We give fast paths for the really cool registers */
-#define NEEDS_FORCE_WAKE(dev_priv, reg) \
-	((HAS_FORCE_WAKE((dev_priv)->dev)) && \
-	 ((reg) < 0x40000) &&            \
-	 ((reg) != FORCEWAKE))
+static inline bool NEEDS_FORCE_WAKE(struct drm_i915_private *dev_priv,
+				    u32 reg)
+{
+	return (HAS_FORCE_WAKE(dev_priv->dev)) &&
+		(reg < 0x40000) &&
+		(reg != FORCEWAKE);
+}
 
 static bool IS_DISPLAYREG(u32 reg)
 {
-- 
1.7.11.4

  parent reply	other threads:[~2012-08-06 19:31 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1343477958.2891.6.camel@dabdike.int.hansenpartnership.com>
     [not found] ` <1343557599.2745.1.camel@dabdike.int.hansenpartnership.com>
     [not found]   ` <201207291544.26334.rjw@sisk.pl>
     [not found]     ` <201207292125.21376.rjw@sisk.pl>
     [not found]       ` <1343641574.2905.2.camel@dabdike.int.hansenpartnership.com>
2012-07-30 14:54         ` Massive power regression going 3.4->3.5 James Bottomley
2012-07-30 16:33           ` Keith Packard
2012-07-30 17:05             ` James Bottomley
2012-07-30 18:23               ` Keith Packard
2012-07-31  7:31                 ` James Bottomley
2012-07-31  8:06                   ` James Bottomley
2012-07-31  8:28                     ` Chris Wilson
2012-07-31  9:37                       ` James Bottomley
2012-07-31  9:54                         ` Chris Wilson
2012-07-31  9:57                           ` James Bottomley
2012-07-31 10:14                             ` Chris Wilson
2012-07-31 19:24                               ` Chris Wilson
2012-08-01  8:06                                 ` James Bottomley
2012-08-01  8:16                                   ` Chris Wilson
2012-08-01  8:45                                     ` James Bottomley
2012-08-01  8:58                                       ` Chris Wilson
2012-08-01  9:07                                         ` James Bottomley
2012-08-01  9:14                                           ` Chris Wilson
2012-08-01  9:38                                         ` James Bottomley
2012-08-01 10:06                                           ` Chris Wilson
2012-08-02  5:08                                             ` bwidawsk
2012-08-02  7:20                                               ` James Bottomley
2012-08-02 12:07                                                 ` Ben Widawsky
2012-08-01 10:08                                         ` James Bottomley
2012-08-05 20:36                                           ` Daniel Vetter
2012-08-07 20:43                                             ` James Bottomley
2012-08-08  2:44                                               ` Ben Widawsky
2012-08-08  7:22                                               ` Daniel Vetter
2012-08-06 19:31                                   ` Ben Widawsky [this message]
2012-08-07 17:56                                     ` [Intel-gfx] [PATCH] drm/i915: make forcewake work again Ben Widawsky
2012-07-31 14:27                     ` Massive power regression going 3.4->3.5 Keith Packard
2012-07-31 15:09                       ` James Bottomley
2012-07-31 15:36                         ` Chris Wilson
2012-07-31 16:25                         ` James Bottomley
2012-07-30 18:23               ` Adam Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1344281491-3129-1-git-send-email-ben@bwidawsk.net \
    --to=ben@bwidawsk.net \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=greg@kroah.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@sisk.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.