[Intel-gfx] [PATCH] drm/i915: make forcewake work again

Ben Widawsky ben at bwidawsk.net
Tue Aug 7 10:56:35 PDT 2012


On Mon,  6 Aug 2012 12:31:31 -0700
Ben Widawsky <ben at bwidawsk.net> wrote:

> 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)
>  {

Quick followup for anyone paying attention. The sympon and fix are both
reproducible. I've sent relevant info to Daniel to sift through the
crap.

-- 
Ben Widawsky, Intel Open Source Technology Center


More information about the dri-devel mailing list