diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-10-03 05:56:11 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-10-03 05:56:11 -0400 |
commit | 58e10eb92d36a62568349d985c9140d9be16a99c (patch) | |
tree | 6ffaf65e64db390f6a28c1dca8c43d4eb1493f94 /drivers/gpu/drm/i915/intel_dp.c | |
parent | 1cdf7fef793c715d8c4998575aba3741fa4a0b01 (diff) | |
parent | ab7ad7f6451580aa7eccc0ba62807c872088a8f9 (diff) |
Merge branch 'drm-intel-fixes' into drm-intel-next
Conflicts:
drivers/gpu/drm/i915/i915_gem_evict.c
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_dp.c
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dp.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index d19334aa66ad..9e8fe122b0af 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -1186,25 +1186,22 @@ intel_channel_eq_ok(struct intel_dp *intel_dp) | |||
1186 | static bool | 1186 | static bool |
1187 | intel_dp_set_link_train(struct intel_dp *intel_dp, | 1187 | intel_dp_set_link_train(struct intel_dp *intel_dp, |
1188 | uint32_t dp_reg_value, | 1188 | uint32_t dp_reg_value, |
1189 | uint8_t dp_train_pat, | 1189 | uint8_t dp_train_pat) |
1190 | bool first) | ||
1191 | { | 1190 | { |
1192 | struct drm_device *dev = intel_dp->base.base.dev; | 1191 | struct drm_device *dev = intel_dp->base.base.dev; |
1193 | struct drm_i915_private *dev_priv = dev->dev_private; | 1192 | struct drm_i915_private *dev_priv = dev->dev_private; |
1194 | struct intel_crtc *intel_crtc = to_intel_crtc(intel_dp->base.base.crtc); | ||
1195 | int ret; | 1193 | int ret; |
1196 | 1194 | ||
1197 | I915_WRITE(intel_dp->output_reg, dp_reg_value); | 1195 | I915_WRITE(intel_dp->output_reg, dp_reg_value); |
1198 | POSTING_READ(intel_dp->output_reg); | 1196 | POSTING_READ(intel_dp->output_reg); |
1199 | if (first) | ||
1200 | intel_wait_for_vblank(dev, intel_crtc->pipe); | ||
1201 | 1197 | ||
1202 | intel_dp_aux_native_write_1(intel_dp, | 1198 | intel_dp_aux_native_write_1(intel_dp, |
1203 | DP_TRAINING_PATTERN_SET, | 1199 | DP_TRAINING_PATTERN_SET, |
1204 | dp_train_pat); | 1200 | dp_train_pat); |
1205 | 1201 | ||
1206 | ret = intel_dp_aux_native_write(intel_dp, | 1202 | ret = intel_dp_aux_native_write(intel_dp, |
1207 | DP_TRAINING_LANE0_SET, intel_dp->train_set, 4); | 1203 | DP_TRAINING_LANE0_SET, |
1204 | intel_dp->train_set, 4); | ||
1208 | if (ret != 4) | 1205 | if (ret != 4) |
1209 | return false; | 1206 | return false; |
1210 | 1207 | ||
@@ -1216,14 +1213,20 @@ static void | |||
1216 | intel_dp_start_link_train(struct intel_dp *intel_dp) | 1213 | intel_dp_start_link_train(struct intel_dp *intel_dp) |
1217 | { | 1214 | { |
1218 | struct drm_device *dev = intel_dp->base.base.dev; | 1215 | struct drm_device *dev = intel_dp->base.base.dev; |
1216 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
1217 | struct intel_crtc *intel_crtc = to_intel_crtc(intel_dp->base.base.crtc); | ||
1219 | int i; | 1218 | int i; |
1220 | uint8_t voltage; | 1219 | uint8_t voltage; |
1221 | bool clock_recovery = false; | 1220 | bool clock_recovery = false; |
1222 | bool first = true; | ||
1223 | int tries; | 1221 | int tries; |
1224 | u32 reg; | 1222 | u32 reg; |
1225 | uint32_t DP = intel_dp->DP; | 1223 | uint32_t DP = intel_dp->DP; |
1226 | 1224 | ||
1225 | /* Enable output, wait for it to become active */ | ||
1226 | I915_WRITE(intel_dp->output_reg, intel_dp->DP); | ||
1227 | POSTING_READ(intel_dp->output_reg); | ||
1228 | intel_wait_for_vblank(dev, intel_crtc->pipe); | ||
1229 | |||
1227 | /* Write the link configuration data */ | 1230 | /* Write the link configuration data */ |
1228 | intel_dp_aux_native_write(intel_dp, DP_LINK_BW_SET, | 1231 | intel_dp_aux_native_write(intel_dp, DP_LINK_BW_SET, |
1229 | intel_dp->link_configuration, | 1232 | intel_dp->link_configuration, |
@@ -1255,9 +1258,8 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) | |||
1255 | reg = DP | DP_LINK_TRAIN_PAT_1; | 1258 | reg = DP | DP_LINK_TRAIN_PAT_1; |
1256 | 1259 | ||
1257 | if (!intel_dp_set_link_train(intel_dp, reg, | 1260 | if (!intel_dp_set_link_train(intel_dp, reg, |
1258 | DP_TRAINING_PATTERN_1, first)) | 1261 | DP_TRAINING_PATTERN_1)) |
1259 | break; | 1262 | break; |
1260 | first = false; | ||
1261 | /* Set training pattern 1 */ | 1263 | /* Set training pattern 1 */ |
1262 | 1264 | ||
1263 | udelay(100); | 1265 | udelay(100); |
@@ -1324,8 +1326,7 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp) | |||
1324 | 1326 | ||
1325 | /* channel eq pattern */ | 1327 | /* channel eq pattern */ |
1326 | if (!intel_dp_set_link_train(intel_dp, reg, | 1328 | if (!intel_dp_set_link_train(intel_dp, reg, |
1327 | DP_TRAINING_PATTERN_2, | 1329 | DP_TRAINING_PATTERN_2)) |
1328 | false)) | ||
1329 | break; | 1330 | break; |
1330 | 1331 | ||
1331 | udelay(400); | 1332 | udelay(400); |