diff options
| author | Alex Deucher <alexdeucher@gmail.com> | 2011-02-14 11:43:11 -0500 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2011-02-14 18:18:51 -0500 |
| commit | 5b40ddf888398ce4cccbf3b9d0a18d90149ed7ff (patch) | |
| tree | 8b29bbcea14e4af8cc9f62cf5c548c07b1746d17 | |
| parent | a4b40d5d97f5c9ad0b7f4bf2818291ca184bb433 (diff) | |
drm/radeon/kms: hopefully fix pll issues for real (v3)
The problematic boards have a recommended reference divider
to be used when spread spectrum is enabled on the laptop panel.
Enable the use of the recommended reference divider along with
the new pll algo.
v2: testing options
v3: When using the fixed reference divider with LVDS, prefer
min m to max p and use fractional feedback dividers.
Fixes:
https://bugzilla.kernel.org/show_bug.cgi?id=28852
https://bugzilla.kernel.org/show_bug.cgi?id=24462
https://bugzilla.kernel.org/show_bug.cgi?id=26552
MacbookPro issues reported by Justin Mattock <justinmattock@gmail.com>
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
| -rw-r--r-- | drivers/gpu/drm/radeon/atombios_crtc.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index 0b10b0e14945..095bc507fb16 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c | |||
| @@ -538,7 +538,6 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, | |||
| 538 | pll->flags |= RADEON_PLL_PREFER_HIGH_FB_DIV; | 538 | pll->flags |= RADEON_PLL_PREFER_HIGH_FB_DIV; |
| 539 | else | 539 | else |
| 540 | pll->flags |= RADEON_PLL_PREFER_LOW_REF_DIV; | 540 | pll->flags |= RADEON_PLL_PREFER_LOW_REF_DIV; |
| 541 | |||
| 542 | } | 541 | } |
| 543 | 542 | ||
| 544 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { | 543 | list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) { |
| @@ -555,29 +554,28 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, | |||
| 555 | dp_clock = dig_connector->dp_clock; | 554 | dp_clock = dig_connector->dp_clock; |
| 556 | } | 555 | } |
| 557 | } | 556 | } |
| 558 | /* this might work properly with the new pll algo */ | 557 | |
| 559 | #if 0 /* doesn't work properly on some laptops */ | ||
| 560 | /* use recommended ref_div for ss */ | 558 | /* use recommended ref_div for ss */ |
| 561 | if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { | 559 | if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { |
| 560 | pll->flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP; | ||
| 562 | if (ss_enabled) { | 561 | if (ss_enabled) { |
| 563 | if (ss->refdiv) { | 562 | if (ss->refdiv) { |
| 564 | pll->flags |= RADEON_PLL_USE_REF_DIV; | 563 | pll->flags |= RADEON_PLL_USE_REF_DIV; |
| 565 | pll->reference_div = ss->refdiv; | 564 | pll->reference_div = ss->refdiv; |
| 565 | if (ASIC_IS_AVIVO(rdev)) | ||
| 566 | pll->flags |= RADEON_PLL_USE_FRAC_FB_DIV; | ||
| 566 | } | 567 | } |
| 567 | } | 568 | } |
| 568 | } | 569 | } |
| 569 | #endif | 570 | |
| 570 | if (ASIC_IS_AVIVO(rdev)) { | 571 | if (ASIC_IS_AVIVO(rdev)) { |
| 571 | /* DVO wants 2x pixel clock if the DVO chip is in 12 bit mode */ | 572 | /* DVO wants 2x pixel clock if the DVO chip is in 12 bit mode */ |
| 572 | if (radeon_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1) | 573 | if (radeon_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1) |
| 573 | adjusted_clock = mode->clock * 2; | 574 | adjusted_clock = mode->clock * 2; |
| 574 | if (radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT)) | 575 | if (radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT)) |
| 575 | pll->flags |= RADEON_PLL_PREFER_CLOSEST_LOWER; | 576 | pll->flags |= RADEON_PLL_PREFER_CLOSEST_LOWER; |
| 576 | /* rv515 needs more testing with this option */ | 577 | if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) |
| 577 | if (rdev->family != CHIP_RV515) { | 578 | pll->flags |= RADEON_PLL_IS_LCD; |
| 578 | if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) | ||
| 579 | pll->flags |= RADEON_PLL_IS_LCD; | ||
| 580 | } | ||
| 581 | } else { | 579 | } else { |
| 582 | if (encoder->encoder_type != DRM_MODE_ENCODER_DAC) | 580 | if (encoder->encoder_type != DRM_MODE_ENCODER_DAC) |
| 583 | pll->flags |= RADEON_PLL_NO_ODD_POST_DIV; | 581 | pll->flags |= RADEON_PLL_NO_ODD_POST_DIV; |
| @@ -957,11 +955,7 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode | |||
| 957 | /* adjust pixel clock as needed */ | 955 | /* adjust pixel clock as needed */ |
| 958 | adjusted_clock = atombios_adjust_pll(crtc, mode, pll, ss_enabled, &ss); | 956 | adjusted_clock = atombios_adjust_pll(crtc, mode, pll, ss_enabled, &ss); |
| 959 | 957 | ||
| 960 | /* rv515 seems happier with the old algo */ | 958 | if (ASIC_IS_AVIVO(rdev)) |
| 961 | if (rdev->family == CHIP_RV515) | ||
| 962 | radeon_compute_pll_legacy(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, | ||
| 963 | &ref_div, &post_div); | ||
| 964 | else if (ASIC_IS_AVIVO(rdev)) | ||
| 965 | radeon_compute_pll_avivo(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, | 959 | radeon_compute_pll_avivo(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, |
| 966 | &ref_div, &post_div); | 960 | &ref_div, &post_div); |
| 967 | else | 961 | else |
