All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: fixup desired rps frequency computation
@ 2012-08-08 15:42 Daniel Vetter
  2012-08-08 20:12 ` Chris Wilson
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Vetter @ 2012-08-08 15:42 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

In commit

commit 20b46e59dd102665ce7168baa215e5b1ee66b69b
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Thu Jul 26 11:16:14 2012 +0200

    drm/i915: Only set the down rps limit when at the loweset frequency

The computation for the new desired frequency was extracted, but since
the desired frequency was passed-by value, the adjustments didn't
propgate back. Fix this.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_pm.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index d0ce894..5050bb8 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -2272,13 +2272,13 @@ static void ironlake_disable_drps(struct drm_device *dev)
  * ourselves, instead of doing a rmw cycle (which might result in us clearing
  * all limits and the gpu stuck at whatever frequency it is at atm).
  */
-static u32 gen6_rps_limits(struct drm_i915_private *dev_priv, u8 val)
+static u32 gen6_rps_limits(struct drm_i915_private *dev_priv, u8 *val)
 {
 	u32 limits;
 
 	limits = 0;
-	if (val >= dev_priv->max_delay)
-		val = dev_priv->max_delay;
+	if (*val >= dev_priv->max_delay)
+		*val = dev_priv->max_delay;
 	limits |= dev_priv->max_delay << 24;
 
 	/* Only set the down limit when we've reached the lowest level to avoid
@@ -2287,8 +2287,8 @@ static u32 gen6_rps_limits(struct drm_i915_private *dev_priv, u8 val)
 	 * the hw runs at the minimal clock before selecting the desired
 	 * frequency, if the down threshold expires in that window we will not
 	 * receive a down interrupt. */
-	if (val <= dev_priv->min_delay) {
-		val = dev_priv->min_delay;
+	if (*val <= dev_priv->min_delay) {
+		*val = dev_priv->min_delay;
 		limits |= dev_priv->min_delay << 16;
 	}
 
@@ -2298,7 +2298,7 @@ static u32 gen6_rps_limits(struct drm_i915_private *dev_priv, u8 val)
 void gen6_set_rps(struct drm_device *dev, u8 val)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
-	u32 limits = gen6_rps_limits(dev_priv, val);
+	u32 limits = gen6_rps_limits(dev_priv, &val);
 
 	if (val == dev_priv->cur_delay)
 		return;
-- 
1.7.10.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: fixup desired rps frequency computation
  2012-08-08 15:42 [PATCH] drm/i915: fixup desired rps frequency computation Daniel Vetter
@ 2012-08-08 20:12 ` Chris Wilson
  2012-08-08 20:54   ` Daniel Vetter
  0 siblings, 1 reply; 3+ messages in thread
From: Chris Wilson @ 2012-08-08 20:12 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

On Wed,  8 Aug 2012 17:42:52 +0200, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> In commit
> 
> commit 20b46e59dd102665ce7168baa215e5b1ee66b69b
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date:   Thu Jul 26 11:16:14 2012 +0200
> 
>     drm/i915: Only set the down rps limit when at the loweset frequency
> 
> The computation for the new desired frequency was extracted, but since
> the desired frequency was passed-by value, the adjustments didn't
> propgate back. Fix this.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Ouch, how embarrassing - for the reviewer. :(
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/i915: fixup desired rps frequency computation
  2012-08-08 20:12 ` Chris Wilson
@ 2012-08-08 20:54   ` Daniel Vetter
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Vetter @ 2012-08-08 20:54 UTC (permalink / raw)
  To: Chris Wilson; +Cc: Daniel Vetter, Intel Graphics Development

On Wed, Aug 08, 2012 at 09:12:21PM +0100, Chris Wilson wrote:
> On Wed,  8 Aug 2012 17:42:52 +0200, Daniel Vetter <daniel.vetter@ffwll.ch> wrote:
> > In commit
> > 
> > commit 20b46e59dd102665ce7168baa215e5b1ee66b69b
> > Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Date:   Thu Jul 26 11:16:14 2012 +0200
> > 
> >     drm/i915: Only set the down rps limit when at the loweset frequency
> > 
> > The computation for the new desired frequency was extracted, but since
> > the desired frequency was passed-by value, the adjustments didn't
> > propgate back. Fix this.
> > 
> > Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> Ouch, how embarrassing - for the reviewer. :(
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Queued for -next, thanks for the review.
-Daniel
-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-08 20:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-08-08 15:42 [PATCH] drm/i915: fixup desired rps frequency computation Daniel Vetter
2012-08-08 20:12 ` Chris Wilson
2012-08-08 20:54   ` Daniel Vetter

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.