aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSagar Arun Kamble <sagar.a.kamble@intel.com>2017-01-19 22:48:24 -0500
committerChris Wilson <chris@chris-wilson.co.uk>2017-01-20 04:32:47 -0500
commit7e79a6836cfd1bac20e2be3fafdc3caca27c9d69 (patch)
tree4822ce51525e1316362e0e5c12b033e627b99ea3
parente96128235b0fbddff1228b37033077397dbd21d9 (diff)
drm/i915: Set adjustment to zero on Up/Down interrupts if freq is already max/min
When we reach the user's RPS limits, stop requesting an adjustment. Even though we will clamp the requested frequency later, we rely on interrupt masking to disable further adjustments in the same direction. Even though it is unlikely (one scenario is a bug in the driver, another is careful manipulation through the uAPI) if we keep exponentially increasing the adjustment value, it will wrap and cause a negative adjustment. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Sagar Arun Kamble <sagar.a.kamble@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1484884104-28134-2-git-send-email-sagar.a.kamble@intel.com
-rw-r--r--drivers/gpu/drm/i915/i915_irq.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
index ce5663d94839..6fefc34ef602 100644
--- a/drivers/gpu/drm/i915/i915_irq.c
+++ b/drivers/gpu/drm/i915/i915_irq.c
@@ -1170,6 +1170,9 @@ static void gen6_pm_rps_work(struct work_struct *work)
1170 adj *= 2; 1170 adj *= 2;
1171 else /* CHV needs even encode values */ 1171 else /* CHV needs even encode values */
1172 adj = IS_CHERRYVIEW(dev_priv) ? 2 : 1; 1172 adj = IS_CHERRYVIEW(dev_priv) ? 2 : 1;
1173
1174 if (new_delay >= dev_priv->rps.max_freq_softlimit)
1175 adj = 0;
1173 /* 1176 /*
1174 * For better performance, jump directly 1177 * For better performance, jump directly
1175 * to RPe if we're below it. 1178 * to RPe if we're below it.
@@ -1191,6 +1194,9 @@ static void gen6_pm_rps_work(struct work_struct *work)
1191 adj *= 2; 1194 adj *= 2;
1192 else /* CHV needs even encode values */ 1195 else /* CHV needs even encode values */
1193 adj = IS_CHERRYVIEW(dev_priv) ? -2 : -1; 1196 adj = IS_CHERRYVIEW(dev_priv) ? -2 : -1;
1197
1198 if (new_delay <= dev_priv->rps.min_freq_softlimit)
1199 adj = 0;
1194 } else { /* unknown event */ 1200 } else { /* unknown event */
1195 adj = 0; 1201 adj = 0;
1196 } 1202 }