aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_hdmi.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2014-04-09 06:29:05 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-06-11 10:57:29 -0400
commit9197c88bf946cf792ad5124f00bd51a0bc18f8c2 (patch)
treefc3f7a0357006194bd7b7dd06ba59f7bc249f22b /drivers/gpu/drm/i915/intel_hdmi.c
parent13a5660c137e4c9ca88e0bb20d518eff016bcfbc (diff)
drm/i915/chv: Try to program the PHY used clock channel overrides
These should make it possible to feed port C from pipe A or port B from pipe B. Didn't quite seem to work though. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_hdmi.c')
-rw-r--r--drivers/gpu/drm/i915/intel_hdmi.c46
1 files changed, 46 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index eee2bbec2958..8da29d158315 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -1229,6 +1229,51 @@ static void vlv_hdmi_pre_pll_enable(struct intel_encoder *encoder)
1229 mutex_unlock(&dev_priv->dpio_lock); 1229 mutex_unlock(&dev_priv->dpio_lock);
1230} 1230}
1231 1231
1232static void chv_hdmi_pre_pll_enable(struct intel_encoder *encoder)
1233{
1234 struct intel_digital_port *dport = enc_to_dig_port(&encoder->base);
1235 struct drm_device *dev = encoder->base.dev;
1236 struct drm_i915_private *dev_priv = dev->dev_private;
1237 struct intel_crtc *intel_crtc =
1238 to_intel_crtc(encoder->base.crtc);
1239 enum dpio_channel ch = vlv_dport_to_channel(dport);
1240 enum pipe pipe = intel_crtc->pipe;
1241 u32 val;
1242
1243 mutex_lock(&dev_priv->dpio_lock);
1244
1245 /* program clock channel usage */
1246 val = vlv_dpio_read(dev_priv, pipe, VLV_PCS01_DW8(ch));
1247 val |= CHV_PCS_USEDCLKCHANNEL_OVRRIDE;
1248 if (pipe != PIPE_B)
1249 val &= ~CHV_PCS_USEDCLKCHANNEL;
1250 else
1251 val |= CHV_PCS_USEDCLKCHANNEL;
1252 vlv_dpio_write(dev_priv, pipe, VLV_PCS01_DW8(ch), val);
1253
1254 val = vlv_dpio_read(dev_priv, pipe, VLV_PCS23_DW8(ch));
1255 val |= CHV_PCS_USEDCLKCHANNEL_OVRRIDE;
1256 if (pipe != PIPE_B)
1257 val &= ~CHV_PCS_USEDCLKCHANNEL;
1258 else
1259 val |= CHV_PCS_USEDCLKCHANNEL;
1260 vlv_dpio_write(dev_priv, pipe, VLV_PCS23_DW8(ch), val);
1261
1262 /*
1263 * This a a bit weird since generally CL
1264 * matches the pipe, but here we need to
1265 * pick the CL based on the port.
1266 */
1267 val = vlv_dpio_read(dev_priv, pipe, CHV_CMN_DW19(ch));
1268 if (pipe != PIPE_B)
1269 val &= ~CHV_CMN_USEDCLKCHANNEL;
1270 else
1271 val |= CHV_CMN_USEDCLKCHANNEL;
1272 vlv_dpio_write(dev_priv, pipe, CHV_CMN_DW19(ch), val);
1273
1274 mutex_unlock(&dev_priv->dpio_lock);
1275}
1276
1232static void vlv_hdmi_post_disable(struct intel_encoder *encoder) 1277static void vlv_hdmi_post_disable(struct intel_encoder *encoder)
1233{ 1278{
1234 struct intel_digital_port *dport = enc_to_dig_port(&encoder->base); 1279 struct intel_digital_port *dport = enc_to_dig_port(&encoder->base);
@@ -1528,6 +1573,7 @@ void intel_hdmi_init(struct drm_device *dev, int hdmi_reg, enum port port)
1528 intel_encoder->get_hw_state = intel_hdmi_get_hw_state; 1573 intel_encoder->get_hw_state = intel_hdmi_get_hw_state;
1529 intel_encoder->get_config = intel_hdmi_get_config; 1574 intel_encoder->get_config = intel_hdmi_get_config;
1530 if (IS_CHERRYVIEW(dev)) { 1575 if (IS_CHERRYVIEW(dev)) {
1576 intel_encoder->pre_pll_enable = chv_hdmi_pre_pll_enable;
1531 intel_encoder->pre_enable = chv_hdmi_pre_enable; 1577 intel_encoder->pre_enable = chv_hdmi_pre_enable;
1532 intel_encoder->enable = vlv_enable_hdmi; 1578 intel_encoder->enable = vlv_enable_hdmi;
1533 intel_encoder->post_disable = chv_hdmi_post_disable; 1579 intel_encoder->post_disable = chv_hdmi_post_disable;