[PATCH] drm/i915: make forcewake work again

Ben Widawsky ben at bwidawsk.net
Mon Aug 6 12:31:31 PDT 2012


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 at 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 at 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



More information about the dri-devel mailing list