aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/atombios_crtc.c
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2011-01-31 16:48:53 -0500
committerDave Airlie <airlied@redhat.com>2011-02-01 21:49:43 -0500
commit619efb105924d8cafa0c1dd9389e9ab506f5425d (patch)
treed610de4c3488bbd539b7e449745c646299b48b19 /drivers/gpu/drm/radeon/atombios_crtc.c
parentf523f74eac1897b13c05c88ce6e5de0a7c34578b (diff)
drm/radeon/kms: Enable new pll calculation for avivo+ asics
New algo is used for r5xx+ and legacy is used for r1xx-r4xx, rv515. I've tested on all relevant GPUs and monitors that I have access to and have found no problems. Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=26562 https://bugzilla.kernel.org/show_bug.cgi?id=26552 May fix: https://bugs.freedesktop.org/show_bug.cgi?id=32556 Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Cc: stable@kernel.org Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/atombios_crtc.c')
-rw-r--r--drivers/gpu/drm/radeon/atombios_crtc.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
index 4374168b75b8..b1537000a104 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -555,6 +555,7 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
555 dp_clock = dig_connector->dp_clock; 555 dp_clock = dig_connector->dp_clock;
556 } 556 }
557 } 557 }
558/* this might work properly with the new pll algo */
558#if 0 /* doesn't work properly on some laptops */ 559#if 0 /* doesn't work properly on some laptops */
559 /* use recommended ref_div for ss */ 560 /* use recommended ref_div for ss */
560 if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { 561 if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) {
@@ -572,6 +573,11 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
572 adjusted_clock = mode->clock * 2; 573 adjusted_clock = mode->clock * 2;
573 if (radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT)) 574 if (radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT))
574 pll->flags |= RADEON_PLL_PREFER_CLOSEST_LOWER; 575 pll->flags |= RADEON_PLL_PREFER_CLOSEST_LOWER;
576 /* rv515 needs more testing with this option */
577 if (rdev->family != CHIP_RV515) {
578 if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT))
579 pll->flags |= RADEON_PLL_IS_LCD;
580 }
575 } else { 581 } else {
576 if (encoder->encoder_type != DRM_MODE_ENCODER_DAC) 582 if (encoder->encoder_type != DRM_MODE_ENCODER_DAC)
577 pll->flags |= RADEON_PLL_NO_ODD_POST_DIV; 583 pll->flags |= RADEON_PLL_NO_ODD_POST_DIV;
@@ -951,8 +957,16 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode
951 /* adjust pixel clock as needed */ 957 /* adjust pixel clock as needed */
952 adjusted_clock = atombios_adjust_pll(crtc, mode, pll, ss_enabled, &ss); 958 adjusted_clock = atombios_adjust_pll(crtc, mode, pll, ss_enabled, &ss);
953 959
954 radeon_compute_pll_legacy(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, 960 /* rv515 seems happier with the old algo */
955 &ref_div, &post_div); 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,
966 &ref_div, &post_div);
967 else
968 radeon_compute_pll_legacy(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div,
969 &ref_div, &post_div);
956 970
957 atombios_crtc_program_ss(crtc, ATOM_DISABLE, radeon_crtc->pll_id, &ss); 971 atombios_crtc_program_ss(crtc, ATOM_DISABLE, radeon_crtc->pll_id, &ss);
958 972