Commit f745a80e authored by Ville Syrjälä's avatar Ville Syrjälä Committed by Daniel Vetter

drm/i915: Update PMINTRMSK on VLV/CHV after sysfs min/max freq change

Currently we don't call valleyview_set_rps() when changing the min/max
limits through sysfs if the current frequency is still within the new
limits. However that means we sometimes forget to update PMINTRMSK.
Eg. if the current frequency is at the old minimum, and then we reduce
the minum further we should then enable the 'down' interrupts in PMINTRMSK
but currently we don't.

Fix it up by always calling valleyview_set_rps() (just like we do for
!vlv/chv platforms). This also allows the code to be simplified a bit.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent a93fad0f
...@@ -374,17 +374,17 @@ static ssize_t gt_max_freq_mhz_store(struct device *kdev, ...@@ -374,17 +374,17 @@ static ssize_t gt_max_freq_mhz_store(struct device *kdev,
dev_priv->rps.max_freq_softlimit = val; dev_priv->rps.max_freq_softlimit = val;
if (dev_priv->rps.cur_freq > val) { val = clamp_t(int, dev_priv->rps.cur_freq,
if (IS_VALLEYVIEW(dev)) dev_priv->rps.min_freq_softlimit,
valleyview_set_rps(dev, val); dev_priv->rps.max_freq_softlimit);
else
gen6_set_rps(dev, val); /* We still need *_set_rps to process the new max_delay and
} else if (!IS_VALLEYVIEW(dev)) { * update the interrupt limits and PMINTRMSK even though
/* We still need gen6_set_rps to process the new max_delay and * frequency request may be unchanged. */
* update the interrupt limits even though frequency request is if (IS_VALLEYVIEW(dev))
* unchanged. */ valleyview_set_rps(dev, val);
gen6_set_rps(dev, dev_priv->rps.cur_freq); else
} gen6_set_rps(dev, val);
mutex_unlock(&dev_priv->rps.hw_lock); mutex_unlock(&dev_priv->rps.hw_lock);
...@@ -442,17 +442,17 @@ static ssize_t gt_min_freq_mhz_store(struct device *kdev, ...@@ -442,17 +442,17 @@ static ssize_t gt_min_freq_mhz_store(struct device *kdev,
dev_priv->rps.min_freq_softlimit = val; dev_priv->rps.min_freq_softlimit = val;
if (dev_priv->rps.cur_freq < val) { val = clamp_t(int, dev_priv->rps.cur_freq,
if (IS_VALLEYVIEW(dev)) dev_priv->rps.min_freq_softlimit,
valleyview_set_rps(dev, val); dev_priv->rps.max_freq_softlimit);
else
gen6_set_rps(dev, val); /* We still need *_set_rps to process the new min_delay and
} else if (!IS_VALLEYVIEW(dev)) { * update the interrupt limits and PMINTRMSK even though
/* We still need gen6_set_rps to process the new min_delay and * frequency request may be unchanged. */
* update the interrupt limits even though frequency request is if (IS_VALLEYVIEW(dev))
* unchanged. */ valleyview_set_rps(dev, val);
gen6_set_rps(dev, dev_priv->rps.cur_freq); else
} gen6_set_rps(dev, val);
mutex_unlock(&dev_priv->rps.hw_lock); mutex_unlock(&dev_priv->rps.hw_lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment