diff options
author | Jerome Glisse <jglisse@redhat.com> | 2012-08-17 14:40:04 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2012-08-20 11:09:48 -0400 |
commit | 5efcc76c13a745f98e7b6604d6aca49761be1970 (patch) | |
tree | a1b6484f6b0b4650dc318d542b683be103ce9178 /drivers | |
parent | 2e26c73a1e410448fbd2c0fbd34f06d98eaf8e48 (diff) |
drm/radeon: avoid turning off spread spectrum for used pll
If spread spectrum is enabled and in use for a given pll we
should not turn it off as it will lead to turning off display
for crtc that use the pll (this behavior was observed on chelsea
edp).
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Cc: stable@vger.kernel.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/radeon/atombios_crtc.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index c6fcb5b86a45..cb18813c7df0 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c | |||
@@ -444,11 +444,28 @@ union atom_enable_ss { | |||
444 | static void atombios_crtc_program_ss(struct radeon_device *rdev, | 444 | static void atombios_crtc_program_ss(struct radeon_device *rdev, |
445 | int enable, | 445 | int enable, |
446 | int pll_id, | 446 | int pll_id, |
447 | int crtc_id, | ||
447 | struct radeon_atom_ss *ss) | 448 | struct radeon_atom_ss *ss) |
448 | { | 449 | { |
450 | unsigned i; | ||
449 | int index = GetIndexIntoMasterTable(COMMAND, EnableSpreadSpectrumOnPPLL); | 451 | int index = GetIndexIntoMasterTable(COMMAND, EnableSpreadSpectrumOnPPLL); |
450 | union atom_enable_ss args; | 452 | union atom_enable_ss args; |
451 | 453 | ||
454 | if (!enable) { | ||
455 | for (i = 0; i < 6; i++) { | ||
456 | if (rdev->mode_info.crtcs[i] && | ||
457 | rdev->mode_info.crtcs[i]->enabled && | ||
458 | i != crtc_id && | ||
459 | pll_id == rdev->mode_info.crtcs[i]->pll_id) { | ||
460 | /* one other crtc is using this pll don't turn | ||
461 | * off spread spectrum as it might turn off | ||
462 | * display on active crtc | ||
463 | */ | ||
464 | return; | ||
465 | } | ||
466 | } | ||
467 | } | ||
468 | |||
452 | memset(&args, 0, sizeof(args)); | 469 | memset(&args, 0, sizeof(args)); |
453 | 470 | ||
454 | if (ASIC_IS_DCE5(rdev)) { | 471 | if (ASIC_IS_DCE5(rdev)) { |
@@ -1028,7 +1045,7 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode | |||
1028 | radeon_compute_pll_legacy(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, | 1045 | radeon_compute_pll_legacy(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div, |
1029 | &ref_div, &post_div); | 1046 | &ref_div, &post_div); |
1030 | 1047 | ||
1031 | atombios_crtc_program_ss(rdev, ATOM_DISABLE, radeon_crtc->pll_id, &ss); | 1048 | atombios_crtc_program_ss(rdev, ATOM_DISABLE, radeon_crtc->pll_id, radeon_crtc->crtc_id, &ss); |
1032 | 1049 | ||
1033 | atombios_crtc_program_pll(crtc, radeon_crtc->crtc_id, radeon_crtc->pll_id, | 1050 | atombios_crtc_program_pll(crtc, radeon_crtc->crtc_id, radeon_crtc->pll_id, |
1034 | encoder_mode, radeon_encoder->encoder_id, mode->clock, | 1051 | encoder_mode, radeon_encoder->encoder_id, mode->clock, |
@@ -1051,7 +1068,7 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode | |||
1051 | ss.step = step_size; | 1068 | ss.step = step_size; |
1052 | } | 1069 | } |
1053 | 1070 | ||
1054 | atombios_crtc_program_ss(rdev, ATOM_ENABLE, radeon_crtc->pll_id, &ss); | 1071 | atombios_crtc_program_ss(rdev, ATOM_ENABLE, radeon_crtc->pll_id, radeon_crtc->crtc_id, &ss); |
1055 | } | 1072 | } |
1056 | } | 1073 | } |
1057 | 1074 | ||
@@ -1572,11 +1589,11 @@ void radeon_atom_disp_eng_pll_init(struct radeon_device *rdev) | |||
1572 | ASIC_INTERNAL_SS_ON_DCPLL, | 1589 | ASIC_INTERNAL_SS_ON_DCPLL, |
1573 | rdev->clock.default_dispclk); | 1590 | rdev->clock.default_dispclk); |
1574 | if (ss_enabled) | 1591 | if (ss_enabled) |
1575 | atombios_crtc_program_ss(rdev, ATOM_DISABLE, ATOM_DCPLL, &ss); | 1592 | atombios_crtc_program_ss(rdev, ATOM_DISABLE, ATOM_DCPLL, -1, &ss); |
1576 | /* XXX: DCE5, make sure voltage, dispclk is high enough */ | 1593 | /* XXX: DCE5, make sure voltage, dispclk is high enough */ |
1577 | atombios_crtc_set_disp_eng_pll(rdev, rdev->clock.default_dispclk); | 1594 | atombios_crtc_set_disp_eng_pll(rdev, rdev->clock.default_dispclk); |
1578 | if (ss_enabled) | 1595 | if (ss_enabled) |
1579 | atombios_crtc_program_ss(rdev, ATOM_ENABLE, ATOM_DCPLL, &ss); | 1596 | atombios_crtc_program_ss(rdev, ATOM_ENABLE, ATOM_DCPLL, -1, &ss); |
1580 | } | 1597 | } |
1581 | 1598 | ||
1582 | } | 1599 | } |