radeon_hd: Fix bugs in external DP bridge code

* non-external encoder will never be a DP bridge.
* use external encoder in places where needed.
* ensure we look at proper encoder for isDPBridge.
This commit is contained in:
Alexander von Gluck IV
2012-03-15 09:38:48 -05:00
parent 72f6869e9e
commit 6728eddfa4
4 changed files with 17 additions and 15 deletions
@@ -661,8 +661,7 @@ connector_probe()
encoder->linkEnumeration encoder->linkEnumeration
= (encoderObjectRaw & ENUM_ID_MASK) = (encoderObjectRaw & ENUM_ID_MASK)
>> ENUM_ID_SHIFT; >> ENUM_ID_SHIFT;
encoder->isDPBridge encoder->isDPBridge = false;
= encoder_is_dp_bridge(encoderID);
pll_limit_probe(&encoder->pll); pll_limit_probe(&encoder->pll);
} }
@@ -737,7 +736,7 @@ connector_is_dp(uint32 connectorIndex)
{ {
if (gConnector[connectorIndex]->type == VIDEO_CONNECTOR_DP if (gConnector[connectorIndex]->type == VIDEO_CONNECTOR_DP
|| gConnector[connectorIndex]->type == VIDEO_CONNECTOR_EDP || gConnector[connectorIndex]->type == VIDEO_CONNECTOR_EDP
|| gConnector[connectorIndex]->encoder.isDPBridge == true) { || gConnector[connectorIndex]->encoderExternal.isDPBridge == true) {
return true; return true;
} }
return false; return false;
@@ -259,7 +259,7 @@ detect_displays()
// TODO: As DP aux transactions don't work yet, just use LVDS as a hack // TODO: As DP aux transactions don't work yet, just use LVDS as a hack
#if 0 #if 0
if (gConnector[id]->encoder.isDPBridge == true) { if (gConnector[id]->encoderExternal.isDPBridge == true) {
// If this is a DisplayPort Bridge, setup ddc on bus // If this is a DisplayPort Bridge, setup ddc on bus
// TRAVIS (LVDS) or NUTMEG (VGA) // TRAVIS (LVDS) or NUTMEG (VGA)
TRACE("%s: is bridge, performing bridge DDC setup\n", __func__); TRACE("%s: is bridge, performing bridge DDC setup\n", __func__);
@@ -535,6 +535,7 @@ status_t
encoder_dig_setup(uint32 connectorIndex, uint32 pixelClock, int command) encoder_dig_setup(uint32 connectorIndex, uint32 pixelClock, int command)
{ {
radeon_shared_info &info = *gInfo->shared_info; radeon_shared_info &info = *gInfo->shared_info;
connector_info* connector = gConnector[connectorIndex];
int index = 0; int index = 0;
if (info.dceMajor >= 4) if (info.dceMajor >= 4)
@@ -566,16 +567,14 @@ encoder_dig_setup(uint32 connectorIndex, uint32 pixelClock, int command)
union digEncoderControl args; union digEncoderControl args;
memset(&args, 0, sizeof(args)); memset(&args, 0, sizeof(args));
uint32 encoderID = gConnector[connectorIndex]->encoder.objectID; bool isDPBridge = connector->encoderExternal.isDPBridge;
bool isDPBridge = gConnector[connectorIndex]->encoder.isDPBridge; bool linkB = connector->encoder.linkEnumeration
bool linkB = gConnector[connectorIndex]->encoder.linkEnumeration
== GRAPH_OBJECT_ENUM_ID2 ? true : false; == GRAPH_OBJECT_ENUM_ID2 ? true : false;
// determine DP panel mode // determine DP panel mode
uint32 panelMode; uint32 panelMode;
if (info.dceMajor >= 4 && isDPBridge) { if (info.dceMajor >= 4 && isDPBridge) {
if (encoderID == ENCODER_OBJECT_ID_NUTMEG) if (connector->encoderExternal.objectID == ENCODER_OBJECT_ID_NUTMEG)
panelMode = DP_PANEL_MODE_INTERNAL_DP1_MODE; panelMode = DP_PANEL_MODE_INTERNAL_DP1_MODE;
else { else {
// aka ENCODER_OBJECT_ID_TRAVIS or VIDEO_CONNECTOR_EDP // aka ENCODER_OBJECT_ID_TRAVIS or VIDEO_CONNECTOR_EDP
@@ -615,7 +614,7 @@ encoder_dig_setup(uint32 connectorIndex, uint32 pixelClock, int command)
args.v1.ucConfig |= ATOM_ENCODER_CONFIG_DPLINKRATE_2_70GHZ; args.v1.ucConfig |= ATOM_ENCODER_CONFIG_DPLINKRATE_2_70GHZ;
} }
switch (encoderID) { switch (connector->encoder.objectID) {
case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: case ENCODER_OBJECT_ID_INTERNAL_UNIPHY:
args.v1.ucConfig = ATOM_ENCODER_CONFIG_V2_TRANSMITTER1; args.v1.ucConfig = ATOM_ENCODER_CONFIG_V2_TRANSMITTER1;
break; break;
+9 -5
View File
@@ -342,10 +342,15 @@ pll_adjust(pll_info* pll, uint8 crtcID)
// original as pixel_clock will be adjusted // original as pixel_clock will be adjusted
uint32 connectorIndex = gDisplay[crtcID]->connectorIndex; uint32 connectorIndex = gDisplay[crtcID]->connectorIndex;
uint32 encoderID = gConnector[connectorIndex]->encoder.objectID; connector_info* connector = gConnector[connectorIndex];
uint32 encoderID = connector->encoder.objectID;
uint32 encoderMode = display_get_encoder_mode(connectorIndex); uint32 encoderMode = display_get_encoder_mode(connectorIndex);
uint32 encoderFlags = gConnector[connectorIndex]->encoder.flags; uint32 encoderFlags = connector->encoder.flags;
bool dpBridge = gConnector[connectorIndex]->encoder.isDPBridge;
uint32 externalEncoderID = 0;
if (connector->encoderExternal.isDPBridge)
externalEncoderID = connector->encoderExternal.objectID;
if (info.dceMajor >= 3) { if (info.dceMajor >= 3) {
@@ -434,8 +439,7 @@ pll_adjust(pll_info* pll, uint8 crtcID)
} }
} }
args.v3.sInput.ucExtTransmitterID args.v3.sInput.ucExtTransmitterID = externalEncoderID;
= dpBridge ? encoderID : 0;
atom_execute_table(gAtomContext, index, (uint32*)&args); atom_execute_table(gAtomContext, index, (uint32*)&args);