aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2011-07-25 18:22:19 -0400
committerKeith Packard <keithp@keithp.com>2011-07-25 18:22:19 -0400
commitcf96e46fcd147856fd8151fab91c410f0ec16c47 (patch)
tree0d0c3612cc70e6d886464b2bdc7766d64e7af6c8 /drivers/gpu/drm/i915
parent887a82ee80b42bb14ba70f8138292023d5040b08 (diff)
parente85194641bec56179dcf5e1704ce5c6bf30340c6 (diff)
Merge branch 'drm-intel-fixes' into drm-intel-next
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c20
-rw-r--r--drivers/gpu/drm/i915/intel_panel.c4
2 files changed, 18 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 52b79d9d5d2d..6a9ec00f8c81 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1335,10 +1335,16 @@ intel_dp_start_link_train(struct intel_dp *intel_dp)
1335 u32 reg; 1335 u32 reg;
1336 uint32_t DP = intel_dp->DP; 1336 uint32_t DP = intel_dp->DP;
1337 1337
1338 /* Enable output, wait for it to become active */ 1338 /*
1339 I915_WRITE(intel_dp->output_reg, intel_dp->DP); 1339 * On CPT we have to enable the port in training pattern 1, which
1340 POSTING_READ(intel_dp->output_reg); 1340 * will happen below in intel_dp_set_link_train. Otherwise, enable
1341 intel_wait_for_vblank(dev, intel_crtc->pipe); 1341 * the port and wait for it to become active.
1342 */
1343 if (!HAS_PCH_CPT(dev)) {
1344 I915_WRITE(intel_dp->output_reg, intel_dp->DP);
1345 POSTING_READ(intel_dp->output_reg);
1346 intel_wait_for_vblank(dev, intel_crtc->pipe);
1347 }
1342 1348
1343 /* Write the link configuration data */ 1349 /* Write the link configuration data */
1344 intel_dp_aux_native_write(intel_dp, DP_LINK_BW_SET, 1350 intel_dp_aux_native_write(intel_dp, DP_LINK_BW_SET,
@@ -1371,7 +1377,8 @@ intel_dp_start_link_train(struct intel_dp *intel_dp)
1371 reg = DP | DP_LINK_TRAIN_PAT_1; 1377 reg = DP | DP_LINK_TRAIN_PAT_1;
1372 1378
1373 if (!intel_dp_set_link_train(intel_dp, reg, 1379 if (!intel_dp_set_link_train(intel_dp, reg,
1374 DP_TRAINING_PATTERN_1)) 1380 DP_TRAINING_PATTERN_1 |
1381 DP_LINK_SCRAMBLING_DISABLE))
1375 break; 1382 break;
1376 /* Set training pattern 1 */ 1383 /* Set training pattern 1 */
1377 1384
@@ -1446,7 +1453,8 @@ intel_dp_complete_link_train(struct intel_dp *intel_dp)
1446 1453
1447 /* channel eq pattern */ 1454 /* channel eq pattern */
1448 if (!intel_dp_set_link_train(intel_dp, reg, 1455 if (!intel_dp_set_link_train(intel_dp, reg,
1449 DP_TRAINING_PATTERN_2)) 1456 DP_TRAINING_PATTERN_2 |
1457 DP_LINK_SCRAMBLING_DISABLE))
1450 break; 1458 break;
1451 1459
1452 udelay(400); 1460 udelay(400);
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index a06ff07a4d3b..05f500cd9c24 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -83,11 +83,15 @@ intel_pch_panel_fitting(struct drm_device *dev,
83 u32 scaled_height = mode->hdisplay * adjusted_mode->vdisplay; 83 u32 scaled_height = mode->hdisplay * adjusted_mode->vdisplay;
84 if (scaled_width > scaled_height) { /* pillar */ 84 if (scaled_width > scaled_height) { /* pillar */
85 width = scaled_height / mode->vdisplay; 85 width = scaled_height / mode->vdisplay;
86 if (width & 1)
87 width++;
86 x = (adjusted_mode->hdisplay - width + 1) / 2; 88 x = (adjusted_mode->hdisplay - width + 1) / 2;
87 y = 0; 89 y = 0;
88 height = adjusted_mode->vdisplay; 90 height = adjusted_mode->vdisplay;
89 } else if (scaled_width < scaled_height) { /* letter */ 91 } else if (scaled_width < scaled_height) { /* letter */
90 height = scaled_width / mode->hdisplay; 92 height = scaled_width / mode->hdisplay;
93 if (height & 1)
94 height++;
91 y = (adjusted_mode->vdisplay - height + 1) / 2; 95 y = (adjusted_mode->vdisplay - height + 1) / 2;
92 x = 0; 96 x = 0;
93 width = adjusted_mode->hdisplay; 97 width = adjusted_mode->hdisplay;