aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorYuanhan Liu <yuanhan.liu@linux.intel.com>2011-01-06 05:26:08 -0500
committerChris Wilson <chris@chris-wilson.co.uk>2011-01-11 15:26:54 -0500
commit3c5a62b5226ca5db993660281e9c2a7275d9fb02 (patch)
tree639ea9917704df4f580926abcfefd5f5fe466025 /drivers
parentf5afcd3dd0dca7fe869311c51da54d5a889191ba (diff)
drm/i915: fix calculation of eDP signal levels on Sandybridge
Some voltage swing/pre-emphasis level use the same value on eDP Sandybridge, like 400mv_0db and 600mv_0db are with the same value of (0x0 << 22). So, fix them, and point out the value if it isn't a supported voltage swing/pre-emphasis level. Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: stable@kernel.org
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/i915_reg.h9
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c23
2 files changed, 21 insertions, 11 deletions
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 8f948a6fbc1c..677eca65a4bc 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -3174,10 +3174,11 @@
3174#define EDP_LINK_TRAIN_600MV_3_5DB_SNB_A (0x01<<22) 3174#define EDP_LINK_TRAIN_600MV_3_5DB_SNB_A (0x01<<22)
3175#define EDP_LINK_TRAIN_800MV_0DB_SNB_A (0x0<<22) 3175#define EDP_LINK_TRAIN_800MV_0DB_SNB_A (0x0<<22)
3176/* SNB B-stepping */ 3176/* SNB B-stepping */
3177#define EDP_LINK_TRAIN_400MV_0DB_SNB_B (0x0<<22) 3177#define EDP_LINK_TRAIN_400_600MV_0DB_SNB_B (0x0<<22)
3178#define EDP_LINK_TRAIN_400MV_6DB_SNB_B (0x3a<<22) 3178#define EDP_LINK_TRAIN_400MV_3_5DB_SNB_B (0x1<<22)
3179#define EDP_LINK_TRAIN_600MV_3_5DB_SNB_B (0x39<<22) 3179#define EDP_LINK_TRAIN_400_600MV_6DB_SNB_B (0x3a<<22)
3180#define EDP_LINK_TRAIN_800MV_0DB_SNB_B (0x38<<22) 3180#define EDP_LINK_TRAIN_600_800MV_3_5DB_SNB_B (0x39<<22)
3181#define EDP_LINK_TRAIN_800_1200MV_0DB_SNB_B (0x38<<22)
3181#define EDP_LINK_TRAIN_VOL_EMP_MASK_SNB (0x3f<<22) 3182#define EDP_LINK_TRAIN_VOL_EMP_MASK_SNB (0x3f<<22)
3182 3183
3183#define FORCEWAKE 0xA18C 3184#define FORCEWAKE 0xA18C
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index c768e30e5e85..1f4242b682c8 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1153,18 +1153,27 @@ intel_dp_signal_levels(uint8_t train_set, int lane_count)
1153static uint32_t 1153static uint32_t
1154intel_gen6_edp_signal_levels(uint8_t train_set) 1154intel_gen6_edp_signal_levels(uint8_t train_set)
1155{ 1155{
1156 switch (train_set & (DP_TRAIN_VOLTAGE_SWING_MASK|DP_TRAIN_PRE_EMPHASIS_MASK)) { 1156 int signal_levels = train_set & (DP_TRAIN_VOLTAGE_SWING_MASK |
1157 DP_TRAIN_PRE_EMPHASIS_MASK);
1158 switch (signal_levels) {
1157 case DP_TRAIN_VOLTAGE_SWING_400 | DP_TRAIN_PRE_EMPHASIS_0: 1159 case DP_TRAIN_VOLTAGE_SWING_400 | DP_TRAIN_PRE_EMPHASIS_0:
1158 return EDP_LINK_TRAIN_400MV_0DB_SNB_B; 1160 case DP_TRAIN_VOLTAGE_SWING_600 | DP_TRAIN_PRE_EMPHASIS_0:
1161 return EDP_LINK_TRAIN_400_600MV_0DB_SNB_B;
1162 case DP_TRAIN_VOLTAGE_SWING_400 | DP_TRAIN_PRE_EMPHASIS_3_5:
1163 return EDP_LINK_TRAIN_400MV_3_5DB_SNB_B;
1159 case DP_TRAIN_VOLTAGE_SWING_400 | DP_TRAIN_PRE_EMPHASIS_6: 1164 case DP_TRAIN_VOLTAGE_SWING_400 | DP_TRAIN_PRE_EMPHASIS_6:
1160 return EDP_LINK_TRAIN_400MV_6DB_SNB_B; 1165 case DP_TRAIN_VOLTAGE_SWING_600 | DP_TRAIN_PRE_EMPHASIS_6:
1166 return EDP_LINK_TRAIN_400_600MV_6DB_SNB_B;
1161 case DP_TRAIN_VOLTAGE_SWING_600 | DP_TRAIN_PRE_EMPHASIS_3_5: 1167 case DP_TRAIN_VOLTAGE_SWING_600 | DP_TRAIN_PRE_EMPHASIS_3_5:
1162 return EDP_LINK_TRAIN_600MV_3_5DB_SNB_B; 1168 case DP_TRAIN_VOLTAGE_SWING_800 | DP_TRAIN_PRE_EMPHASIS_3_5:
1169 return EDP_LINK_TRAIN_600_800MV_3_5DB_SNB_B;
1163 case DP_TRAIN_VOLTAGE_SWING_800 | DP_TRAIN_PRE_EMPHASIS_0: 1170 case DP_TRAIN_VOLTAGE_SWING_800 | DP_TRAIN_PRE_EMPHASIS_0:
1164 return EDP_LINK_TRAIN_800MV_0DB_SNB_B; 1171 case DP_TRAIN_VOLTAGE_SWING_1200 | DP_TRAIN_PRE_EMPHASIS_0:
1172 return EDP_LINK_TRAIN_800_1200MV_0DB_SNB_B;
1165 default: 1173 default:
1166 DRM_DEBUG_KMS("Unsupported voltage swing/pre-emphasis level\n"); 1174 DRM_DEBUG_KMS("Unsupported voltage swing/pre-emphasis level:"
1167 return EDP_LINK_TRAIN_400MV_0DB_SNB_B; 1175 "0x%x\n", signal_levels);
1176 return EDP_LINK_TRAIN_400_600MV_0DB_SNB_B;
1168 } 1177 }
1169} 1178}
1170 1179