diff options
author | Alex Deucher <alex@cube.(none)> | 2008-03-11 18:11:13 -0400 |
---|---|---|
committer | Alex Deucher <alex@cube.(none)> | 2008-03-11 18:11:13 -0400 |
commit | 8e160508520c0a24ca90aad182f296461ca0d9b6 (patch) | |
tree | fc2803f2a4037eeb5c5f54a7a844d0775064f6dc /src | |
parent | fbded88a2925f9f049936dad0736721e7b84a6ee (diff) |
DCE3: add support for PCIEPHY (untested)
Diffstat (limited to 'src')
-rw-r--r-- | src/atombios_output.c | 70 | ||||
-rw-r--r-- | src/radeon_atombios.c | 42 | ||||
-rw-r--r-- | src/radeon_output.c | 5 | ||||
-rw-r--r-- | src/radeon_probe.h | 5 |
4 files changed, 102 insertions, 20 deletions
diff --git a/src/atombios_output.c b/src/atombios_output.c index f823d7c1..a00d87f8 100644 --- a/src/atombios_output.c +++ b/src/atombios_output.c @@ -408,12 +408,35 @@ atombios_output_dig1_transmitter_setup(xf86OutputPtr output, DisplayModePtr mode disp_data.ucAction = ATOM_TRANSMITTER_ACTION_ENABLE; disp_data.usPixelClock = mode->Clock / 10; disp_data.ucConfig = ATOM_TRANSMITTER_CONFIG_DIG1_ENCODER | ATOM_TRANSMITTER_CONFIG_CLKSRC_PPLL; - if (mode->Clock > 165000) - disp_data.ucConfig |= (ATOM_TRANSMITTER_CONFIG_8LANE_LINK | - ATOM_TRANSMITTER_CONFIG_LINKA_B | - ATOM_TRANSMITTER_CONFIG_LANE_0_7); - else - disp_data.ucConfig |= ATOM_TRANSMITTER_CONFIG_LINKA | ATOM_TRANSMITTER_CONFIG_LANE_0_3; + + if (info->IsIGP && (radeon_output->TMDSType == TMDS_UNIPHY)) { + if (mode->Clock > 165000) { + disp_data.ucConfig |= (ATOM_TRANSMITTER_CONFIG_8LANE_LINK | + ATOM_TRANSMITTER_CONFIG_LINKA_B); + /* guess */ + if (radeon_output->igp_lane_info & 0x3) + disp_data.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_0_7; + else if (radeon_output->igp_lane_info & 0xc) + disp_data.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_8_15; + } else { + disp_data.ucConfig |= ATOM_TRANSMITTER_CONFIG_LINKA; + if (radeon_output->igp_lane_info & 0x1) + disp_data.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_0_3; + else if (radeon_output->igp_lane_info & 0x2) + disp_data.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_4_7; + else if (radeon_output->igp_lane_info & 0x4) + disp_data.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_8_11; + else if (radeon_output->igp_lane_info & 0x8) + disp_data.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_12_15; + } + } else { + if (mode->Clock > 165000) + disp_data.ucConfig |= (ATOM_TRANSMITTER_CONFIG_8LANE_LINK | + ATOM_TRANSMITTER_CONFIG_LINKA_B | + ATOM_TRANSMITTER_CONFIG_LANE_0_7); + else + disp_data.ucConfig |= ATOM_TRANSMITTER_CONFIG_LINKA | ATOM_TRANSMITTER_CONFIG_LANE_0_3; + } radeon_output->transmitter_config = disp_data.ucConfig; @@ -494,12 +517,35 @@ atombios_output_dig2_transmitter_setup(xf86OutputPtr output, DisplayModePtr mode disp_data.ucAction = ATOM_TRANSMITTER_ACTION_ENABLE; disp_data.usPixelClock = mode->Clock / 10; disp_data.ucConfig = ATOM_TRANSMITTER_CONFIG_DIG2_ENCODER | ATOM_TRANSMITTER_CONFIG_CLKSRC_PPLL; - if (mode->Clock > 165000) - disp_data.ucConfig |= (ATOM_TRANSMITTER_CONFIG_8LANE_LINK | - ATOM_TRANSMITTER_CONFIG_LINKA_B | - ATOM_TRANSMITTER_CONFIG_LANE_0_7); - else - disp_data.ucConfig |= ATOM_TRANSMITTER_CONFIG_LINKA | ATOM_TRANSMITTER_CONFIG_LANE_0_3; + + if (info->IsIGP && (radeon_output->TMDSType == TMDS_UNIPHY)) { + if (mode->Clock > 165000) { + disp_data.ucConfig |= (ATOM_TRANSMITTER_CONFIG_8LANE_LINK | + ATOM_TRANSMITTER_CONFIG_LINKA_B); + /* guess */ + if (radeon_output->igp_lane_info & 0x3) + disp_data.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_0_7; + else if (radeon_output->igp_lane_info & 0xc) + disp_data.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_8_15; + } else { + disp_data.ucConfig |= ATOM_TRANSMITTER_CONFIG_LINKA; + if (radeon_output->igp_lane_info & 0x1) + disp_data.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_0_3; + else if (radeon_output->igp_lane_info & 0x2) + disp_data.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_4_7; + else if (radeon_output->igp_lane_info & 0x4) + disp_data.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_8_11; + else if (radeon_output->igp_lane_info & 0x8) + disp_data.ucConfig |= ATOM_TRANSMITTER_CONFIG_LANE_12_15; + } + } else { + if (mode->Clock > 165000) + disp_data.ucConfig |= (ATOM_TRANSMITTER_CONFIG_8LANE_LINK | + ATOM_TRANSMITTER_CONFIG_LINKA_B | + ATOM_TRANSMITTER_CONFIG_LANE_0_7); + else + disp_data.ucConfig |= ATOM_TRANSMITTER_CONFIG_LINKA | ATOM_TRANSMITTER_CONFIG_LANE_0_3; + } radeon_output->transmitter_config = disp_data.ucConfig; diff --git a/src/radeon_atombios.c b/src/radeon_atombios.c index bb15e875..85a2e71e 100644 --- a/src/radeon_atombios.c +++ b/src/radeon_atombios.c @@ -1399,7 +1399,7 @@ const int object_connector_convert[] = CONNECTOR_NONE, CONNECTOR_NONE, CONNECTOR_NONE, - CONNECTOR_NONE, + CONNECTOR_DISPLAY_PORT, }; static void @@ -1499,6 +1499,7 @@ RADEONGetATOMConnectorInfoFromBIOSObject (ScrnInfoPtr pScrn) unsigned short size; atomDataTablesPtr atomDataPtr; ATOM_CONNECTOR_OBJECT_TABLE *con_obj; + ATOM_INTEGRATED_SYSTEM_INFO_V2 *igp_obj = NULL; int i, j, ddc_line = 0; atomDataPtr = info->atomBIOS->atomDataPtr; @@ -1507,7 +1508,7 @@ RADEONGetATOMConnectorInfoFromBIOSObject (ScrnInfoPtr pScrn) if (crev < 2) return FALSE; - + con_obj = (ATOM_CONNECTOR_OBJECT_TABLE *) ((char *)&atomDataPtr->Object_Header->sHeader + atomDataPtr->Object_Header->usConnectorObjectTableOffset); @@ -1527,9 +1528,30 @@ RADEONGetATOMConnectorInfoFromBIOSObject (ScrnInfoPtr pScrn) SrcDstTable = (ATOM_SRC_DST_TABLE_FOR_ONE_OBJECT *) ((char *)&atomDataPtr->Object_Header->sHeader + con_obj->asObjects[i].usSrcDstTableOffset); - + ErrorF("object id %04x %02x\n", obj_id, SrcDstTable->ucNumberOfSrc); - info->BiosConnector[i].ConnectorType = object_connector_convert[obj_id]; + + if ((info->ChipFamily == CHIP_FAMILY_RS780) && + (obj_id == CONNECTOR_OBJECT_ID_PCIE_CONNECTOR)) { + CARD32 slot_config, ct; + + igp_obj = info->atomBIOS->atomDataPtr->IntegratedSystemInfo.IntegratedSystemInfo_v2; + + if (!igp_obj) + info->BiosConnector[i].ConnectorType = object_connector_convert[obj_id]; + else { + if (num == 1) + slot_config = igp_obj->ulDDISlot1Config; + else + slot_config = igp_obj->ulDDISlot2Config; + + ct = (slot_config >> 16) & 0xff; + info->BiosConnector[i].ConnectorType = object_connector_convert[ct]; + info->BiosConnector[i].igp_lane_info = slot_config & 0xffff; + } + } else + info->BiosConnector[i].ConnectorType = object_connector_convert[obj_id]; + if (info->BiosConnector[i].ConnectorType == CONNECTOR_NONE) info->BiosConnector[i].valid = FALSE; else @@ -1541,17 +1563,23 @@ RADEONGetATOMConnectorInfoFromBIOSObject (ScrnInfoPtr pScrn) sobj_id = (SrcDstTable->usSrcObjectID[j] & OBJECT_ID_MASK) >> OBJECT_ID_SHIFT; ErrorF("src object id %04x %d\n", SrcDstTable->usSrcObjectID[j], sobj_id); - + switch(sobj_id) { case ENCODER_OBJECT_ID_INTERNAL_LVDS: info->BiosConnector[i].devices |= (1 << ATOM_DEVICE_LCD1_INDEX); break; case ENCODER_OBJECT_ID_INTERNAL_TMDS1: case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_TMDS1: - case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: info->BiosConnector[i].devices |= (1 << ATOM_DEVICE_DFP1_INDEX); info->BiosConnector[i].TMDSType = TMDS_INT; break; + case ENCODER_OBJECT_ID_INTERNAL_UNIPHY: + if (num == 1) + info->BiosConnector[i].devices |= (1 << ATOM_DEVICE_DFP1_INDEX); + else + info->BiosConnector[i].devices |= (1 << ATOM_DEVICE_DFP2_INDEX); + info->BiosConnector[i].TMDSType = TMDS_UNIPHY; + break; case ENCODER_OBJECT_ID_INTERNAL_TMDS2: case ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1: info->BiosConnector[i].devices |= (1 << ATOM_DEVICE_DFP2_INDEX); @@ -1599,7 +1627,7 @@ RADEONGetATOMConnectorInfoFromBIOSObject (ScrnInfoPtr pScrn) ErrorF("record type %d\n", Record->ucRecordType); switch (Record->ucRecordType) { case ATOM_I2C_RECORD_TYPE: - rhdAtomParseI2CRecord(info->atomBIOS, + rhdAtomParseI2CRecord(info->atomBIOS, (ATOM_I2C_RECORD *)Record, &ddc_line); info->BiosConnector[i].ddc_i2c = atom_setup_i2c_bus(ddc_line); diff --git a/src/radeon_output.c b/src/radeon_output.c index 0fbfdef5..ed8f4fec 100644 --- a/src/radeon_output.c +++ b/src/radeon_output.c @@ -239,6 +239,8 @@ avivo_display_ddc_connected(ScrnInfoPtr pScrn, xf86OutputPtr output) MonType = MT_DFP; else if (radeon_output->type == OUTPUT_HDMI) MonType = MT_DFP; + else if (radeon_output->type == OUTPUT_DP) + MonType = MT_DFP; else if (radeon_output->type == OUTPUT_DVI_I && (MonInfo->rawData[0x14] & 0x80)) /* if it's digital and DVI */ MonType = MT_DFP; else @@ -1660,6 +1662,8 @@ void RADEONSetOutputType(ScrnInfoPtr pScrn, RADEONOutputPrivatePtr radeon_output case CONNECTOR_HDMI_TYPE_A: case CONNECTOR_HDMI_TYPE_B: output = OUTPUT_HDMI; break; + case CONNECTOR_DISPLAY_PORT: + output = OUTPUT_DP; break; case CONNECTOR_DIGITAL: case CONNECTOR_NONE: case CONNECTOR_UNSUPPORTED: @@ -2784,6 +2788,7 @@ Bool RADEONSetupConnectors(ScrnInfoPtr pScrn) radeon_output->devices = info->BiosConnector[i].devices; radeon_output->output_id = info->BiosConnector[i].output_id; radeon_output->ddc_i2c = info->BiosConnector[i].ddc_i2c; + radeon_output->igp_lane_info = info->BiosConnector[i].igp_lane_info; if (radeon_output->ConnectorType == CONNECTOR_DVI_D) radeon_output->DACType = DAC_NONE; diff --git a/src/radeon_probe.h b/src/radeon_probe.h index 5d368fe5..7dfce685 100644 --- a/src/radeon_probe.h +++ b/src/radeon_probe.h @@ -104,7 +104,8 @@ typedef enum TMDS_INT = 1, TMDS_EXT = 2, TMDS_LVTMA = 3, - TMDS_DDIA = 4 + TMDS_DDIA = 4, + TMDS_UNIPHY = 5 } RADEONTmdsType; typedef enum @@ -203,6 +204,7 @@ typedef struct { int devices; int hpd_mask; RADEONI2CBusRec ddc_i2c; + int igp_lane_info; } RADEONBIOSConnector; typedef struct _RADEONOutputPrivateRec { @@ -254,6 +256,7 @@ typedef struct _RADEONOutputPrivateRec { /* dig block */ int transmitter_config; Bool coherent_mode; + int igp_lane_info; char *name; int output_id; |