aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_dp.c
diff options
context:
space:
mode:
authorChon Ming Lee <chon.ming.lee@intel.com>2013-09-05 08:41:49 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-09-05 09:04:36 -0400
commit5e69f97fb39ea660075e6b65a1de33247b53f9d4 (patch)
treed1fc135073c4fd4336c5ae5fd7ece4022246e447 /drivers/gpu/drm/i915/intel_dp.c
parent3c0e234c847318304c12f9e7fffac7e1cf3db3ff (diff)
drm/i915: Add additional pipe parameter for vlv_dpio_read and vlv_dpio_write. v2
The patch doesn't contain functional change, but is to prepare for future platform which has different DPIO phy. The additional pipe parameter will use to select which phy to target for. v2: Update the commit message and add static for the new function. (Jani/Ville) Signed-off-by: Chon Ming Lee <chon.ming.lee@intel.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dp.c')
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c38
1 files changed, 22 insertions, 16 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index c192dbb8a36c..d6eba380ee2e 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1746,16 +1746,16 @@ static void vlv_pre_enable_dp(struct intel_encoder *encoder)
1746 1746
1747 mutex_lock(&dev_priv->dpio_lock); 1747 mutex_lock(&dev_priv->dpio_lock);
1748 1748
1749 val = vlv_dpio_read(dev_priv, DPIO_DATA_LANE_A(port)); 1749 val = vlv_dpio_read(dev_priv, pipe, DPIO_DATA_LANE_A(port));
1750 val = 0; 1750 val = 0;
1751 if (pipe) 1751 if (pipe)
1752 val |= (1<<21); 1752 val |= (1<<21);
1753 else 1753 else
1754 val &= ~(1<<21); 1754 val &= ~(1<<21);
1755 val |= 0x001000c4; 1755 val |= 0x001000c4;
1756 vlv_dpio_write(dev_priv, DPIO_DATA_CHANNEL(port), val); 1756 vlv_dpio_write(dev_priv, pipe, DPIO_DATA_CHANNEL(port), val);
1757 vlv_dpio_write(dev_priv, DPIO_PCS_CLOCKBUF0(port), 0x00760018); 1757 vlv_dpio_write(dev_priv, pipe, DPIO_PCS_CLOCKBUF0(port), 0x00760018);
1758 vlv_dpio_write(dev_priv, DPIO_PCS_CLOCKBUF8(port), 0x00400888); 1758 vlv_dpio_write(dev_priv, pipe, DPIO_PCS_CLOCKBUF8(port), 0x00400888);
1759 1759
1760 mutex_unlock(&dev_priv->dpio_lock); 1760 mutex_unlock(&dev_priv->dpio_lock);
1761 1761
@@ -1769,26 +1769,29 @@ static void intel_dp_pre_pll_enable(struct intel_encoder *encoder)
1769 struct intel_digital_port *dport = enc_to_dig_port(&encoder->base); 1769 struct intel_digital_port *dport = enc_to_dig_port(&encoder->base);
1770 struct drm_device *dev = encoder->base.dev; 1770 struct drm_device *dev = encoder->base.dev;
1771 struct drm_i915_private *dev_priv = dev->dev_private; 1771 struct drm_i915_private *dev_priv = dev->dev_private;
1772 struct intel_crtc *intel_crtc =
1773 to_intel_crtc(encoder->base.crtc);
1772 int port = vlv_dport_to_channel(dport); 1774 int port = vlv_dport_to_channel(dport);
1775 int pipe = intel_crtc->pipe;
1773 1776
1774 if (!IS_VALLEYVIEW(dev)) 1777 if (!IS_VALLEYVIEW(dev))
1775 return; 1778 return;
1776 1779
1777 /* Program Tx lane resets to default */ 1780 /* Program Tx lane resets to default */
1778 mutex_lock(&dev_priv->dpio_lock); 1781 mutex_lock(&dev_priv->dpio_lock);
1779 vlv_dpio_write(dev_priv, DPIO_PCS_TX(port), 1782 vlv_dpio_write(dev_priv, pipe, DPIO_PCS_TX(port),
1780 DPIO_PCS_TX_LANE2_RESET | 1783 DPIO_PCS_TX_LANE2_RESET |
1781 DPIO_PCS_TX_LANE1_RESET); 1784 DPIO_PCS_TX_LANE1_RESET);
1782 vlv_dpio_write(dev_priv, DPIO_PCS_CLK(port), 1785 vlv_dpio_write(dev_priv, pipe, DPIO_PCS_CLK(port),
1783 DPIO_PCS_CLK_CRI_RXEB_EIOS_EN | 1786 DPIO_PCS_CLK_CRI_RXEB_EIOS_EN |
1784 DPIO_PCS_CLK_CRI_RXDIGFILTSG_EN | 1787 DPIO_PCS_CLK_CRI_RXDIGFILTSG_EN |
1785 (1<<DPIO_PCS_CLK_DATAWIDTH_SHIFT) | 1788 (1<<DPIO_PCS_CLK_DATAWIDTH_SHIFT) |
1786 DPIO_PCS_CLK_SOFT_RESET); 1789 DPIO_PCS_CLK_SOFT_RESET);
1787 1790
1788 /* Fix up inter-pair skew failure */ 1791 /* Fix up inter-pair skew failure */
1789 vlv_dpio_write(dev_priv, DPIO_PCS_STAGGER1(port), 0x00750f00); 1792 vlv_dpio_write(dev_priv, pipe, DPIO_PCS_STAGGER1(port), 0x00750f00);
1790 vlv_dpio_write(dev_priv, DPIO_TX_CTL(port), 0x00001500); 1793 vlv_dpio_write(dev_priv, pipe, DPIO_TX_CTL(port), 0x00001500);
1791 vlv_dpio_write(dev_priv, DPIO_TX_LANE(port), 0x40400000); 1794 vlv_dpio_write(dev_priv, pipe, DPIO_TX_LANE(port), 0x40400000);
1792 mutex_unlock(&dev_priv->dpio_lock); 1795 mutex_unlock(&dev_priv->dpio_lock);
1793} 1796}
1794 1797
@@ -1923,10 +1926,13 @@ static uint32_t intel_vlv_signal_levels(struct intel_dp *intel_dp)
1923 struct drm_device *dev = intel_dp_to_dev(intel_dp); 1926 struct drm_device *dev = intel_dp_to_dev(intel_dp);
1924 struct drm_i915_private *dev_priv = dev->dev_private; 1927 struct drm_i915_private *dev_priv = dev->dev_private;
1925 struct intel_digital_port *dport = dp_to_dig_port(intel_dp); 1928 struct intel_digital_port *dport = dp_to_dig_port(intel_dp);
1929 struct intel_crtc *intel_crtc =
1930 to_intel_crtc(dport->base.base.crtc);
1926 unsigned long demph_reg_value, preemph_reg_value, 1931 unsigned long demph_reg_value, preemph_reg_value,
1927 uniqtranscale_reg_value; 1932 uniqtranscale_reg_value;
1928 uint8_t train_set = intel_dp->train_set[0]; 1933 uint8_t train_set = intel_dp->train_set[0];
1929 int port = vlv_dport_to_channel(dport); 1934 int port = vlv_dport_to_channel(dport);
1935 int pipe = intel_crtc->pipe;
1930 1936
1931 switch (train_set & DP_TRAIN_PRE_EMPHASIS_MASK) { 1937 switch (train_set & DP_TRAIN_PRE_EMPHASIS_MASK) {
1932 case DP_TRAIN_PRE_EMPHASIS_0: 1938 case DP_TRAIN_PRE_EMPHASIS_0:
@@ -2002,14 +2008,14 @@ static uint32_t intel_vlv_signal_levels(struct intel_dp *intel_dp)
2002 } 2008 }
2003 2009
2004 mutex_lock(&dev_priv->dpio_lock); 2010 mutex_lock(&dev_priv->dpio_lock);
2005 vlv_dpio_write(dev_priv, DPIO_TX_OCALINIT(port), 0x00000000); 2011 vlv_dpio_write(dev_priv, pipe, DPIO_TX_OCALINIT(port), 0x00000000);
2006 vlv_dpio_write(dev_priv, DPIO_TX_SWING_CTL4(port), demph_reg_value); 2012 vlv_dpio_write(dev_priv, pipe, DPIO_TX_SWING_CTL4(port), demph_reg_value);
2007 vlv_dpio_write(dev_priv, DPIO_TX_SWING_CTL2(port), 2013 vlv_dpio_write(dev_priv, pipe, DPIO_TX_SWING_CTL2(port),
2008 uniqtranscale_reg_value); 2014 uniqtranscale_reg_value);
2009 vlv_dpio_write(dev_priv, DPIO_TX_SWING_CTL3(port), 0x0C782040); 2015 vlv_dpio_write(dev_priv, pipe, DPIO_TX_SWING_CTL3(port), 0x0C782040);
2010 vlv_dpio_write(dev_priv, DPIO_PCS_STAGGER0(port), 0x00030000); 2016 vlv_dpio_write(dev_priv, pipe, DPIO_PCS_STAGGER0(port), 0x00030000);
2011 vlv_dpio_write(dev_priv, DPIO_PCS_CTL_OVER1(port), preemph_reg_value); 2017 vlv_dpio_write(dev_priv, pipe, DPIO_PCS_CTL_OVER1(port), preemph_reg_value);
2012 vlv_dpio_write(dev_priv, DPIO_TX_OCALINIT(port), 0x80000000); 2018 vlv_dpio_write(dev_priv, pipe, DPIO_TX_OCALINIT(port), 0x80000000);
2013 mutex_unlock(&dev_priv->dpio_lock); 2019 mutex_unlock(&dev_priv->dpio_lock);
2014 2020
2015 return 0; 2021 return 0;