aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_dp.c
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2014-04-09 06:29:03 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-05-20 09:52:38 -0400
commitf72df8dbe2211cf2b70e54f8e9408b889fa56974 (patch)
treefc8900ccbbd5ab19e78a79ea7edd426d4ede33f0 /drivers/gpu/drm/i915/intel_dp.c
parent97fd4d5c81af7976b4ec9971a93bf3c361066c65 (diff)
drm/i915/chv: Don't do group access reads from TX lanes either
Like PCS, TX group reads return 0xffffffff. So we need to target each lane separately if we want to use RMW cycles to update the registers. 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_dp.c')
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c49
1 files changed, 31 insertions, 18 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index d98de3c18621..f36904c14666 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2311,10 +2311,11 @@ static uint32_t intel_chv_signal_levels(struct intel_dp *intel_dp)
2311 struct drm_i915_private *dev_priv = dev->dev_private; 2311 struct drm_i915_private *dev_priv = dev->dev_private;
2312 struct intel_digital_port *dport = dp_to_dig_port(intel_dp); 2312 struct intel_digital_port *dport = dp_to_dig_port(intel_dp);
2313 struct intel_crtc *intel_crtc = to_intel_crtc(dport->base.base.crtc); 2313 struct intel_crtc *intel_crtc = to_intel_crtc(dport->base.base.crtc);
2314 u32 deemph_reg_value, margin_reg_value, val, tx_dw2; 2314 u32 deemph_reg_value, margin_reg_value, val;
2315 uint8_t train_set = intel_dp->train_set[0]; 2315 uint8_t train_set = intel_dp->train_set[0];
2316 enum dpio_channel ch = vlv_dport_to_channel(dport); 2316 enum dpio_channel ch = vlv_dport_to_channel(dport);
2317 int pipe = intel_crtc->pipe; 2317 enum pipe pipe = intel_crtc->pipe;
2318 int i;
2318 2319
2319 switch (train_set & DP_TRAIN_PRE_EMPHASIS_MASK) { 2320 switch (train_set & DP_TRAIN_PRE_EMPHASIS_MASK) {
2320 case DP_TRAIN_PRE_EMPHASIS_0: 2321 case DP_TRAIN_PRE_EMPHASIS_0:
@@ -2392,21 +2393,27 @@ static uint32_t intel_chv_signal_levels(struct intel_dp *intel_dp)
2392 vlv_dpio_write(dev_priv, pipe, CHV_PCS_DW10(ch), 0); 2393 vlv_dpio_write(dev_priv, pipe, CHV_PCS_DW10(ch), 0);
2393 2394
2394 /* Program swing deemph */ 2395 /* Program swing deemph */
2395 val = vlv_dpio_read(dev_priv, pipe, VLV_TX_DW4(ch)); 2396 for (i = 0; i < 4; i++) {
2396 val &= ~DPIO_SWING_DEEMPH9P5_MASK; 2397 val = vlv_dpio_read(dev_priv, pipe, CHV_TX_DW4(ch, i));
2397 val |= deemph_reg_value << DPIO_SWING_DEEMPH9P5_SHIFT; 2398 val &= ~DPIO_SWING_DEEMPH9P5_MASK;
2398 vlv_dpio_write(dev_priv, pipe, VLV_TX_DW4(ch), val); 2399 val |= deemph_reg_value << DPIO_SWING_DEEMPH9P5_SHIFT;
2400 vlv_dpio_write(dev_priv, pipe, CHV_TX_DW4(ch, i), val);
2401 }
2399 2402
2400 /* Program swing margin */ 2403 /* Program swing margin */
2401 tx_dw2 = vlv_dpio_read(dev_priv, pipe, VLV_TX_DW2(ch)); 2404 for (i = 0; i < 4; i++) {
2402 tx_dw2 &= ~DPIO_SWING_MARGIN_MASK; 2405 val = vlv_dpio_read(dev_priv, pipe, CHV_TX_DW2(ch, i));
2403 tx_dw2 |= margin_reg_value << DPIO_SWING_MARGIN_SHIFT; 2406 val &= ~DPIO_SWING_MARGIN_MASK;
2404 vlv_dpio_write(dev_priv, pipe, VLV_TX_DW2(ch), tx_dw2); 2407 val |= margin_reg_value << DPIO_SWING_MARGIN_SHIFT;
2408 vlv_dpio_write(dev_priv, pipe, CHV_TX_DW2(ch, i), val);
2409 }
2405 2410
2406 /* Disable unique transition scale */ 2411 /* Disable unique transition scale */
2407 val = vlv_dpio_read(dev_priv, pipe, VLV_TX_DW3(ch)); 2412 for (i = 0; i < 4; i++) {
2408 val &= ~DPIO_TX_UNIQ_TRANS_SCALE_EN; 2413 val = vlv_dpio_read(dev_priv, pipe, CHV_TX_DW3(ch, i));
2409 vlv_dpio_write(dev_priv, pipe, VLV_TX_DW3(ch), val); 2414 val &= ~DPIO_TX_UNIQ_TRANS_SCALE_EN;
2415 vlv_dpio_write(dev_priv, pipe, CHV_TX_DW3(ch, i), val);
2416 }
2410 2417
2411 if (((train_set & DP_TRAIN_PRE_EMPHASIS_MASK) 2418 if (((train_set & DP_TRAIN_PRE_EMPHASIS_MASK)
2412 == DP_TRAIN_PRE_EMPHASIS_0) && 2419 == DP_TRAIN_PRE_EMPHASIS_0) &&
@@ -2419,12 +2426,18 @@ static uint32_t intel_chv_signal_levels(struct intel_dp *intel_dp)
2419 * For now, for this unique transition scale selection, set bit 2426 * For now, for this unique transition scale selection, set bit
2420 * 27 for ch0 and ch1. 2427 * 27 for ch0 and ch1.
2421 */ 2428 */
2422 val = vlv_dpio_read(dev_priv, pipe, VLV_TX_DW3(ch)); 2429 for (i = 0; i < 4; i++) {
2423 val |= DPIO_TX_UNIQ_TRANS_SCALE_EN; 2430 val = vlv_dpio_read(dev_priv, pipe, CHV_TX_DW3(ch, i));
2424 vlv_dpio_write(dev_priv, pipe, VLV_TX_DW3(ch), val); 2431 val |= DPIO_TX_UNIQ_TRANS_SCALE_EN;
2432 vlv_dpio_write(dev_priv, pipe, CHV_TX_DW3(ch, i), val);
2433 }
2425 2434
2426 tx_dw2 |= (0x9a << DPIO_UNIQ_TRANS_SCALE_SHIFT); 2435 for (i = 0; i < 4; i++) {
2427 vlv_dpio_write(dev_priv, pipe, VLV_TX_DW2(ch), tx_dw2); 2436 val = vlv_dpio_read(dev_priv, pipe, CHV_TX_DW2(ch, i));
2437 val &= ~(0xff << DPIO_UNIQ_TRANS_SCALE_SHIFT);
2438 val |= (0x9a << DPIO_UNIQ_TRANS_SCALE_SHIFT);
2439 vlv_dpio_write(dev_priv, pipe, CHV_TX_DW2(ch, i), val);
2440 }
2428 } 2441 }
2429 2442
2430 /* Start swing calculation */ 2443 /* Start swing calculation */