Lines 538-544
static u32 atombios_adjust_pll(struct drm_crtc *crtc,
Link Here
|
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) { |
Lines 555-583
static u32 atombios_adjust_pll(struct drm_crtc *crtc,
Link Here
|
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; |
Lines 957-967
static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode
Link Here
|
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 |
968 |
- |
|
|