Skip to content

Commit 3614603

Browse files
committed
drm/i915: vlv: clamp minimum RPS frequency to what Punit allows
As described in the code comment, I couldn't set the minimum RPS frequency on my BYT-M B0 to the minimum allowed as reported by Punit. Fix this by clamping the minimum value to the first one that was accepted on my machine. Atm this issue doesn't cause any test failures, since in igt/pm_rps we only check the cached version of the current frequency which is the same what has been set. In the future we'll add checks for the actual frequency too, and for that to pass this fix is necessary. Signed-off-by: Imre Deak <[email protected]> Acked-by: Ville Syrjälä <[email protected]> Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent a308ccb commit 3614603

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

drivers/gpu/drm/i915/intel_pm.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5100,7 +5100,17 @@ static int valleyview_rps_rpe_freq(struct drm_i915_private *dev_priv)
51005100

51015101
static int valleyview_rps_min_freq(struct drm_i915_private *dev_priv)
51025102
{
5103-
return vlv_punit_read(dev_priv, PUNIT_REG_GPU_LFM) & 0xff;
5103+
u32 val;
5104+
5105+
val = vlv_punit_read(dev_priv, PUNIT_REG_GPU_LFM) & 0xff;
5106+
/*
5107+
* According to the BYT Punit GPU turbo HAS 1.1.6.3 the minimum value
5108+
* for the minimum frequency in GPLL mode is 0xc1. Contrary to this on
5109+
* a BYT-M B0 the above register contains 0xbf. Moreover when setting
5110+
* a frequency Punit will not allow values below 0xc0. Clamp it 0xc0
5111+
* to make sure it matches what Punit accepts.
5112+
*/
5113+
return max_t(u32, val, 0xc0);
51045114
}
51055115

51065116
/* Check that the pctx buffer wasn't move under us. */

0 commit comments

Comments
 (0)