diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2014-05-23 16:16:44 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2014-06-05 02:52:37 -0400 |
commit | f618e38dedb17e86278cc7eb9a6cef184893885d (patch) | |
tree | fcc8bf7b24dbf3bf252a1a7275a60f4a5e787747 | |
parent | f099a3c605724b2f848ed4edd318e20528761904 (diff) |
drm/i915/vlv: move DPIO common reset de-assert into __vlv_set_power_well
We need to do this anytime we power gate the DPIO common well.
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 13 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_pm.c | 39 |
2 files changed, 30 insertions, 22 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 4973fe03f9aa..de5992b71ed9 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -1525,19 +1525,6 @@ static void intel_reset_dpio(struct drm_device *dev) | |||
1525 | false); | 1525 | false); |
1526 | __vlv_set_power_well(dev_priv, PUNIT_POWER_WELL_DPIO_CMN_BC, | 1526 | __vlv_set_power_well(dev_priv, PUNIT_POWER_WELL_DPIO_CMN_BC, |
1527 | true); | 1527 | true); |
1528 | |||
1529 | /* | ||
1530 | * From VLV2A0_DP_eDP_DPIO_driver_vbios_notes_10.docx - | ||
1531 | * 6. De-assert cmn_reset/side_reset. Same as VLV X0. | ||
1532 | * a. GUnit 0x2110 bit[0] set to 1 (def 0) | ||
1533 | * b. The other bits such as sfr settings / modesel may all | ||
1534 | * be set to 0. | ||
1535 | * | ||
1536 | * This should only be done on init and resume from S3 with | ||
1537 | * both PLLs disabled, or we risk losing DPIO and PLL | ||
1538 | * synchronization. | ||
1539 | */ | ||
1540 | I915_WRITE(DPIO_CTL, I915_READ(DPIO_CTL) | DPIO_CMNRST); | ||
1541 | } | 1528 | } |
1542 | } | 1529 | } |
1543 | 1530 | ||
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index c2cf9063dd7a..cca93d06894c 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
@@ -5715,15 +5715,22 @@ void __vlv_set_power_well(struct drm_i915_private *dev_priv, | |||
5715 | u32 state; | 5715 | u32 state; |
5716 | u32 ctrl; | 5716 | u32 ctrl; |
5717 | 5717 | ||
5718 | if (power_well_id == PUNIT_POWER_WELL_DPIO_CMN_BC && enable) { | 5718 | if (power_well_id == PUNIT_POWER_WELL_DPIO_CMN_BC) { |
5719 | /* | 5719 | if (enable) { |
5720 | * Enable the CRI clock source so we can get at the display | 5720 | /* |
5721 | * and the reference clock for VGA hotplug / manual detection. | 5721 | * Enable the CRI clock source so we can get at the |
5722 | */ | 5722 | * display and the reference clock for VGA |
5723 | I915_WRITE(DPLL(PIPE_B), I915_READ(DPLL(PIPE_B)) | | 5723 | * hotplug / manual detection. |
5724 | DPLL_REFA_CLK_ENABLE_VLV | | 5724 | */ |
5725 | DPLL_INTEGRATED_CRI_CLK_VLV); | 5725 | I915_WRITE(DPLL(PIPE_B), I915_READ(DPLL(PIPE_B)) | |
5726 | udelay(1); /* >10ns for cmnreset, >0ns for sidereset */ | 5726 | DPLL_REFA_CLK_ENABLE_VLV | |
5727 | DPLL_INTEGRATED_CRI_CLK_VLV); | ||
5728 | udelay(1); /* >10ns for cmnreset, >0ns for sidereset */ | ||
5729 | } else { | ||
5730 | /* Assert common reset */ | ||
5731 | I915_WRITE(DPIO_CTL, I915_READ(DPIO_CTL) & | ||
5732 | ~DPIO_CMNRST); | ||
5733 | } | ||
5727 | } | 5734 | } |
5728 | 5735 | ||
5729 | mask = PUNIT_PWRGT_MASK(power_well_id); | 5736 | mask = PUNIT_PWRGT_MASK(power_well_id); |
@@ -5752,6 +5759,20 @@ void __vlv_set_power_well(struct drm_i915_private *dev_priv, | |||
5752 | 5759 | ||
5753 | out: | 5760 | out: |
5754 | mutex_unlock(&dev_priv->rps.hw_lock); | 5761 | mutex_unlock(&dev_priv->rps.hw_lock); |
5762 | |||
5763 | /* | ||
5764 | * From VLV2A0_DP_eDP_DPIO_driver_vbios_notes_10.docx - | ||
5765 | * 6. De-assert cmn_reset/side_reset. Same as VLV X0. | ||
5766 | * a. GUnit 0x2110 bit[0] set to 1 (def 0) | ||
5767 | * b. The other bits such as sfr settings / modesel may all | ||
5768 | * be set to 0. | ||
5769 | * | ||
5770 | * This should only be done on init and resume from S3 with | ||
5771 | * both PLLs disabled, or we risk losing DPIO and PLL | ||
5772 | * synchronization. | ||
5773 | */ | ||
5774 | if (power_well_id == PUNIT_POWER_WELL_DPIO_CMN_BC && enable) | ||
5775 | I915_WRITE(DPIO_CTL, I915_READ(DPIO_CTL) | DPIO_CMNRST); | ||
5755 | } | 5776 | } |
5756 | 5777 | ||
5757 | static void vlv_set_power_well(struct drm_i915_private *dev_priv, | 5778 | static void vlv_set_power_well(struct drm_i915_private *dev_priv, |