diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2012-03-20 17:18:05 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-03-21 02:55:51 -0400 |
commit | 47aef7a8922d48ac2cebc13d39079abe1ce63c35 (patch) | |
tree | 2f644c108c35e141e483bbd208ac7c5ab2ef4760 /drivers/gpu | |
parent | f3f1f03ed01c6ee6484a29a14d1e53e49934bdc6 (diff) |
drm/radeon/kms/atom: add support for DCE6.x dig transmitters
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/radeon/atombios_encoders.c | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c index b88c4608731b..28b55dab8d4f 100644 --- a/drivers/gpu/drm/radeon/atombios_encoders.c +++ b/drivers/gpu/drm/radeon/atombios_encoders.c | |||
@@ -703,6 +703,7 @@ union dig_transmitter_control { | |||
703 | DIG_TRANSMITTER_CONTROL_PARAMETERS_V2 v2; | 703 | DIG_TRANSMITTER_CONTROL_PARAMETERS_V2 v2; |
704 | DIG_TRANSMITTER_CONTROL_PARAMETERS_V3 v3; | 704 | DIG_TRANSMITTER_CONTROL_PARAMETERS_V3 v3; |
705 | DIG_TRANSMITTER_CONTROL_PARAMETERS_V4 v4; | 705 | DIG_TRANSMITTER_CONTROL_PARAMETERS_V4 v4; |
706 | DIG_TRANSMITTER_CONTROL_PARAMETERS_V1_5 v5; | ||
706 | }; | 707 | }; |
707 | 708 | ||
708 | void | 709 | void |
@@ -723,6 +724,7 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t | |||
723 | int connector_object_id = 0; | 724 | int connector_object_id = 0; |
724 | int igp_lane_info = 0; | 725 | int igp_lane_info = 0; |
725 | int dig_encoder = dig->dig_encoder; | 726 | int dig_encoder = dig->dig_encoder; |
727 | int hpd_id = RADEON_HPD_NONE; | ||
726 | 728 | ||
727 | if (action == ATOM_TRANSMITTER_ACTION_INIT) { | 729 | if (action == ATOM_TRANSMITTER_ACTION_INIT) { |
728 | connector = radeon_get_connector_for_encoder_init(encoder); | 730 | connector = radeon_get_connector_for_encoder_init(encoder); |
@@ -738,6 +740,7 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t | |||
738 | struct radeon_connector_atom_dig *dig_connector = | 740 | struct radeon_connector_atom_dig *dig_connector = |
739 | radeon_connector->con_priv; | 741 | radeon_connector->con_priv; |
740 | 742 | ||
743 | hpd_id = radeon_connector->hpd.hpd; | ||
741 | dp_clock = dig_connector->dp_clock; | 744 | dp_clock = dig_connector->dp_clock; |
742 | dp_lane_count = dig_connector->dp_lane_count; | 745 | dp_lane_count = dig_connector->dp_lane_count; |
743 | connector_object_id = | 746 | connector_object_id = |
@@ -1003,6 +1006,60 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t | |||
1003 | args.v4.acConfig.fDualLinkConnector = 1; | 1006 | args.v4.acConfig.fDualLinkConnector = 1; |
1004 | } | 1007 | } |
1005 | break; | 1008 | break; |
1009 | case 5: | ||
1010 | args.v5.ucAction = action; | ||
1011 | if (is_dp) | ||
1012 | args.v5.usSymClock = cpu_to_le16(dp_clock / 10); | ||
1013 | else | ||
1014 | args.v5.usSymClock = cpu_to_le16(radeon_encoder->pixel_clock / 10); | ||
1015 | |||
1016 | switch (radeon_encoder->encoder_id) { | ||
1017 | case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: | ||
1018 | if (dig->linkb) | ||
1019 | args.v5.ucPhyId = ATOM_PHY_ID_UNIPHYB; | ||
1020 | else | ||
1021 | args.v5.ucPhyId = ATOM_PHY_ID_UNIPHYA; | ||
1022 | break; | ||
1023 | case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1: | ||
1024 | if (dig->linkb) | ||
1025 | args.v5.ucPhyId = ATOM_PHY_ID_UNIPHYD; | ||
1026 | else | ||
1027 | args.v5.ucPhyId = ATOM_PHY_ID_UNIPHYC; | ||
1028 | break; | ||
1029 | case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2: | ||
1030 | if (dig->linkb) | ||
1031 | args.v5.ucPhyId = ATOM_PHY_ID_UNIPHYF; | ||
1032 | else | ||
1033 | args.v5.ucPhyId = ATOM_PHY_ID_UNIPHYE; | ||
1034 | break; | ||
1035 | } | ||
1036 | if (is_dp) | ||
1037 | args.v5.ucLaneNum = dp_lane_count; | ||
1038 | else if (radeon_encoder->pixel_clock > 165000) | ||
1039 | args.v5.ucLaneNum = 8; | ||
1040 | else | ||
1041 | args.v5.ucLaneNum = 4; | ||
1042 | args.v5.ucConnObjId = connector_object_id; | ||
1043 | args.v5.ucDigMode = atombios_get_encoder_mode(encoder); | ||
1044 | |||
1045 | if (is_dp && rdev->clock.dp_extclk) | ||
1046 | args.v5.asConfig.ucPhyClkSrcId = ENCODER_REFCLK_SRC_EXTCLK; | ||
1047 | else | ||
1048 | args.v5.asConfig.ucPhyClkSrcId = pll_id; | ||
1049 | |||
1050 | if (is_dp) | ||
1051 | args.v5.asConfig.ucCoherentMode = 1; /* DP requires coherent */ | ||
1052 | else if (radeon_encoder->devices & (ATOM_DEVICE_DFP_SUPPORT)) { | ||
1053 | if (dig->coherent_mode) | ||
1054 | args.v5.asConfig.ucCoherentMode = 1; | ||
1055 | } | ||
1056 | if (hpd_id == RADEON_HPD_NONE) | ||
1057 | args.v5.asConfig.ucHPDSel = 0; | ||
1058 | else | ||
1059 | args.v5.asConfig.ucHPDSel = hpd_id + 1; | ||
1060 | args.v5.ucDigEncoderSel = 1 << dig_encoder; | ||
1061 | args.v5.ucDPLaneSet = lane_set; | ||
1062 | break; | ||
1006 | default: | 1063 | default: |
1007 | DRM_ERROR("Unknown table version %d, %d\n", frev, crev); | 1064 | DRM_ERROR("Unknown table version %d, %d\n", frev, crev); |
1008 | break; | 1065 | break; |