diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2010-08-16 12:44:47 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-08-19 18:43:25 -0400 |
commit | fbee67a65d16c431ae3c389db13688c6e1b1b9d8 (patch) | |
tree | 06f3841ca3fa192972f1490e09e31157f78d7616 /drivers | |
parent | 1d978dac7e99bd551df5001f0cc92369054dca0d (diff) |
drm/radeon/kms: DCE3/4 AdjustPixelPll updates
Add options necessary bits for:
- SS on DP
- SS on LVDS
- set clocks right for DP
- deep color on hdmi (needs additional encoder and edid work as well)
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/radeon/atombios_crtc.c | 51 |
1 files changed, 44 insertions, 7 deletions
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c index 12ad512bd3d3..577239a24fd5 100644 --- a/drivers/gpu/drm/radeon/atombios_crtc.c +++ b/drivers/gpu/drm/radeon/atombios_crtc.c | |||
@@ -471,6 +471,8 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, | |||
471 | struct radeon_encoder *radeon_encoder = NULL; | 471 | struct radeon_encoder *radeon_encoder = NULL; |
472 | u32 adjusted_clock = mode->clock; | 472 | u32 adjusted_clock = mode->clock; |
473 | int encoder_mode = 0; | 473 | int encoder_mode = 0; |
474 | u32 dp_clock = mode->clock; | ||
475 | int bpc = 8; | ||
474 | 476 | ||
475 | /* reset the pll flags */ | 477 | /* reset the pll flags */ |
476 | pll->flags = 0; | 478 | pll->flags = 0; |
@@ -513,6 +515,17 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, | |||
513 | if (encoder->crtc == crtc) { | 515 | if (encoder->crtc == crtc) { |
514 | radeon_encoder = to_radeon_encoder(encoder); | 516 | radeon_encoder = to_radeon_encoder(encoder); |
515 | encoder_mode = atombios_get_encoder_mode(encoder); | 517 | encoder_mode = atombios_get_encoder_mode(encoder); |
518 | if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT | ATOM_DEVICE_DFP_SUPPORT)) { | ||
519 | struct drm_connector *connector = radeon_get_connector_for_encoder(encoder); | ||
520 | if (connector) { | ||
521 | struct radeon_connector *radeon_connector = to_radeon_connector(connector); | ||
522 | struct radeon_connector_atom_dig *dig_connector = | ||
523 | radeon_connector->con_priv; | ||
524 | |||
525 | dp_clock = dig_connector->dp_clock; | ||
526 | } | ||
527 | } | ||
528 | |||
516 | if (ASIC_IS_AVIVO(rdev)) { | 529 | if (ASIC_IS_AVIVO(rdev)) { |
517 | /* DVO wants 2x pixel clock if the DVO chip is in 12 bit mode */ | 530 | /* DVO wants 2x pixel clock if the DVO chip is in 12 bit mode */ |
518 | if (radeon_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1) | 531 | if (radeon_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1) |
@@ -555,6 +568,14 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, | |||
555 | args.v1.usPixelClock = cpu_to_le16(mode->clock / 10); | 568 | args.v1.usPixelClock = cpu_to_le16(mode->clock / 10); |
556 | args.v1.ucTransmitterID = radeon_encoder->encoder_id; | 569 | args.v1.ucTransmitterID = radeon_encoder->encoder_id; |
557 | args.v1.ucEncodeMode = encoder_mode; | 570 | args.v1.ucEncodeMode = encoder_mode; |
571 | if (encoder_mode == ATOM_ENCODER_MODE_DP) { | ||
572 | /* may want to enable SS on DP eventually */ | ||
573 | /* args.v1.ucConfig |= | ||
574 | ADJUST_DISPLAY_CONFIG_SS_ENABLE;*/ | ||
575 | } else if (encoder_mode == ATOM_ENCODER_MODE_LVDS) { | ||
576 | args.v1.ucConfig |= | ||
577 | ADJUST_DISPLAY_CONFIG_SS_ENABLE; | ||
578 | } | ||
558 | 579 | ||
559 | atom_execute_table(rdev->mode_info.atom_context, | 580 | atom_execute_table(rdev->mode_info.atom_context, |
560 | index, (uint32_t *)&args); | 581 | index, (uint32_t *)&args); |
@@ -568,10 +589,20 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, | |||
568 | if (radeon_encoder->devices & (ATOM_DEVICE_DFP_SUPPORT)) { | 589 | if (radeon_encoder->devices & (ATOM_DEVICE_DFP_SUPPORT)) { |
569 | struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; | 590 | struct radeon_encoder_atom_dig *dig = radeon_encoder->enc_priv; |
570 | 591 | ||
571 | if (encoder_mode == ATOM_ENCODER_MODE_DP) | 592 | if (encoder_mode == ATOM_ENCODER_MODE_DP) { |
593 | /* may want to enable SS on DP/eDP eventually */ | ||
594 | /*args.v3.sInput.ucDispPllConfig |= | ||
595 | DISPPLL_CONFIG_SS_ENABLE;*/ | ||
572 | args.v3.sInput.ucDispPllConfig |= | 596 | args.v3.sInput.ucDispPllConfig |= |
573 | DISPPLL_CONFIG_COHERENT_MODE; | 597 | DISPPLL_CONFIG_COHERENT_MODE; |
574 | else { | 598 | /* 16200 or 27000 */ |
599 | args.v3.sInput.usPixelClock = cpu_to_le16(dp_clock / 10); | ||
600 | } else { | ||
601 | if (encoder_mode == ATOM_ENCODER_MODE_HDMI) { | ||
602 | /* deep color support */ | ||
603 | args.v3.sInput.usPixelClock = | ||
604 | cpu_to_le16((mode->clock * bpc / 8) / 10); | ||
605 | } | ||
575 | if (dig->coherent_mode) | 606 | if (dig->coherent_mode) |
576 | args.v3.sInput.ucDispPllConfig |= | 607 | args.v3.sInput.ucDispPllConfig |= |
577 | DISPPLL_CONFIG_COHERENT_MODE; | 608 | DISPPLL_CONFIG_COHERENT_MODE; |
@@ -580,13 +611,19 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc, | |||
580 | DISPPLL_CONFIG_DUAL_LINK; | 611 | DISPPLL_CONFIG_DUAL_LINK; |
581 | } | 612 | } |
582 | } else if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { | 613 | } else if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) { |
583 | /* may want to enable SS on DP/eDP eventually */ | 614 | if (encoder_mode == ATOM_ENCODER_MODE_DP) { |
584 | /*args.v3.sInput.ucDispPllConfig |= | 615 | /* may want to enable SS on DP/eDP eventually */ |
585 | DISPPLL_CONFIG_SS_ENABLE;*/ | 616 | /*args.v3.sInput.ucDispPllConfig |= |
586 | if (encoder_mode == ATOM_ENCODER_MODE_DP) | 617 | DISPPLL_CONFIG_SS_ENABLE;*/ |
587 | args.v3.sInput.ucDispPllConfig |= | 618 | args.v3.sInput.ucDispPllConfig |= |
588 | DISPPLL_CONFIG_COHERENT_MODE; | 619 | DISPPLL_CONFIG_COHERENT_MODE; |
589 | else { | 620 | /* 16200 or 27000 */ |
621 | args.v3.sInput.usPixelClock = cpu_to_le16(dp_clock / 10); | ||
622 | } else if (encoder_mode == ATOM_ENCODER_MODE_LVDS) { | ||
623 | /* want to enable SS on LVDS eventually */ | ||
624 | /*args.v3.sInput.ucDispPllConfig |= | ||
625 | DISPPLL_CONFIG_SS_ENABLE;*/ | ||
626 | } else { | ||
590 | if (mode->clock > 165000) | 627 | if (mode->clock > 165000) |
591 | args.v3.sInput.ucDispPllConfig |= | 628 | args.v3.sInput.ucDispPllConfig |= |
592 | DISPPLL_CONFIG_DUAL_LINK; | 629 | DISPPLL_CONFIG_DUAL_LINK; |