Commit d9c9fe36 authored by Alex Deucher's avatar Alex Deucher Committed by Dave Airlie

drm/radeon/kms/atom: minor fixes to transmitter setup

- 8 lane links are not valid for DP
- remove unused num var
Signed-off-by: default avatarAlex Deucher <alexdeucher@gmail.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 3ca82da3
...@@ -708,7 +708,7 @@ atombios_dig_encoder_setup(struct drm_encoder *encoder, int action) ...@@ -708,7 +708,7 @@ atombios_dig_encoder_setup(struct drm_encoder *encoder, int action)
struct radeon_connector_atom_dig *dig_connector = struct radeon_connector_atom_dig *dig_connector =
radeon_get_atom_connector_priv_from_encoder(encoder); radeon_get_atom_connector_priv_from_encoder(encoder);
union dig_encoder_control args; union dig_encoder_control args;
int index = 0, num = 0; int index = 0;
uint8_t frev, crev; uint8_t frev, crev;
if (!dig || !dig_connector) if (!dig || !dig_connector)
...@@ -724,7 +724,6 @@ atombios_dig_encoder_setup(struct drm_encoder *encoder, int action) ...@@ -724,7 +724,6 @@ atombios_dig_encoder_setup(struct drm_encoder *encoder, int action)
else else
index = GetIndexIntoMasterTable(COMMAND, DIG1EncoderControl); index = GetIndexIntoMasterTable(COMMAND, DIG1EncoderControl);
} }
num = dig->dig_encoder + 1;
if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev)) if (!atom_parse_cmd_header(rdev->mode_info.atom_context, index, &frev, &crev))
return; return;
...@@ -786,7 +785,7 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t ...@@ -786,7 +785,7 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t
struct drm_connector *connector; struct drm_connector *connector;
struct radeon_connector *radeon_connector; struct radeon_connector *radeon_connector;
union dig_transmitter_control args; union dig_transmitter_control args;
int index = 0, num = 0; int index = 0;
uint8_t frev, crev; uint8_t frev, crev;
bool is_dp = false; bool is_dp = false;
int pll_id = 0; int pll_id = 0;
...@@ -862,15 +861,12 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t ...@@ -862,15 +861,12 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t
switch (radeon_encoder->encoder_id) { switch (radeon_encoder->encoder_id) {
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:
args.v3.acConfig.ucTransmitterSel = 0; args.v3.acConfig.ucTransmitterSel = 0;
num = 0;
break; break;
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1: case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1:
args.v3.acConfig.ucTransmitterSel = 1; args.v3.acConfig.ucTransmitterSel = 1;
num = 1;
break; break;
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2: case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2:
args.v3.acConfig.ucTransmitterSel = 2; args.v3.acConfig.ucTransmitterSel = 2;
num = 2;
break; break;
} }
...@@ -881,23 +877,19 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t ...@@ -881,23 +877,19 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t
args.v3.acConfig.fCoherentMode = 1; args.v3.acConfig.fCoherentMode = 1;
} }
} else if (ASIC_IS_DCE32(rdev)) { } else if (ASIC_IS_DCE32(rdev)) {
if (dig->dig_encoder == 1) args.v2.acConfig.ucEncoderSel = dig->dig_encoder;
args.v2.acConfig.ucEncoderSel = 1;
if (dig_connector->linkb) if (dig_connector->linkb)
args.v2.acConfig.ucLinkSel = 1; args.v2.acConfig.ucLinkSel = 1;
switch (radeon_encoder->encoder_id) { switch (radeon_encoder->encoder_id) {
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:
args.v2.acConfig.ucTransmitterSel = 0; args.v2.acConfig.ucTransmitterSel = 0;
num = 0;
break; break;
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1: case ENCODER_OBJECT_ID_INTERNAL_UNIPHY1:
args.v2.acConfig.ucTransmitterSel = 1; args.v2.acConfig.ucTransmitterSel = 1;
num = 1;
break; break;
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2: case ENCODER_OBJECT_ID_INTERNAL_UNIPHY2:
args.v2.acConfig.ucTransmitterSel = 2; args.v2.acConfig.ucTransmitterSel = 2;
num = 2;
break; break;
} }
...@@ -915,31 +907,25 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t ...@@ -915,31 +907,25 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t
else else
args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_DIG1_ENCODER; args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_DIG1_ENCODER;
switch (radeon_encoder->encoder_id) { if ((rdev->flags & RADEON_IS_IGP) &&
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: (radeon_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_UNIPHY)) {
if (rdev->flags & RADEON_IS_IGP) { if (is_dp || (radeon_encoder->pixel_clock <= 165000)) {
if (radeon_encoder->pixel_clock > 165000) { if (dig_connector->igp_lane_info & 0x1)
if (dig_connector->igp_lane_info & 0x3) args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_0_3;
args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_0_7; else if (dig_connector->igp_lane_info & 0x2)
else if (dig_connector->igp_lane_info & 0xc) args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_4_7;
args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_8_15; else if (dig_connector->igp_lane_info & 0x4)
} else { args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_8_11;
if (dig_connector->igp_lane_info & 0x1) else if (dig_connector->igp_lane_info & 0x8)
args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_0_3; args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_12_15;
else if (dig_connector->igp_lane_info & 0x2) } else {
args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_4_7; if (dig_connector->igp_lane_info & 0x3)
else if (dig_connector->igp_lane_info & 0x4) args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_0_7;
args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_8_11; else if (dig_connector->igp_lane_info & 0xc)
else if (dig_connector->igp_lane_info & 0x8) args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_8_15;
args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_12_15;
}
} }
break;
} }
if (radeon_encoder->pixel_clock > 165000)
args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_8LANE_LINK;
if (dig_connector->linkb) if (dig_connector->linkb)
args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LINKB; args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_LINKB;
else else
...@@ -950,6 +936,8 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t ...@@ -950,6 +936,8 @@ atombios_dig_transmitter_setup(struct drm_encoder *encoder, int action, uint8_t
else if (radeon_encoder->devices & (ATOM_DEVICE_DFP_SUPPORT)) { else if (radeon_encoder->devices & (ATOM_DEVICE_DFP_SUPPORT)) {
if (dig->coherent_mode) if (dig->coherent_mode)
args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_COHERENT; args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_COHERENT;
if (radeon_encoder->pixel_clock > 165000)
args.v1.ucConfig |= ATOM_TRANSMITTER_CONFIG_8LANE_LINK;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment