diff options
author | Dave Airlie <airlied@redhat.com> | 2010-11-30 21:10:34 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-11-30 21:10:34 -0500 |
commit | 150f8815bbd15c1a91f74033c048fadcd5f3c715 (patch) | |
tree | 9219890d645a1844a146d99a0820c141a44a824c /drivers/gpu | |
parent | c5027dec02c96964847fa68d512318ee5f6f7a19 (diff) | |
parent | 3cf2efb1a7c68d55d60dcb2ed9609e1a2fc25952 (diff) |
Merge remote branch 'intel/drm-intel-fixes' of /ssd/git/drm-next into drm-fixes
* 'intel/drm-intel-fixes' of /ssd/git/drm-next:
Revert "drm/i915/dp: use VBT provided eDP params if available"
drm/i915: Clear pfit registers when not used by any outputs
drm/i915: fix regression due to ba3d8d749b01548b9
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem.c | 43 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 7 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_dp.c | 146 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_drv.h | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/intel_lvds.c | 19 |
5 files changed, 92 insertions, 125 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 92b097dbe4ff..5e54821af996 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -38,8 +38,7 @@ | |||
38 | 38 | ||
39 | static uint32_t i915_gem_get_gtt_alignment(struct drm_gem_object *obj); | 39 | static uint32_t i915_gem_get_gtt_alignment(struct drm_gem_object *obj); |
40 | 40 | ||
41 | static int i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj, | 41 | static int i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj); |
42 | bool pipelined); | ||
43 | static void i915_gem_object_flush_gtt_write_domain(struct drm_gem_object *obj); | 42 | static void i915_gem_object_flush_gtt_write_domain(struct drm_gem_object *obj); |
44 | static void i915_gem_object_flush_cpu_write_domain(struct drm_gem_object *obj); | 43 | static void i915_gem_object_flush_cpu_write_domain(struct drm_gem_object *obj); |
45 | static int i915_gem_object_set_to_cpu_domain(struct drm_gem_object *obj, | 44 | static int i915_gem_object_set_to_cpu_domain(struct drm_gem_object *obj, |
@@ -2594,7 +2593,7 @@ i915_gem_object_put_fence_reg(struct drm_gem_object *obj, | |||
2594 | if (reg->gpu) { | 2593 | if (reg->gpu) { |
2595 | int ret; | 2594 | int ret; |
2596 | 2595 | ||
2597 | ret = i915_gem_object_flush_gpu_write_domain(obj, true); | 2596 | ret = i915_gem_object_flush_gpu_write_domain(obj); |
2598 | if (ret) | 2597 | if (ret) |
2599 | return ret; | 2598 | return ret; |
2600 | 2599 | ||
@@ -2742,8 +2741,7 @@ i915_gem_clflush_object(struct drm_gem_object *obj) | |||
2742 | 2741 | ||
2743 | /** Flushes any GPU write domain for the object if it's dirty. */ | 2742 | /** Flushes any GPU write domain for the object if it's dirty. */ |
2744 | static int | 2743 | static int |
2745 | i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj, | 2744 | i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj) |
2746 | bool pipelined) | ||
2747 | { | 2745 | { |
2748 | struct drm_device *dev = obj->dev; | 2746 | struct drm_device *dev = obj->dev; |
2749 | uint32_t old_write_domain; | 2747 | uint32_t old_write_domain; |
@@ -2762,10 +2760,7 @@ i915_gem_object_flush_gpu_write_domain(struct drm_gem_object *obj, | |||
2762 | obj->read_domains, | 2760 | obj->read_domains, |
2763 | old_write_domain); | 2761 | old_write_domain); |
2764 | 2762 | ||
2765 | if (pipelined) | 2763 | return 0; |
2766 | return 0; | ||
2767 | |||
2768 | return i915_gem_object_wait_rendering(obj, true); | ||
2769 | } | 2764 | } |
2770 | 2765 | ||
2771 | /** Flushes the GTT write domain for the object if it's dirty. */ | 2766 | /** Flushes the GTT write domain for the object if it's dirty. */ |
@@ -2826,18 +2821,15 @@ i915_gem_object_set_to_gtt_domain(struct drm_gem_object *obj, int write) | |||
2826 | if (obj_priv->gtt_space == NULL) | 2821 | if (obj_priv->gtt_space == NULL) |
2827 | return -EINVAL; | 2822 | return -EINVAL; |
2828 | 2823 | ||
2829 | ret = i915_gem_object_flush_gpu_write_domain(obj, false); | 2824 | ret = i915_gem_object_flush_gpu_write_domain(obj); |
2830 | if (ret != 0) | 2825 | if (ret != 0) |
2831 | return ret; | 2826 | return ret; |
2827 | ret = i915_gem_object_wait_rendering(obj, true); | ||
2828 | if (ret) | ||
2829 | return ret; | ||
2832 | 2830 | ||
2833 | i915_gem_object_flush_cpu_write_domain(obj); | 2831 | i915_gem_object_flush_cpu_write_domain(obj); |
2834 | 2832 | ||
2835 | if (write) { | ||
2836 | ret = i915_gem_object_wait_rendering(obj, true); | ||
2837 | if (ret) | ||
2838 | return ret; | ||
2839 | } | ||
2840 | |||
2841 | old_write_domain = obj->write_domain; | 2833 | old_write_domain = obj->write_domain; |
2842 | old_read_domains = obj->read_domains; | 2834 | old_read_domains = obj->read_domains; |
2843 | 2835 | ||
@@ -2875,7 +2867,7 @@ i915_gem_object_set_to_display_plane(struct drm_gem_object *obj, | |||
2875 | if (obj_priv->gtt_space == NULL) | 2867 | if (obj_priv->gtt_space == NULL) |
2876 | return -EINVAL; | 2868 | return -EINVAL; |
2877 | 2869 | ||
2878 | ret = i915_gem_object_flush_gpu_write_domain(obj, true); | 2870 | ret = i915_gem_object_flush_gpu_write_domain(obj); |
2879 | if (ret) | 2871 | if (ret) |
2880 | return ret; | 2872 | return ret; |
2881 | 2873 | ||
@@ -2924,9 +2916,12 @@ i915_gem_object_set_to_cpu_domain(struct drm_gem_object *obj, int write) | |||
2924 | uint32_t old_write_domain, old_read_domains; | 2916 | uint32_t old_write_domain, old_read_domains; |
2925 | int ret; | 2917 | int ret; |
2926 | 2918 | ||
2927 | ret = i915_gem_object_flush_gpu_write_domain(obj, false); | 2919 | ret = i915_gem_object_flush_gpu_write_domain(obj); |
2928 | if (ret != 0) | 2920 | if (ret != 0) |
2929 | return ret; | 2921 | return ret; |
2922 | ret = i915_gem_object_wait_rendering(obj, true); | ||
2923 | if (ret) | ||
2924 | return ret; | ||
2930 | 2925 | ||
2931 | i915_gem_object_flush_gtt_write_domain(obj); | 2926 | i915_gem_object_flush_gtt_write_domain(obj); |
2932 | 2927 | ||
@@ -2935,12 +2930,6 @@ i915_gem_object_set_to_cpu_domain(struct drm_gem_object *obj, int write) | |||
2935 | */ | 2930 | */ |
2936 | i915_gem_object_set_to_full_cpu_read_domain(obj); | 2931 | i915_gem_object_set_to_full_cpu_read_domain(obj); |
2937 | 2932 | ||
2938 | if (write) { | ||
2939 | ret = i915_gem_object_wait_rendering(obj, true); | ||
2940 | if (ret) | ||
2941 | return ret; | ||
2942 | } | ||
2943 | |||
2944 | old_write_domain = obj->write_domain; | 2933 | old_write_domain = obj->write_domain; |
2945 | old_read_domains = obj->read_domains; | 2934 | old_read_domains = obj->read_domains; |
2946 | 2935 | ||
@@ -3205,9 +3194,13 @@ i915_gem_object_set_cpu_read_domain_range(struct drm_gem_object *obj, | |||
3205 | if (offset == 0 && size == obj->size) | 3194 | if (offset == 0 && size == obj->size) |
3206 | return i915_gem_object_set_to_cpu_domain(obj, 0); | 3195 | return i915_gem_object_set_to_cpu_domain(obj, 0); |
3207 | 3196 | ||
3208 | ret = i915_gem_object_flush_gpu_write_domain(obj, false); | 3197 | ret = i915_gem_object_flush_gpu_write_domain(obj); |
3209 | if (ret != 0) | 3198 | if (ret != 0) |
3210 | return ret; | 3199 | return ret; |
3200 | ret = i915_gem_object_wait_rendering(obj, true); | ||
3201 | if (ret) | ||
3202 | return ret; | ||
3203 | |||
3211 | i915_gem_object_flush_gtt_write_domain(obj); | 3204 | i915_gem_object_flush_gtt_write_domain(obj); |
3212 | 3205 | ||
3213 | /* If we're already fully in the CPU read domain, we're done. */ | 3206 | /* If we're already fully in the CPU read domain, we're done. */ |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index bee24b1a58e8..255b52ee0091 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -5336,9 +5336,14 @@ static void intel_setup_outputs(struct drm_device *dev) | |||
5336 | struct drm_i915_private *dev_priv = dev->dev_private; | 5336 | struct drm_i915_private *dev_priv = dev->dev_private; |
5337 | struct intel_encoder *encoder; | 5337 | struct intel_encoder *encoder; |
5338 | bool dpd_is_edp = false; | 5338 | bool dpd_is_edp = false; |
5339 | bool has_lvds = false; | ||
5339 | 5340 | ||
5340 | if (IS_MOBILE(dev) && !IS_I830(dev)) | 5341 | if (IS_MOBILE(dev) && !IS_I830(dev)) |
5341 | intel_lvds_init(dev); | 5342 | has_lvds = intel_lvds_init(dev); |
5343 | if (!has_lvds && !HAS_PCH_SPLIT(dev)) { | ||
5344 | /* disable the panel fitter on everything but LVDS */ | ||
5345 | I915_WRITE(PFIT_CONTROL, 0); | ||
5346 | } | ||
5342 | 5347 | ||
5343 | if (HAS_PCH_SPLIT(dev)) { | 5348 | if (HAS_PCH_SPLIT(dev)) { |
5344 | dpd_is_edp = intel_dpd_is_edp(dev); | 5349 | dpd_is_edp = intel_dpd_is_edp(dev); |
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index c8e005553310..300f64b4238b 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
@@ -584,17 +584,6 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
584 | mode->clock = dev_priv->panel_fixed_mode->clock; | 584 | mode->clock = dev_priv->panel_fixed_mode->clock; |
585 | } | 585 | } |
586 | 586 | ||
587 | /* Just use VBT values for eDP */ | ||
588 | if (is_edp(intel_dp)) { | ||
589 | intel_dp->lane_count = dev_priv->edp.lanes; | ||
590 | intel_dp->link_bw = dev_priv->edp.rate; | ||
591 | adjusted_mode->clock = intel_dp_link_clock(intel_dp->link_bw); | ||
592 | DRM_DEBUG_KMS("eDP link bw %02x lane count %d clock %d\n", | ||
593 | intel_dp->link_bw, intel_dp->lane_count, | ||
594 | adjusted_mode->clock); | ||
595 | return true; | ||
596 | } | ||
597 | |||
598 | for (lane_count = 1; lane_count <= max_lane_count; lane_count <<= 1) { | 587 | for (lane_count = 1; lane_count <= max_lane_count; lane_count <<= 1) { |
599 | for (clock = 0; clock <= max_clock; clock++) { | 588 | for (clock = 0; clock <= max_clock; clock++) { |
600 | int link_avail = intel_dp_max_data_rate(intel_dp_link_clock(bws[clock]), lane_count); | 589 | int link_avail = intel_dp_max_data_rate(intel_dp_link_clock(bws[clock]), lane_count); |
@@ -613,6 +602,19 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode, | |||
613 | } | 602 | } |
614 | } | 603 | } |
615 | 604 | ||
605 | if (is_edp(intel_dp)) { | ||
606 | /* okay we failed just pick the highest */ | ||
607 | intel_dp->lane_count = max_lane_count; | ||
608 | intel_dp->link_bw = bws[max_clock]; | ||
609 | adjusted_mode->clock = intel_dp_link_clock(intel_dp->link_bw); | ||
610 | DRM_DEBUG_KMS("Force picking display port link bw %02x lane " | ||
611 | "count %d clock %d\n", | ||
612 | intel_dp->link_bw, intel_dp->lane_count, | ||
613 | adjusted_mode->clock); | ||
614 | |||
615 | return true; | ||
616 | } | ||
617 | |||
616 | return false; | 618 | return false; |
617 | } | 619 | } |
618 | 620 | ||
@@ -1087,21 +1089,11 @@ intel_get_adjust_train(struct intel_dp *intel_dp) | |||
1087 | } | 1089 | } |
1088 | 1090 | ||
1089 | static uint32_t | 1091 | static uint32_t |
1090 | intel_dp_signal_levels(struct intel_dp *intel_dp) | 1092 | intel_dp_signal_levels(uint8_t train_set, int lane_count) |
1091 | { | 1093 | { |
1092 | struct drm_device *dev = intel_dp->base.base.dev; | 1094 | uint32_t signal_levels = 0; |
1093 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
1094 | uint32_t signal_levels = 0; | ||
1095 | u8 train_set = intel_dp->train_set[0]; | ||
1096 | u32 vswing = train_set & DP_TRAIN_VOLTAGE_SWING_MASK; | ||
1097 | u32 preemphasis = train_set & DP_TRAIN_PRE_EMPHASIS_MASK; | ||
1098 | 1095 | ||
1099 | if (is_edp(intel_dp)) { | 1096 | switch (train_set & DP_TRAIN_VOLTAGE_SWING_MASK) { |
1100 | vswing = dev_priv->edp.vswing; | ||
1101 | preemphasis = dev_priv->edp.preemphasis; | ||
1102 | } | ||
1103 | |||
1104 | switch (vswing) { | ||
1105 | case DP_TRAIN_VOLTAGE_SWING_400: | 1097 | case DP_TRAIN_VOLTAGE_SWING_400: |
1106 | default: | 1098 | default: |
1107 | signal_levels |= DP_VOLTAGE_0_4; | 1099 | signal_levels |= DP_VOLTAGE_0_4; |
@@ -1116,7 +1108,7 @@ intel_dp_signal_levels(struct intel_dp *intel_dp) | |||
1116 | signal_levels |= DP_VOLTAGE_1_2; | 1108 | signal_levels |= DP_VOLTAGE_1_2; |
1117 | break; | 1109 | break; |
1118 | } | 1110 | } |
1119 | switch (preemphasis) { | 1111 | switch (train_set & DP_TRAIN_PRE_EMPHASIS_MASK) { |
1120 | case DP_TRAIN_PRE_EMPHASIS_0: | 1112 | case DP_TRAIN_PRE_EMPHASIS_0: |
1121 | default: | 1113 | default: |
1122 | signal_levels |= DP_PRE_EMPHASIS_0; | 1114 | signal_levels |= DP_PRE_EMPHASIS_0; |
@@ -1203,18 +1195,6 @@ intel_channel_eq_ok(struct intel_dp *intel_dp) | |||
1203 | } | 1195 | } |
1204 | 1196 | ||
1205 | static bool | 1197 | static bool |
1206 | intel_dp_aux_handshake_required(struct intel_dp *intel_dp) | ||
1207 | { | ||
1208 | struct drm_device *dev = intel_dp->base.base.dev; | ||
1209 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
1210 | |||
1211 | if (is_edp(intel_dp) && dev_priv->no_aux_handshake) | ||
1212 | return false; | ||
1213 | |||
1214 | return true; | ||
1215 | } | ||
1216 | |||
1217 | static bool | ||
1218 | intel_dp_set_link_train(struct intel_dp *intel_dp, | 1198 | intel_dp_set_link_train(struct intel_dp *intel_dp, |
1219 | uint32_t dp_reg_value, | 1199 | uint32_t dp_reg_value, |
1220 | uint8_t dp_train_pat) | 1200 | uint8_t dp_train_pat) |
@@ -1226,9 +1206,6 @@ intel_dp_set_link_train(struct intel_dp *intel_dp, | |||
1226 | I915_WRITE(intel_dp->output_reg, dp_reg_value); | 1206 | I915_WRITE(intel_dp->output_reg, dp_reg_value); |
1227 | POSTING_READ(intel_dp->output_reg); | 1207 | POSTING_READ(intel_dp->output_reg); |
1228 | 1208 | ||
1229 | if (!intel_dp_aux_handshake_required(intel_dp)) | ||
1230 | return true; | ||
1231 | |||
1232 | intel_dp_aux_native_write_1(intel_dp, | 1209 | intel_dp_aux_native_write_1(intel_dp, |
1233 | DP_TRAINING_PATTERN_SET, | 1210 | DP_TRAINING_PATTERN_SET, |
1234 | dp_train_pat); | 1211 | dp_train_pat); |
@@ -1261,11 +1238,10 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) | |||
1261 | POSTING_READ(intel_dp->output_reg); | 1238 | POSTING_READ(intel_dp->output_reg); |
1262 | intel_wait_for_vblank(dev, intel_crtc->pipe); | 1239 | intel_wait_for_vblank(dev, intel_crtc->pipe); |
1263 | 1240 | ||
1264 | if (intel_dp_aux_handshake_required(intel_dp)) | 1241 | /* Write the link configuration data */ |
1265 | /* Write the link configuration data */ | 1242 | intel_dp_aux_native_write(intel_dp, DP_LINK_BW_SET, |
1266 | intel_dp_aux_native_write(intel_dp, DP_LINK_BW_SET, | 1243 | intel_dp->link_configuration, |
1267 | intel_dp->link_configuration, | 1244 | DP_LINK_CONFIGURATION_SIZE); |
1268 | DP_LINK_CONFIGURATION_SIZE); | ||
1269 | 1245 | ||
1270 | DP |= DP_PORT_EN; | 1246 | DP |= DP_PORT_EN; |
1271 | if (HAS_PCH_CPT(dev) && !is_edp(intel_dp)) | 1247 | if (HAS_PCH_CPT(dev) && !is_edp(intel_dp)) |
@@ -1283,7 +1259,7 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) | |||
1283 | signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]); | 1259 | signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]); |
1284 | DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels; | 1260 | DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels; |
1285 | } else { | 1261 | } else { |
1286 | signal_levels = intel_dp_signal_levels(intel_dp); | 1262 | signal_levels = intel_dp_signal_levels(intel_dp->train_set[0], intel_dp->lane_count); |
1287 | DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels; | 1263 | DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels; |
1288 | } | 1264 | } |
1289 | 1265 | ||
@@ -1297,37 +1273,33 @@ intel_dp_start_link_train(struct intel_dp *intel_dp) | |||
1297 | break; | 1273 | break; |
1298 | /* Set training pattern 1 */ | 1274 | /* Set training pattern 1 */ |
1299 | 1275 | ||
1300 | udelay(500); | 1276 | udelay(100); |
1301 | if (intel_dp_aux_handshake_required(intel_dp)) { | 1277 | if (!intel_dp_get_link_status(intel_dp)) |
1302 | break; | 1278 | break; |
1303 | } else { | ||
1304 | if (!intel_dp_get_link_status(intel_dp)) | ||
1305 | break; | ||
1306 | 1279 | ||
1307 | if (intel_clock_recovery_ok(intel_dp->link_status, intel_dp->lane_count)) { | 1280 | if (intel_clock_recovery_ok(intel_dp->link_status, intel_dp->lane_count)) { |
1308 | clock_recovery = true; | 1281 | clock_recovery = true; |
1309 | break; | 1282 | break; |
1310 | } | 1283 | } |
1311 | 1284 | ||
1312 | /* Check to see if we've tried the max voltage */ | 1285 | /* Check to see if we've tried the max voltage */ |
1313 | for (i = 0; i < intel_dp->lane_count; i++) | 1286 | for (i = 0; i < intel_dp->lane_count; i++) |
1314 | if ((intel_dp->train_set[i] & DP_TRAIN_MAX_SWING_REACHED) == 0) | 1287 | if ((intel_dp->train_set[i] & DP_TRAIN_MAX_SWING_REACHED) == 0) |
1315 | break; | ||
1316 | if (i == intel_dp->lane_count) | ||
1317 | break; | 1288 | break; |
1289 | if (i == intel_dp->lane_count) | ||
1290 | break; | ||
1318 | 1291 | ||
1319 | /* Check to see if we've tried the same voltage 5 times */ | 1292 | /* Check to see if we've tried the same voltage 5 times */ |
1320 | if ((intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK) == voltage) { | 1293 | if ((intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK) == voltage) { |
1321 | ++tries; | 1294 | ++tries; |
1322 | if (tries == 5) | 1295 | if (tries == 5) |
1323 | break; | 1296 | break; |
1324 | } else | 1297 | } else |
1325 | tries = 0; | 1298 | tries = 0; |
1326 | voltage = intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK; | 1299 | voltage = intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK; |
1327 | 1300 | ||
1328 | /* Compute new intel_dp->train_set as requested by target */ | 1301 | /* Compute new intel_dp->train_set as requested by target */ |
1329 | intel_get_adjust_train(intel_dp); | 1302 | intel_get_adjust_train(intel_dp); |
1330 | } | ||
1331 | } | 1303 | } |
1332 | 1304 | ||
1333 | intel_dp->DP = DP; | 1305 | intel_dp->DP = DP; |
@@ -1354,7 +1326,7 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp) | |||
1354 | signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]); | 1326 | signal_levels = intel_gen6_edp_signal_levels(intel_dp->train_set[0]); |
1355 | DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels; | 1327 | DP = (DP & ~EDP_LINK_TRAIN_VOL_EMP_MASK_SNB) | signal_levels; |
1356 | } else { | 1328 | } else { |
1357 | signal_levels = intel_dp_signal_levels(intel_dp); | 1329 | signal_levels = intel_dp_signal_levels(intel_dp->train_set[0], intel_dp->lane_count); |
1358 | DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels; | 1330 | DP = (DP & ~(DP_VOLTAGE_MASK|DP_PRE_EMPHASIS_MASK)) | signal_levels; |
1359 | } | 1331 | } |
1360 | 1332 | ||
@@ -1368,28 +1340,24 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp) | |||
1368 | DP_TRAINING_PATTERN_2)) | 1340 | DP_TRAINING_PATTERN_2)) |
1369 | break; | 1341 | break; |
1370 | 1342 | ||
1371 | udelay(500); | 1343 | udelay(400); |
1372 | 1344 | if (!intel_dp_get_link_status(intel_dp)) | |
1373 | if (!intel_dp_aux_handshake_required(intel_dp)) { | ||
1374 | break; | 1345 | break; |
1375 | } else { | ||
1376 | if (!intel_dp_get_link_status(intel_dp)) | ||
1377 | break; | ||
1378 | 1346 | ||
1379 | if (intel_channel_eq_ok(intel_dp)) { | 1347 | if (intel_channel_eq_ok(intel_dp)) { |
1380 | channel_eq = true; | 1348 | channel_eq = true; |
1381 | break; | 1349 | break; |
1382 | } | 1350 | } |
1383 | 1351 | ||
1384 | /* Try 5 times */ | 1352 | /* Try 5 times */ |
1385 | if (tries > 5) | 1353 | if (tries > 5) |
1386 | break; | 1354 | break; |
1387 | 1355 | ||
1388 | /* Compute new intel_dp->train_set as requested by target */ | 1356 | /* Compute new intel_dp->train_set as requested by target */ |
1389 | intel_get_adjust_train(intel_dp); | 1357 | intel_get_adjust_train(intel_dp); |
1390 | ++tries; | 1358 | ++tries; |
1391 | } | ||
1392 | } | 1359 | } |
1360 | |||
1393 | if (HAS_PCH_CPT(dev) && !is_edp(intel_dp)) | 1361 | if (HAS_PCH_CPT(dev) && !is_edp(intel_dp)) |
1394 | reg = DP | DP_LINK_TRAIN_OFF_CPT; | 1362 | reg = DP | DP_LINK_TRAIN_OFF_CPT; |
1395 | else | 1363 | else |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 21551fe74541..e52c6125bb1f 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
@@ -237,7 +237,7 @@ extern bool intel_sdvo_init(struct drm_device *dev, int output_device); | |||
237 | extern void intel_dvo_init(struct drm_device *dev); | 237 | extern void intel_dvo_init(struct drm_device *dev); |
238 | extern void intel_tv_init(struct drm_device *dev); | 238 | extern void intel_tv_init(struct drm_device *dev); |
239 | extern void intel_mark_busy(struct drm_device *dev, struct drm_gem_object *obj); | 239 | extern void intel_mark_busy(struct drm_device *dev, struct drm_gem_object *obj); |
240 | extern void intel_lvds_init(struct drm_device *dev); | 240 | extern bool intel_lvds_init(struct drm_device *dev); |
241 | extern void intel_dp_init(struct drm_device *dev, int dp_reg); | 241 | extern void intel_dp_init(struct drm_device *dev, int dp_reg); |
242 | void | 242 | void |
243 | intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode, | 243 | intel_dp_set_m_n(struct drm_crtc *crtc, struct drm_display_mode *mode, |
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 4324a326f98e..f79327fc6653 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
@@ -837,7 +837,7 @@ static bool intel_lvds_ddc_probe(struct drm_device *dev, u8 pin) | |||
837 | * Create the connector, register the LVDS DDC bus, and try to figure out what | 837 | * Create the connector, register the LVDS DDC bus, and try to figure out what |
838 | * modes we can display on the LVDS panel (if present). | 838 | * modes we can display on the LVDS panel (if present). |
839 | */ | 839 | */ |
840 | void intel_lvds_init(struct drm_device *dev) | 840 | bool intel_lvds_init(struct drm_device *dev) |
841 | { | 841 | { |
842 | struct drm_i915_private *dev_priv = dev->dev_private; | 842 | struct drm_i915_private *dev_priv = dev->dev_private; |
843 | struct intel_lvds *intel_lvds; | 843 | struct intel_lvds *intel_lvds; |
@@ -853,37 +853,37 @@ void intel_lvds_init(struct drm_device *dev) | |||
853 | 853 | ||
854 | /* Skip init on machines we know falsely report LVDS */ | 854 | /* Skip init on machines we know falsely report LVDS */ |
855 | if (dmi_check_system(intel_no_lvds)) | 855 | if (dmi_check_system(intel_no_lvds)) |
856 | return; | 856 | return false; |
857 | 857 | ||
858 | pin = GMBUS_PORT_PANEL; | 858 | pin = GMBUS_PORT_PANEL; |
859 | if (!lvds_is_present_in_vbt(dev, &pin)) { | 859 | if (!lvds_is_present_in_vbt(dev, &pin)) { |
860 | DRM_DEBUG_KMS("LVDS is not present in VBT\n"); | 860 | DRM_DEBUG_KMS("LVDS is not present in VBT\n"); |
861 | return; | 861 | return false; |
862 | } | 862 | } |
863 | 863 | ||
864 | if (HAS_PCH_SPLIT(dev)) { | 864 | if (HAS_PCH_SPLIT(dev)) { |
865 | if ((I915_READ(PCH_LVDS) & LVDS_DETECTED) == 0) | 865 | if ((I915_READ(PCH_LVDS) & LVDS_DETECTED) == 0) |
866 | return; | 866 | return false; |
867 | if (dev_priv->edp.support) { | 867 | if (dev_priv->edp.support) { |
868 | DRM_DEBUG_KMS("disable LVDS for eDP support\n"); | 868 | DRM_DEBUG_KMS("disable LVDS for eDP support\n"); |
869 | return; | 869 | return false; |
870 | } | 870 | } |
871 | } | 871 | } |
872 | 872 | ||
873 | if (!intel_lvds_ddc_probe(dev, pin)) { | 873 | if (!intel_lvds_ddc_probe(dev, pin)) { |
874 | DRM_DEBUG_KMS("LVDS did not respond to DDC probe\n"); | 874 | DRM_DEBUG_KMS("LVDS did not respond to DDC probe\n"); |
875 | return; | 875 | return false; |
876 | } | 876 | } |
877 | 877 | ||
878 | intel_lvds = kzalloc(sizeof(struct intel_lvds), GFP_KERNEL); | 878 | intel_lvds = kzalloc(sizeof(struct intel_lvds), GFP_KERNEL); |
879 | if (!intel_lvds) { | 879 | if (!intel_lvds) { |
880 | return; | 880 | return false; |
881 | } | 881 | } |
882 | 882 | ||
883 | intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL); | 883 | intel_connector = kzalloc(sizeof(struct intel_connector), GFP_KERNEL); |
884 | if (!intel_connector) { | 884 | if (!intel_connector) { |
885 | kfree(intel_lvds); | 885 | kfree(intel_lvds); |
886 | return; | 886 | return false; |
887 | } | 887 | } |
888 | 888 | ||
889 | if (!HAS_PCH_SPLIT(dev)) { | 889 | if (!HAS_PCH_SPLIT(dev)) { |
@@ -1026,7 +1026,7 @@ out: | |||
1026 | /* keep the LVDS connector */ | 1026 | /* keep the LVDS connector */ |
1027 | dev_priv->int_lvds_connector = connector; | 1027 | dev_priv->int_lvds_connector = connector; |
1028 | drm_sysfs_connector_add(connector); | 1028 | drm_sysfs_connector_add(connector); |
1029 | return; | 1029 | return true; |
1030 | 1030 | ||
1031 | failed: | 1031 | failed: |
1032 | DRM_DEBUG_KMS("No LVDS modes found, disabling.\n"); | 1032 | DRM_DEBUG_KMS("No LVDS modes found, disabling.\n"); |
@@ -1034,4 +1034,5 @@ failed: | |||
1034 | drm_encoder_cleanup(encoder); | 1034 | drm_encoder_cleanup(encoder); |
1035 | kfree(intel_lvds); | 1035 | kfree(intel_lvds); |
1036 | kfree(intel_connector); | 1036 | kfree(intel_connector); |
1037 | return false; | ||
1037 | } | 1038 | } |