aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff McGee <jeff.mcgee@intel.com>2014-02-04 12:37:01 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-02-07 04:26:17 -0500
commitb8a5ff8d7c676a04e0da5ec16bb068dd39459042 (patch)
treeabcb4dde37111ea58c37aee816484280358dea29
parentdd0a1aa19bd3d7203e58157b84cea78bbac605ac (diff)
drm/i915: Update rps interrupt limits
sysfs changes to rps min and max delay were only triggering an update of the rps interrupt limits if the active delay required an update. This change ensures that interrupt limits are always updated. v2: correct compile issue missed on rebase v3: add igt testcases to signed-off-by section Testcase: igt/pm_rps/min-max-config-idle Testcase: igt/pm_rps/min-max-config-loaded Signed-off-by: Jeff McGee <jeff.mcgee@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/i915_sysfs.c10
-rw-r--r--drivers/gpu/drm/i915/intel_pm.c11
2 files changed, 20 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
index 33bcae314bf8..0c741f4eefb0 100644
--- a/drivers/gpu/drm/i915/i915_sysfs.c
+++ b/drivers/gpu/drm/i915/i915_sysfs.c
@@ -357,6 +357,11 @@ static ssize_t gt_max_freq_mhz_store(struct device *kdev,
357 else 357 else
358 gen6_set_rps(dev, val); 358 gen6_set_rps(dev, val);
359 } 359 }
360 else if (!IS_VALLEYVIEW(dev))
361 /* We still need gen6_set_rps to process the new max_delay
362 and update the interrupt limits even though frequency
363 request is unchanged. */
364 gen6_set_rps(dev, dev_priv->rps.cur_delay);
360 365
361 mutex_unlock(&dev_priv->rps.hw_lock); 366 mutex_unlock(&dev_priv->rps.hw_lock);
362 367
@@ -426,6 +431,11 @@ static ssize_t gt_min_freq_mhz_store(struct device *kdev,
426 else 431 else
427 gen6_set_rps(dev, val); 432 gen6_set_rps(dev, val);
428 } 433 }
434 else if (!IS_VALLEYVIEW(dev))
435 /* We still need gen6_set_rps to process the new min_delay
436 and update the interrupt limits even though frequency
437 request is unchanged. */
438 gen6_set_rps(dev, dev_priv->rps.cur_delay);
429 439
430 mutex_unlock(&dev_priv->rps.hw_lock); 440 mutex_unlock(&dev_priv->rps.hw_lock);
431 441
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index 6af58cd6d77c..f74d7f506aa9 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -3003,6 +3003,9 @@ static void gen6_set_rps_thresholds(struct drm_i915_private *dev_priv, u8 val)
3003 dev_priv->rps.last_adj = 0; 3003 dev_priv->rps.last_adj = 0;
3004} 3004}
3005 3005
3006/* gen6_set_rps is called to update the frequency request, but should also be
3007 * called when the range (min_delay and max_delay) is modified so that we can
3008 * update the GEN6_RP_INTERRUPT_LIMITS register accordingly. */
3006void gen6_set_rps(struct drm_device *dev, u8 val) 3009void gen6_set_rps(struct drm_device *dev, u8 val)
3007{ 3010{
3008 struct drm_i915_private *dev_priv = dev->dev_private; 3011 struct drm_i915_private *dev_priv = dev->dev_private;
@@ -3011,8 +3014,14 @@ void gen6_set_rps(struct drm_device *dev, u8 val)
3011 WARN_ON(val > dev_priv->rps.max_delay); 3014 WARN_ON(val > dev_priv->rps.max_delay);
3012 WARN_ON(val < dev_priv->rps.min_delay); 3015 WARN_ON(val < dev_priv->rps.min_delay);
3013 3016
3014 if (val == dev_priv->rps.cur_delay) 3017 if (val == dev_priv->rps.cur_delay) {
3018 /* min/max delay may still have been modified so be sure to
3019 * write the limits value */
3020 I915_WRITE(GEN6_RP_INTERRUPT_LIMITS,
3021 gen6_rps_limits(dev_priv, val));
3022
3015 return; 3023 return;
3024 }
3016 3025
3017 gen6_set_rps_thresholds(dev_priv, val); 3026 gen6_set_rps_thresholds(dev_priv, val);
3018 3027