drm/i915: Move VLV HDMI lane reset work around logic to intel_dpio_phy.c
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Wed, 27 Apr 2016 12:44:25 +0000 (15:44 +0300)
committerAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Fri, 29 Apr 2016 06:59:00 +0000 (09:59 +0300)
This moves the last phy specific code from the encoders to the phy
specific file.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Reviewed-by: Jim Bride <jim.bride@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1461761065-21195-11-git-send-email-ander.conselvan.de.oliveira@intel.com
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_dpio_phy.c
drivers/gpu/drm/i915/intel_hdmi.c

index edde8970f1a6ee9b32f8760b675d6bb3b048d39b..7d15930b69b1a5cb7ad1adce017132b57ba7bce5 100644 (file)
@@ -3605,6 +3605,7 @@ void vlv_set_phy_signal_level(struct intel_encoder *encoder,
                              u32 uniqtranscale_reg_value, u32 tx3_demph);
 void vlv_phy_pre_pll_enable(struct intel_encoder *encoder);
 void vlv_phy_pre_encoder_enable(struct intel_encoder *encoder);
+void vlv_phy_reset_lanes(struct intel_encoder *encoder);
 
 int intel_gpu_freq(struct drm_i915_private *dev_priv, int val);
 int intel_freq_opcode(struct drm_i915_private *dev_priv, int val);
index 2c14bf035a0b6a0ea9eac030a273dc560d2c4d90..288da35572b45ff694dace802f0b1910f782b872 100644 (file)
@@ -453,3 +453,18 @@ void vlv_phy_pre_encoder_enable(struct intel_encoder *encoder)
 
        mutex_unlock(&dev_priv->sb_lock);
 }
+
+void vlv_phy_reset_lanes(struct intel_encoder *encoder)
+{
+       struct intel_digital_port *dport = enc_to_dig_port(&encoder->base);
+       struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;
+       struct intel_crtc *intel_crtc =
+               to_intel_crtc(encoder->base.crtc);
+       enum dpio_channel port = vlv_dport_to_channel(dport);
+       int pipe = intel_crtc->pipe;
+
+       mutex_lock(&dev_priv->sb_lock);
+       vlv_dpio_write(dev_priv, pipe, VLV_PCS_DW0(port), 0x00000000);
+       vlv_dpio_write(dev_priv, pipe, VLV_PCS_DW1(port), 0x00e00060);
+       mutex_unlock(&dev_priv->sb_lock);
+}
index 11be19ee5aa53c339c42b88c45cc6dc99e088cf8..e1012d6120244848649c9cc102efb214fd907264 100644 (file)
@@ -1631,18 +1631,8 @@ static void chv_hdmi_post_pll_disable(struct intel_encoder *encoder)
 
 static void vlv_hdmi_post_disable(struct intel_encoder *encoder)
 {
-       struct intel_digital_port *dport = enc_to_dig_port(&encoder->base);
-       struct drm_i915_private *dev_priv = encoder->base.dev->dev_private;
-       struct intel_crtc *intel_crtc =
-               to_intel_crtc(encoder->base.crtc);
-       enum dpio_channel port = vlv_dport_to_channel(dport);
-       int pipe = intel_crtc->pipe;
-
        /* Reset lanes to avoid HDMI flicker (VLV w/a) */
-       mutex_lock(&dev_priv->sb_lock);
-       vlv_dpio_write(dev_priv, pipe, VLV_PCS_DW0(port), 0x00000000);
-       vlv_dpio_write(dev_priv, pipe, VLV_PCS_DW1(port), 0x00e00060);
-       mutex_unlock(&dev_priv->sb_lock);
+       vlv_phy_reset_lanes(encoder);
 }
 
 static void chv_hdmi_post_disable(struct intel_encoder *encoder)