Skip to content

Commit d20d4f0

Browse files
jbarnes993danvet
authored andcommitted
drm/i915: create spearate VLV disable_rps function
We don't want to write reserved regs here, and may want to do other bits in the future, so split it out. Reported-by: Ville Syrjälä <[email protected]> Signed-off-by: Jesse Barnes <[email protected]> Reviewed-by: Jani Nikula <[email protected]> Signed-off-by: Daniel Vetter <[email protected]>
1 parent 250848c commit d20d4f0

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

drivers/gpu/drm/i915/intel_pm.c

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2547,6 +2547,25 @@ static void gen6_disable_rps(struct drm_device *dev)
25472547
I915_WRITE(GEN6_PMIIR, I915_READ(GEN6_PMIIR));
25482548
}
25492549

2550+
static void valleyview_disable_rps(struct drm_device *dev)
2551+
{
2552+
struct drm_i915_private *dev_priv = dev->dev_private;
2553+
2554+
I915_WRITE(GEN6_RC_CONTROL, 0);
2555+
I915_WRITE(GEN6_PMINTRMSK, 0xffffffff);
2556+
I915_WRITE(GEN6_PMIER, 0);
2557+
/* Complete PM interrupt masking here doesn't race with the rps work
2558+
* item again unmasking PM interrupts because that is using a different
2559+
* register (PMIMR) to mask PM interrupts. The only risk is in leaving
2560+
* stale bits in PMIIR and PMIMR which gen6_enable_rps will clean up. */
2561+
2562+
spin_lock_irq(&dev_priv->rps.lock);
2563+
dev_priv->rps.pm_iir = 0;
2564+
spin_unlock_irq(&dev_priv->rps.lock);
2565+
2566+
I915_WRITE(GEN6_PMIIR, I915_READ(GEN6_PMIIR));
2567+
}
2568+
25502569
int intel_enable_rc6(const struct drm_device *dev)
25512570
{
25522571
/* Respect the kernel parameter if it is set */
@@ -3661,7 +3680,10 @@ void intel_disable_gt_powersave(struct drm_device *dev)
36613680
if (IS_VALLEYVIEW(dev))
36623681
cancel_delayed_work_sync(&dev_priv->rps.vlv_work);
36633682
mutex_lock(&dev_priv->rps.hw_lock);
3664-
gen6_disable_rps(dev);
3683+
if (IS_VALLEYVIEW(dev))
3684+
valleyview_disable_rps(dev);
3685+
else
3686+
gen6_disable_rps(dev);
36653687
mutex_unlock(&dev_priv->rps.hw_lock);
36663688
}
36673689
}

0 commit comments

Comments
 (0)