Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Ben Widawsky <ben@bwidawsk.net>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915: Correct sandybrige overclocking
Date: Sat, 23 Mar 2013 20:32:53 +0100	[thread overview]
Message-ID: <20130323193253.GH9021@phenom.ffwll.local> (raw)
In-Reply-To: <1363749596-1429-1-git-send-email-ben@bwidawsk.net>

On Tue, Mar 19, 2013 at 08:19:56PM -0700, Ben Widawsky wrote:
> Change the gen6+ max delay if the pcode read was successful (not the
> inverse).
> 
> The previous code was all sorts of wrong and has existed since I broke
> it:
> commit 42c0526c930523425ff6edc95b7235ce7ab9308d
> Author: Ben Widawsky <ben@bwidawsk.net>
> Date:   Wed Sep 26 10:34:00 2012 -0700
> 
>     drm/i915: Extract PCU communication
> 
> I added some parentheses for clarity, and I also corrected the debug
> message message to use the mask (wrong before I came along) and added a
> print to show the value we're changing from.
> 
> Looking over the code, I'm not actually sure what we're trying to do. I
> introduced the bug simply by extracting the function not implementing
> anything new. We already set max_delay based on the capabilities
> register (which is what we use elsewhere to determine min and max).
> This would potentially increase it, I suppose? Jesse, I can't find the
> document which explains the definitions of the pcode commands, maybe you
> have it around.
> 
> Based on Jesse's response, this could potentially be for -fixes, or
> stable, or maybe lead to us dropping it entirely. As the current code is
> is, things won't completely break because of the aforementioned
> capabilities register, and in my experimentation, enabling this has no
> effect, it goes from 1100->1100.
> 
> I found this while reviewing Jesse's VLV patches.
> 
> Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
> Signed-off-by: Ben Widawsky <ben@bwidawsk.net>

Random guy on irc just confirmed that this actually fixes gpu overclocking
on his machine: The overclock limit jumped from 1.1GHz to 1.9GHz (which is
what he selected in his bios). Unfortunately he jumped irc before I could
grab his tested-by, so won't (yet) move the patch to -fixes with a cc:
stable.

So: (Other) testers highly welcome ;-)

Cheers, Daniel

> ---
>  drivers/gpu/drm/i915/intel_pm.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> index c30e89a..86729b1 100644
> --- a/drivers/gpu/drm/i915/intel_pm.c
> +++ b/drivers/gpu/drm/i915/intel_pm.c
> @@ -2631,9 +2631,11 @@ static void gen6_enable_rps(struct drm_device *dev)
>  	if (!ret) {
>  		pcu_mbox = 0;
>  		ret = sandybridge_pcode_read(dev_priv, GEN6_READ_OC_PARAMS, &pcu_mbox);
> -		if (ret && pcu_mbox & (1<<31)) { /* OC supported */
> +		if (!ret && (pcu_mbox & (1<<31))) { /* OC supported */
> +			DRM_DEBUG_DRIVER("overclocking supported, adjusting frequency max from %dMHz to %dMHz\n",
> +					 ((dev_priv->rps.max_delay & 0xff) * 50),
> +					 ((pcu_mbox & 0xff) * 50));
>  			dev_priv->rps.max_delay = pcu_mbox & 0xff;
> -			DRM_DEBUG_DRIVER("overclocking supported, adjusting frequency max to %dMHz\n", pcu_mbox * 50);
>  		}
>  	} else {
>  		DRM_DEBUG_DRIVER("Failed to set the min frequency\n");
> -- 
> 1.8.2
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  parent reply	other threads:[~2013-03-23 19:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-20  3:19 [PATCH] drm/i915: Correct sandybrige overclocking Ben Widawsky
2013-03-20  9:58 ` Chris Wilson
2013-03-20 16:21 ` Jesse Barnes
2013-03-20 16:33   ` Ben Widawsky
2013-03-20 16:57     ` Jesse Barnes
2013-03-20 21:47       ` Daniel Vetter
2013-03-23 19:32 ` Daniel Vetter [this message]
2013-03-23 19:39   ` Daniel Vetter
2013-03-23 23:56     ` Ben Widawsky
2013-03-24 12:06       ` Daniel Vetter
2013-03-24  0:46 ` [PATCH] drm/i915: Don't overclock on Haswell Ben Widawsky
2013-03-25 14:36   ` Jesse Barnes
2013-03-25 15:38     ` Daniel Vetter

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=20130323193253.GH9021@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=ben@bwidawsk.net \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox