aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2011-05-20 04:34:17 -0400
committerDave Airlie <airlied@redhat.com>2011-05-20 06:02:22 -0400
commit86a94defe2b88380c28547d7053633b26a397d42 (patch)
tree5f18745f77235b364f85c8b74804957b285cca4e /drivers/gpu
parent8e8e523d865490e95ed7c9d2e173c02648d6be90 (diff)
drm/radeon/kms: fix up DP clock programming on DCE4/5
In DP mode, the DP ref clock can come from PPLL, DCPLL, or ext clock, depending on the asic. The crtc virtual pixel clock is derived from the DP ref clock. - DCE4: PPLL or ext clock - DCE5: DCPLL or ext clock Setting ATOM_PPLL_INVALID will cause SetPixelClock to skip PPLL/DCPLL programming and only program the DP DTO for the crtc virtual pixel clock. Signed-off-by: Alex Deucher <alexdeucher@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/radeon/atombios_crtc.c12
-rw-r--r--drivers/gpu/drm/radeon/radeon_encoders.c11
2 files changed, 18 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
index ff0d1cad1012..9770afff4d4c 100644
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
@@ -1443,11 +1443,19 @@ static int radeon_atom_pick_pll(struct drm_crtc *crtc)
1443 uint32_t pll_in_use = 0; 1443 uint32_t pll_in_use = 0;
1444 1444
1445 if (ASIC_IS_DCE4(rdev)) { 1445 if (ASIC_IS_DCE4(rdev)) {
1446 /* if crtc is driving DP and we have an ext clock, use that */
1447 list_for_each_entry(test_encoder, &dev->mode_config.encoder_list, head) { 1446 list_for_each_entry(test_encoder, &dev->mode_config.encoder_list, head) {
1448 if (test_encoder->crtc && (test_encoder->crtc == crtc)) { 1447 if (test_encoder->crtc && (test_encoder->crtc == crtc)) {
1448 /* in DP mode, the DP ref clock can come from PPLL, DCPLL, or ext clock,
1449 * depending on the asic:
1450 * DCE4: PPLL or ext clock
1451 * DCE5: DCPLL or ext clock
1452 *
1453 * Setting ATOM_PPLL_INVALID will cause SetPixelClock to skip
1454 * PPLL/DCPLL programming and only program the DP DTO for the
1455 * crtc virtual pixel clock.
1456 */
1449 if (atombios_get_encoder_mode(test_encoder) == ATOM_ENCODER_MODE_DP) { 1457 if (atombios_get_encoder_mode(test_encoder) == ATOM_ENCODER_MODE_DP) {
1450 if (rdev->clock.dp_extclk) 1458 if (ASIC_IS_DCE5(rdev) || rdev->clock.dp_extclk)
1451 return ATOM_PPLL_INVALID; 1459 return ATOM_PPLL_INVALID;
1452 } 1460 }
1453 } 1461 }
diff --git a/drivers/gpu/drm/radeon/radeon_encoders.c b/drivers/gpu/drm/radeon/radeon_encoders.c
index 6c6793e6e3a5..4d66e249e1c1 100644
--- a/drivers/gpu/drm/radeon/radeon_encoders.c
+++ b/drivers/gpu/drm/radeon/radeon_encoders.c
@@ -988,11 +988,16 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t
988 } 988 }
989 989
990 if (ASIC_IS_DCE5(rdev)) { 990 if (ASIC_IS_DCE5(rdev)) {
991 if (is_dp && rdev->clock.dp_extclk) 991 /* On DCE5 DCPLL usually generates the DP ref clock */
992 args.v4.acConfig.ucRefClkSource = 3; /* external src */ 992 if (is_dp) {
993 else 993 if (rdev->clock.dp_extclk)
994 args.v4.acConfig.ucRefClkSource = ENCODER_REFCLK_SRC_EXTCLK;
995 else
996 args.v4.acConfig.ucRefClkSource = ENCODER_REFCLK_SRC_DCPLL;
997 } else
994 args.v4.acConfig.ucRefClkSource = pll_id; 998 args.v4.acConfig.ucRefClkSource = pll_id;
995 } else { 999 } else {
1000 /* On DCE4, if there is an external clock, it generates the DP ref clock */
996 if (is_dp && rdev->clock.dp_extclk) 1001 if (is_dp && rdev->clock.dp_extclk)
997 args.v3.acConfig.ucRefClkSource = 2; /* external src */ 1002 args.v3.acConfig.ucRefClkSource = 2; /* external src */
998 else 1003 else