diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-01-19 08:29:42 -0500 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-01-19 08:33:27 -0500 |
commit | 633f2ea26665d37bb3c8ae30799aa14988622653 (patch) | |
tree | e06f4aef5cec14ce6afa144d454872c446a3520a /drivers/gpu/drm/i915/intel_display.c | |
parent | 9a4114ffa7b6f5f4635e3745a8dc051d15d4596a (diff) |
drm/i915: Disable SSC for outputs other than LVDS or DP
For CRT and SDVO/HDMI, we need to use a normal, non-SSC, clock and so we
must clear any enabling bits left-over from earlier outputs. And also
seems to correct the LVDS panel on the Lenovo U160.
However, at one point, it did cause an "ERROR failed to disable
trancoder". So prolonged testing on top of Jesse's refactored and
error-checking CRTC logic is desired.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_display.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_display.c | 56 |
1 files changed, 31 insertions, 25 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 2c7e90f12657..2f58d97972db 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -4506,44 +4506,50 @@ static int intel_crtc_mode_set(struct drm_crtc *crtc, | |||
4506 | * ignoring this setting. | 4506 | * ignoring this setting. |
4507 | */ | 4507 | */ |
4508 | if (HAS_PCH_SPLIT(dev)) { | 4508 | if (HAS_PCH_SPLIT(dev)) { |
4509 | /*XXX BIOS treats 16:31 as a mask for 0:15 */ | ||
4510 | |||
4509 | temp = I915_READ(PCH_DREF_CONTROL); | 4511 | temp = I915_READ(PCH_DREF_CONTROL); |
4510 | /* Always enable nonspread source */ | 4512 | |
4513 | /* First clear the current state for output switching */ | ||
4514 | temp &= ~DREF_SSC1_ENABLE; | ||
4515 | temp &= ~DREF_SSC4_ENABLE; | ||
4516 | temp &= ~DREF_SUPERSPREAD_SOURCE_MASK; | ||
4511 | temp &= ~DREF_NONSPREAD_SOURCE_MASK; | 4517 | temp &= ~DREF_NONSPREAD_SOURCE_MASK; |
4512 | temp |= DREF_NONSPREAD_SOURCE_ENABLE; | ||
4513 | temp &= ~DREF_SSC_SOURCE_MASK; | 4518 | temp &= ~DREF_SSC_SOURCE_MASK; |
4514 | temp |= DREF_SSC_SOURCE_ENABLE; | 4519 | temp &= ~DREF_CPU_SOURCE_OUTPUT_MASK; |
4515 | I915_WRITE(PCH_DREF_CONTROL, temp); | 4520 | I915_WRITE(PCH_DREF_CONTROL, temp); |
4516 | 4521 | ||
4517 | POSTING_READ(PCH_DREF_CONTROL); | 4522 | POSTING_READ(PCH_DREF_CONTROL); |
4518 | udelay(200); | 4523 | udelay(200); |
4519 | 4524 | ||
4520 | if (has_edp_encoder) { | 4525 | if ((is_lvds || has_edp_encoder) && |
4521 | if (intel_panel_use_ssc(dev_priv)) { | 4526 | intel_panel_use_ssc(dev_priv)) { |
4522 | temp |= DREF_SSC1_ENABLE; | 4527 | temp |= DREF_SSC_SOURCE_ENABLE; |
4523 | I915_WRITE(PCH_DREF_CONTROL, temp); | 4528 | if (has_edp_encoder) { |
4524 | 4529 | if (!intel_encoder_is_pch_edp(&has_edp_encoder->base)) { | |
4525 | POSTING_READ(PCH_DREF_CONTROL); | 4530 | /* Enable CPU source on CPU attached eDP */ |
4526 | udelay(200); | ||
4527 | } | ||
4528 | temp &= ~DREF_CPU_SOURCE_OUTPUT_MASK; | ||
4529 | |||
4530 | /* Enable CPU source on CPU attached eDP */ | ||
4531 | if (!intel_encoder_is_pch_edp(&has_edp_encoder->base)) { | ||
4532 | if (intel_panel_use_ssc(dev_priv)) | ||
4533 | temp |= DREF_CPU_SOURCE_OUTPUT_DOWNSPREAD; | 4531 | temp |= DREF_CPU_SOURCE_OUTPUT_DOWNSPREAD; |
4534 | else | 4532 | } else { |
4535 | temp |= DREF_CPU_SOURCE_OUTPUT_NONSPREAD; | 4533 | /* Enable SSC on PCH eDP if needed */ |
4536 | } else { | ||
4537 | /* Enable SSC on PCH eDP if needed */ | ||
4538 | if (intel_panel_use_ssc(dev_priv)) { | ||
4539 | DRM_ERROR("enabling SSC on PCH\n"); | ||
4540 | temp |= DREF_SUPERSPREAD_SOURCE_ENABLE; | 4534 | temp |= DREF_SUPERSPREAD_SOURCE_ENABLE; |
4541 | } | 4535 | } |
4536 | I915_WRITE(PCH_DREF_CONTROL, temp); | ||
4542 | } | 4537 | } |
4543 | I915_WRITE(PCH_DREF_CONTROL, temp); | 4538 | if (!dev_priv->display_clock_mode) |
4544 | POSTING_READ(PCH_DREF_CONTROL); | 4539 | temp |= DREF_SSC1_ENABLE; |
4545 | udelay(200); | 4540 | } else { |
4541 | if (dev_priv->display_clock_mode) | ||
4542 | temp |= DREF_NONSPREAD_CK505_ENABLE; | ||
4543 | else | ||
4544 | temp |= DREF_NONSPREAD_SOURCE_ENABLE; | ||
4545 | if (has_edp_encoder && | ||
4546 | !intel_encoder_is_pch_edp(&has_edp_encoder->base)) | ||
4547 | temp |= DREF_CPU_SOURCE_OUTPUT_NONSPREAD; | ||
4546 | } | 4548 | } |
4549 | |||
4550 | I915_WRITE(PCH_DREF_CONTROL, temp); | ||
4551 | POSTING_READ(PCH_DREF_CONTROL); | ||
4552 | udelay(200); | ||
4547 | } | 4553 | } |
4548 | 4554 | ||
4549 | if (IS_PINEVIEW(dev)) { | 4555 | if (IS_PINEVIEW(dev)) { |