diff options
| author | Dave Airlie <airlied@redhat.com> | 2014-06-06 05:07:09 -0400 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2014-06-06 05:07:09 -0400 |
| commit | ecb889e6205171ecbf80b15d903549aa6b15d23b (patch) | |
| tree | 64380a55d07a0e4c6dae660fa918e2f78e797949 /drivers/gpu/drm/i915/intel_pm.c | |
| parent | c7560f1281640b1232d1c3cb242aabf5bd83a857 (diff) | |
| parent | 15d24aa5602fb87c7b1358cfabcfeb9b26db290f (diff) | |
Merge tag 'drm-intel-fixes-2014-06-06' of git://anongit.freedesktop.org/drm-intel into drm-next
> Bunch of stuff for 3.16 still:
> - Mipi dsi panel support for byt. Finally! From Shobhit&others. I've
> squeezed this in since it's a regression compared to vbios and we've
> been ridiculed about it a bit too often ...
> - connection_mutex deadlock fix in get_connector (only affects i915).
> - Core patches from Matt's primary plane from Matt Roper, I've pushed the
> i915 stuff to 3.17.
> - vlv power well sequencing fixes from Jesse.
> - Fix for cursor size changes from Chris.
> - agpbusy fixes from Ville.
> - A few smaller things.
>
* tag 'drm-intel-fixes-2014-06-06' of git://anongit.freedesktop.org/drm-intel: (32 commits)
drm/i915: BDW: Adding missing cursor offsets.
drm: Fix getconnector connection_mutex locking
drm/i915/bdw: Only use 2g GGTT for 32b platforms
drm/i915: Nuke pipe A quirk on i830M
drm/i915: fix display power sw state reporting
drm/i915: Always apply cursor width changes
drm/i915: tell the user if both KMS and UMS are disabled
drm/plane-helper: Add drm_plane_helper_check_update() (v3)
drm: Check CRTC compatibility in setplane
drm/i915: use VBT to determine whether to enumerate the VGA port
drm/i915: Don't WARN about ring idle bit on gen2
drm/i915: Silence the WARN if the user tries to GTT mmap an incoherent object
drm/i915: Move the C3 LP write bit setup to gen3_init_clock_gating() for KMS
drm/i915: Enable interrupt-based AGPBUSY# enable on 85x
drm/i915: Flip the sense of AGPBUSY_DIS bit
drm/i915: Set AGPBUSY# bit in init_clock_gating
drm/i915/vlv: add pll assertion when disabling DPIO common well
drm/i915/vlv: move DPIO common reset de-assert into __vlv_set_power_well
drm/i915/vlv: re-order power wells so DPIO common comes after TX
drm/i915/vlv: move CRI refclk enable into __vlv_set_power_well
...
Diffstat (limited to 'drivers/gpu/drm/i915/intel_pm.c')
| -rw-r--r-- | drivers/gpu/drm/i915/intel_pm.c | 95 |
1 files changed, 83 insertions, 12 deletions
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 906d06f73e51..d1e53abec1b5 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
| @@ -5388,8 +5388,11 @@ static void valleyview_init_clock_gating(struct drm_device *dev) | |||
| 5388 | I915_WRITE(GEN6_UCGCTL2, | 5388 | I915_WRITE(GEN6_UCGCTL2, |
| 5389 | GEN6_RCZUNIT_CLOCK_GATE_DISABLE); | 5389 | GEN6_RCZUNIT_CLOCK_GATE_DISABLE); |
| 5390 | 5390 | ||
| 5391 | /* WaDisableL3Bank2xClockGate:vlv */ | 5391 | /* WaDisableL3Bank2xClockGate:vlv |
| 5392 | I915_WRITE(GEN7_UCGCTL4, GEN7_L3BANK2X_CLOCK_GATE_DISABLE); | 5392 | * Disabling L3 clock gating- MMIO 940c[25] = 1 |
| 5393 | * Set bit 25, to disable L3_BANK_2x_CLK_GATING */ | ||
| 5394 | I915_WRITE(GEN7_UCGCTL4, | ||
| 5395 | I915_READ(GEN7_UCGCTL4) | GEN7_L3BANK2X_CLOCK_GATE_DISABLE); | ||
| 5393 | 5396 | ||
| 5394 | I915_WRITE(MI_ARB_VLV, MI_ARB_DISPLAY_TRICKLE_FEED_DISABLE); | 5397 | I915_WRITE(MI_ARB_VLV, MI_ARB_DISPLAY_TRICKLE_FEED_DISABLE); |
| 5395 | 5398 | ||
| @@ -5541,6 +5544,12 @@ static void gen3_init_clock_gating(struct drm_device *dev) | |||
| 5541 | 5544 | ||
| 5542 | /* IIR "flip pending" means done if this bit is set */ | 5545 | /* IIR "flip pending" means done if this bit is set */ |
| 5543 | I915_WRITE(ECOSKPD, _MASKED_BIT_DISABLE(ECO_FLIP_DONE)); | 5546 | I915_WRITE(ECOSKPD, _MASKED_BIT_DISABLE(ECO_FLIP_DONE)); |
| 5547 | |||
| 5548 | /* interrupts should cause a wake up from C3 */ | ||
| 5549 | I915_WRITE(INSTPM, _MASKED_BIT_ENABLE(INSTPM_AGPBUSY_INT_EN)); | ||
| 5550 | |||
| 5551 | /* On GEN3 we really need to make sure the ARB C3 LP bit is set */ | ||
| 5552 | I915_WRITE(MI_ARB_STATE, _MASKED_BIT_ENABLE(MI_ARB_C3_LP_WRITE_ENABLE)); | ||
| 5544 | } | 5553 | } |
| 5545 | 5554 | ||
| 5546 | static void i85x_init_clock_gating(struct drm_device *dev) | 5555 | static void i85x_init_clock_gating(struct drm_device *dev) |
| @@ -5548,6 +5557,10 @@ static void i85x_init_clock_gating(struct drm_device *dev) | |||
| 5548 | struct drm_i915_private *dev_priv = dev->dev_private; | 5557 | struct drm_i915_private *dev_priv = dev->dev_private; |
| 5549 | 5558 | ||
| 5550 | I915_WRITE(RENCLK_GATE_D1, SV_CLOCK_GATE_DISABLE); | 5559 | I915_WRITE(RENCLK_GATE_D1, SV_CLOCK_GATE_DISABLE); |
| 5560 | |||
| 5561 | /* interrupts should cause a wake up from C3 */ | ||
| 5562 | I915_WRITE(MI_STATE, _MASKED_BIT_ENABLE(MI_AGPBUSY_INT_EN) | | ||
| 5563 | _MASKED_BIT_DISABLE(MI_AGPBUSY_830_MODE)); | ||
| 5551 | } | 5564 | } |
| 5552 | 5565 | ||
| 5553 | static void i830_init_clock_gating(struct drm_device *dev) | 5566 | static void i830_init_clock_gating(struct drm_device *dev) |
| @@ -5599,10 +5612,25 @@ bool intel_display_power_enabled_sw(struct drm_i915_private *dev_priv, | |||
| 5599 | enum intel_display_power_domain domain) | 5612 | enum intel_display_power_domain domain) |
| 5600 | { | 5613 | { |
| 5601 | struct i915_power_domains *power_domains; | 5614 | struct i915_power_domains *power_domains; |
| 5615 | struct i915_power_well *power_well; | ||
| 5616 | bool is_enabled; | ||
| 5617 | int i; | ||
| 5618 | |||
| 5619 | if (dev_priv->pm.suspended) | ||
| 5620 | return false; | ||
| 5602 | 5621 | ||
| 5603 | power_domains = &dev_priv->power_domains; | 5622 | power_domains = &dev_priv->power_domains; |
| 5623 | is_enabled = true; | ||
| 5624 | for_each_power_well_rev(i, power_well, BIT(domain), power_domains) { | ||
| 5625 | if (power_well->always_on) | ||
| 5626 | continue; | ||
| 5604 | 5627 | ||
| 5605 | return power_domains->domain_use_count[domain]; | 5628 | if (!power_well->count) { |
| 5629 | is_enabled = false; | ||
| 5630 | break; | ||
| 5631 | } | ||
| 5632 | } | ||
| 5633 | return is_enabled; | ||
| 5606 | } | 5634 | } |
| 5607 | 5635 | ||
| 5608 | bool intel_display_power_enabled(struct drm_i915_private *dev_priv, | 5636 | bool intel_display_power_enabled(struct drm_i915_private *dev_priv, |
| @@ -5745,13 +5773,34 @@ static bool i9xx_always_on_power_well_enabled(struct drm_i915_private *dev_priv, | |||
| 5745 | return true; | 5773 | return true; |
| 5746 | } | 5774 | } |
| 5747 | 5775 | ||
| 5748 | static void vlv_set_power_well(struct drm_i915_private *dev_priv, | 5776 | void __vlv_set_power_well(struct drm_i915_private *dev_priv, |
| 5749 | struct i915_power_well *power_well, bool enable) | 5777 | enum punit_power_well power_well_id, bool enable) |
| 5750 | { | 5778 | { |
| 5751 | enum punit_power_well power_well_id = power_well->data; | 5779 | struct drm_device *dev = dev_priv->dev; |
| 5752 | u32 mask; | 5780 | u32 mask; |
| 5753 | u32 state; | 5781 | u32 state; |
| 5754 | u32 ctrl; | 5782 | u32 ctrl; |
| 5783 | enum pipe pipe; | ||
| 5784 | |||
| 5785 | if (power_well_id == PUNIT_POWER_WELL_DPIO_CMN_BC) { | ||
| 5786 | if (enable) { | ||
| 5787 | /* | ||
| 5788 | * Enable the CRI clock source so we can get at the | ||
| 5789 | * display and the reference clock for VGA | ||
| 5790 | * hotplug / manual detection. | ||
| 5791 | */ | ||
| 5792 | I915_WRITE(DPLL(PIPE_B), I915_READ(DPLL(PIPE_B)) | | ||
| 5793 | DPLL_REFA_CLK_ENABLE_VLV | | ||
| 5794 | DPLL_INTEGRATED_CRI_CLK_VLV); | ||
| 5795 | udelay(1); /* >10ns for cmnreset, >0ns for sidereset */ | ||
| 5796 | } else { | ||
| 5797 | for_each_pipe(pipe) | ||
| 5798 | assert_pll_disabled(dev_priv, pipe); | ||
| 5799 | /* Assert common reset */ | ||
| 5800 | I915_WRITE(DPIO_CTL, I915_READ(DPIO_CTL) & | ||
| 5801 | ~DPIO_CMNRST); | ||
| 5802 | } | ||
| 5803 | } | ||
| 5755 | 5804 | ||
| 5756 | mask = PUNIT_PWRGT_MASK(power_well_id); | 5805 | mask = PUNIT_PWRGT_MASK(power_well_id); |
| 5757 | state = enable ? PUNIT_PWRGT_PWR_ON(power_well_id) : | 5806 | state = enable ? PUNIT_PWRGT_PWR_ON(power_well_id) : |
| @@ -5779,6 +5828,28 @@ static void vlv_set_power_well(struct drm_i915_private *dev_priv, | |||
| 5779 | 5828 | ||
| 5780 | out: | 5829 | out: |
| 5781 | mutex_unlock(&dev_priv->rps.hw_lock); | 5830 | mutex_unlock(&dev_priv->rps.hw_lock); |
| 5831 | |||
| 5832 | /* | ||
| 5833 | * From VLV2A0_DP_eDP_DPIO_driver_vbios_notes_10.docx - | ||
| 5834 | * 6. De-assert cmn_reset/side_reset. Same as VLV X0. | ||
| 5835 | * a. GUnit 0x2110 bit[0] set to 1 (def 0) | ||
| 5836 | * b. The other bits such as sfr settings / modesel may all | ||
| 5837 | * be set to 0. | ||
| 5838 | * | ||
| 5839 | * This should only be done on init and resume from S3 with | ||
| 5840 | * both PLLs disabled, or we risk losing DPIO and PLL | ||
| 5841 | * synchronization. | ||
| 5842 | */ | ||
| 5843 | if (power_well_id == PUNIT_POWER_WELL_DPIO_CMN_BC && enable) | ||
| 5844 | I915_WRITE(DPIO_CTL, I915_READ(DPIO_CTL) | DPIO_CMNRST); | ||
| 5845 | } | ||
| 5846 | |||
| 5847 | static void vlv_set_power_well(struct drm_i915_private *dev_priv, | ||
| 5848 | struct i915_power_well *power_well, bool enable) | ||
| 5849 | { | ||
| 5850 | enum punit_power_well power_well_id = power_well->data; | ||
| 5851 | |||
| 5852 | __vlv_set_power_well(dev_priv, power_well_id, enable); | ||
| 5782 | } | 5853 | } |
| 5783 | 5854 | ||
| 5784 | static void vlv_power_well_sync_hw(struct drm_i915_private *dev_priv, | 5855 | static void vlv_power_well_sync_hw(struct drm_i915_private *dev_priv, |
| @@ -6114,12 +6185,6 @@ static struct i915_power_well vlv_power_wells[] = { | |||
| 6114 | .ops = &vlv_display_power_well_ops, | 6185 | .ops = &vlv_display_power_well_ops, |
| 6115 | }, | 6186 | }, |
| 6116 | { | 6187 | { |
| 6117 | .name = "dpio-common", | ||
| 6118 | .domains = VLV_DPIO_CMN_BC_POWER_DOMAINS, | ||
| 6119 | .data = PUNIT_POWER_WELL_DPIO_CMN_BC, | ||
| 6120 | .ops = &vlv_dpio_power_well_ops, | ||
| 6121 | }, | ||
| 6122 | { | ||
| 6123 | .name = "dpio-tx-b-01", | 6188 | .name = "dpio-tx-b-01", |
| 6124 | .domains = VLV_DPIO_TX_B_LANES_01_POWER_DOMAINS | | 6189 | .domains = VLV_DPIO_TX_B_LANES_01_POWER_DOMAINS | |
| 6125 | VLV_DPIO_TX_B_LANES_23_POWER_DOMAINS | | 6190 | VLV_DPIO_TX_B_LANES_23_POWER_DOMAINS | |
| @@ -6155,6 +6220,12 @@ static struct i915_power_well vlv_power_wells[] = { | |||
| 6155 | .ops = &vlv_dpio_power_well_ops, | 6220 | .ops = &vlv_dpio_power_well_ops, |
| 6156 | .data = PUNIT_POWER_WELL_DPIO_TX_C_LANES_23, | 6221 | .data = PUNIT_POWER_WELL_DPIO_TX_C_LANES_23, |
| 6157 | }, | 6222 | }, |
| 6223 | { | ||
| 6224 | .name = "dpio-common", | ||
| 6225 | .domains = VLV_DPIO_CMN_BC_POWER_DOMAINS, | ||
| 6226 | .data = PUNIT_POWER_WELL_DPIO_CMN_BC, | ||
| 6227 | .ops = &vlv_dpio_power_well_ops, | ||
| 6228 | }, | ||
| 6158 | }; | 6229 | }; |
| 6159 | 6230 | ||
| 6160 | #define set_power_wells(power_domains, __power_wells) ({ \ | 6231 | #define set_power_wells(power_domains, __power_wells) ({ \ |
