From: Daniel Vetter <daniel@ffwll.ch>
To: Ben Widawsky <ben@bwidawsk.net>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 2/4] drm/i915: go back to switch for VLV mem freq detection v2
Date: Mon, 6 May 2013 17:30:46 +0200 [thread overview]
Message-ID: <20130506153046.GF5763@phenom.ffwll.local> (raw)
In-Reply-To: <20130503175211.GA29311@bwidawsk.net>
On Fri, May 03, 2013 at 10:52:11AM -0700, Ben Widawsky wrote:
> On Thu, May 02, 2013 at 10:48:08AM -0700, Jesse Barnes wrote:
> > Both the docs and the existing code were wrong. So fix both and use a
> > switch statement like we do elsewhere to make things simple & clear.
> >
> > Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> > ---
> > drivers/gpu/drm/i915/intel_pm.c | 13 ++++++++++++-
> > 1 file changed, 12 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> > index 0f4b46e..556b989 100644
> > --- a/drivers/gpu/drm/i915/intel_pm.c
> > +++ b/drivers/gpu/drm/i915/intel_pm.c
> > @@ -2902,7 +2902,18 @@ static void valleyview_enable_rps(struct drm_device *dev)
> > GEN7_RC_CTL_TO_MODE);
> >
> > valleyview_punit_read(dev_priv, PUNIT_REG_GPU_FREQ_STS, &val);
> > - dev_priv->mem_freq = 800 + (266 * (val >> 6) & 3);
> > + switch ((val >> 6) & 3) {
> > + case 0:
> > + case 1:
> > + dev_priv->mem_freq = 800;
> > + break;
> > + case 2:
> > + dev_priv->mem_freq = 1066;
> > + break;
> > + case 3:
> > + dev_priv->mem_freq = 1333;
> > + break;
> > + }
> > DRM_DEBUG_DRIVER("DDR speed: %d MHz", dev_priv->mem_freq);
> >
> > DRM_DEBUG_DRIVER("GPLL enabled? %s\n", val & 0x10 ? "yes" : "no");
>
> The code does what the author wants it to, but I don't have the doc that
> says this:
> Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
First two patches of this series are merged to dinq, thanks.
-Daniel
--
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
next prev parent reply other threads:[~2013-05-06 15:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-02 17:48 [PATCH 1/4] drm/i915: read current freq from Punit on VLV Jesse Barnes
2013-05-02 17:48 ` [PATCH 2/4] drm/i915: go back to switch for VLV mem freq detection v2 Jesse Barnes
2013-05-03 17:52 ` Ben Widawsky
2013-05-06 15:30 ` Daniel Vetter [this message]
2013-05-02 17:48 ` [PATCH 3/4] drm/i915: set proper DPIO post divider for VGA on VLV v4 Jesse Barnes
2013-05-06 17:52 ` Kenneth Graunke
2013-05-06 20:50 ` Daniel Vetter
2013-05-02 17:48 ` [PATCH 4/4] drm/i915: BIOS and power context stolen mem handling for VLV Jesse Barnes
2013-05-03 18:05 ` Ben Widawsky
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=20130506153046.GF5763@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;
as well as URLs for NNTP newsgroup(s).