drm/i915: fix Haswell FDI link disable path
authorPaulo Zanoni <paulo.r.zanoni@intel.com>
Thu, 1 Nov 2012 23:05:05 +0000 (21:05 -0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Sun, 11 Nov 2012 22:51:33 +0000 (23:51 +0100)
This covers the "Disable FDI" section from the CRT mode set sequence.
This disables the FDI receiver and also the FDI pll.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/intel_ddi.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_drv.h

index 00958399dcfea8a7d8216b0375002d537df028dd..58f50ebdbef6f28f8bb59b931dada41deb5fe396 100644 (file)
@@ -1365,6 +1365,32 @@ void intel_ddi_prepare_link_retrain(struct drm_encoder *encoder)
        udelay(600);
 }
 
+void intel_ddi_fdi_disable(struct drm_crtc *crtc)
+{
+       struct drm_i915_private *dev_priv = crtc->dev->dev_private;
+       struct intel_encoder *intel_encoder = intel_ddi_get_crtc_encoder(crtc);
+       uint32_t val;
+
+       intel_ddi_post_disable(intel_encoder);
+
+       val = I915_READ(_FDI_RXA_CTL);
+       val &= ~FDI_RX_ENABLE;
+       I915_WRITE(_FDI_RXA_CTL, val);
+
+       val = I915_READ(_FDI_RXA_MISC);
+       val &= ~(FDI_RX_PWRDN_LANE1_MASK | FDI_RX_PWRDN_LANE0_MASK);
+       val |= FDI_RX_PWRDN_LANE1_VAL(2) | FDI_RX_PWRDN_LANE0_VAL(2);
+       I915_WRITE(_FDI_RXA_MISC, val);
+
+       val = I915_READ(_FDI_RXA_CTL);
+       val &= ~FDI_PCDCLK;
+       I915_WRITE(_FDI_RXA_CTL, val);
+
+       val = I915_READ(_FDI_RXA_CTL);
+       val &= ~FDI_RX_PLL_ENABLE;
+       I915_WRITE(_FDI_RXA_CTL, val);
+}
+
 static void intel_ddi_hot_plug(struct intel_encoder *intel_encoder)
 {
        struct intel_dp *intel_dp = enc_to_intel_dp(&intel_encoder->base);
index 417fb4a642e9d48b4b471760b83ef241daf046b8..eeab3ae780cca23256899960e769e47381225d1b 100644 (file)
@@ -3632,9 +3632,8 @@ static void haswell_crtc_disable(struct drm_crtc *crtc)
                        encoder->post_disable(encoder);
 
        if (is_pch_port) {
-               ironlake_fdi_disable(crtc);
                lpt_disable_pch_transcoder(dev_priv);
-               ironlake_fdi_pll_disable(intel_crtc);
+               intel_ddi_fdi_disable(crtc);
        }
 
        intel_crtc->active = false;
index 08238ef92b4084ef08673909f11c8f17de3fe645..bcc52412810fc84c1d4b45687d8ee98ec5512193 100644 (file)
@@ -662,6 +662,8 @@ extern bool intel_ddi_pll_mode_set(struct drm_crtc *crtc, int clock);
 extern void intel_ddi_put_crtc_pll(struct drm_crtc *crtc);
 extern void intel_ddi_set_pipe_settings(struct drm_crtc *crtc);
 extern void intel_ddi_prepare_link_retrain(struct drm_encoder *encoder);
-bool intel_ddi_connector_get_hw_state(struct intel_connector *intel_connector);
+extern bool
+intel_ddi_connector_get_hw_state(struct intel_connector *intel_connector);
+extern void intel_ddi_fdi_disable(struct drm_crtc *crtc);
 
 #endif /* __INTEL_DRV_H__ */