Skip to content

Commit a7f6e23

Browse files
sdeepak2danvet
authored andcommitted
drm/i915/vlv: Remove wait for for punit to updates freq.
When GPU is idle on VLV, Request freq to punit should be good enough to get the voltage back to VNN. Also, make sure gfx clock force applies before requesting the freq fot vlv. v2: Do forcewake before setting idle frequency (ville) Update function comments to match the code (Deepak) v3: Fix get/put across idle frequency Request. (Ville) Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75244 suggested-by: Jesse Barnes <[email protected]> Signed-off-by: Deepak S <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
1 parent b6e742f commit a7f6e23

File tree

1 file changed

+11
-30
lines changed

1 file changed

+11
-30
lines changed

drivers/gpu/drm/i915/intel_pm.c

Lines changed: 11 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4097,51 +4097,32 @@ static void valleyview_set_rps(struct drm_device *dev, u8 val)
40974097
trace_intel_gpu_freq_change(intel_gpu_freq(dev_priv, val));
40984098
}
40994099

4100-
/* vlv_set_rps_idle: Set the frequency to Rpn if Gfx clocks are down
4100+
/* vlv_set_rps_idle: Set the frequency to idle, if Gfx clocks are down
41014101
*
41024102
* * If Gfx is Idle, then
4103-
* 1. Mask Turbo interrupts
4104-
* 2. Bring up Gfx clock
4105-
* 3. Change the freq to Rpn and wait till P-Unit updates freq
4106-
* 4. Clear the Force GFX CLK ON bit so that Gfx can down
4107-
* 5. Unmask Turbo interrupts
4103+
* 1. Forcewake Media well.
4104+
* 2. Request idle freq.
4105+
* 3. Release Forcewake of Media well.
41084106
*/
41094107
static void vlv_set_rps_idle(struct drm_i915_private *dev_priv)
41104108
{
41114109
struct drm_device *dev = dev_priv->dev;
41124110
u32 val = dev_priv->rps.idle_freq;
41134111

4114-
/* CHV and latest VLV don't need to force the gfx clock */
4115-
if (IS_CHERRYVIEW(dev) || dev->pdev->revision >= 0xd) {
4112+
/* CHV don't need to force the gfx clock */
4113+
if (IS_CHERRYVIEW(dev)) {
41164114
valleyview_set_rps(dev_priv->dev, val);
41174115
return;
41184116
}
41194117

4120-
/*
4121-
* When we are idle. Drop to min voltage state.
4122-
*/
4123-
41244118
if (dev_priv->rps.cur_freq <= val)
41254119
return;
41264120

4127-
/* Mask turbo interrupt so that they will not come in between */
4128-
I915_WRITE(GEN6_PMINTRMSK,
4129-
gen6_sanitize_rps_pm_mask(dev_priv, ~0));
4130-
4131-
vlv_force_gfx_clock(dev_priv, true);
4132-
4133-
dev_priv->rps.cur_freq = val;
4134-
4135-
vlv_punit_write(dev_priv, PUNIT_REG_GPU_FREQ_REQ, val);
4136-
4137-
if (wait_for(((vlv_punit_read(dev_priv, PUNIT_REG_GPU_FREQ_STS))
4138-
& GENFREQSTATUS) == 0, 100))
4139-
DRM_ERROR("timed out waiting for Punit\n");
4140-
4141-
gen6_set_rps_thresholds(dev_priv, val);
4142-
vlv_force_gfx_clock(dev_priv, false);
4143-
4144-
I915_WRITE(GEN6_PMINTRMSK, gen6_rps_pm_mask(dev_priv, val));
4121+
/* Wake up the media well, as that takes a lot less
4122+
* power than the Render well. */
4123+
intel_uncore_forcewake_get(dev_priv, FORCEWAKE_MEDIA);
4124+
valleyview_set_rps(dev_priv->dev, val);
4125+
intel_uncore_forcewake_put(dev_priv, FORCEWAKE_MEDIA);
41454126
}
41464127

41474128
void gen6_rps_busy(struct drm_i915_private *dev_priv)

0 commit comments

Comments
 (0)