diff options
-rw-r--r-- | src/radeon_atombios.c | 25 | ||||
-rw-r--r-- | src/radeon_output.c | 22 | ||||
-rw-r--r-- | src/radeon_probe.h | 3 |
3 files changed, 46 insertions, 4 deletions
diff --git a/src/radeon_atombios.c b/src/radeon_atombios.c index 851014bd..3dfca178 100644 --- a/src/radeon_atombios.c +++ b/src/radeon_atombios.c @@ -1509,8 +1509,11 @@ RADEONLookupGPIOLineForDDC(ScrnInfoPtr pScrn, uint8_t id) static RADEONI2CBusRec rhdAtomParseI2CRecord(ScrnInfoPtr pScrn, atomBiosHandlePtr handle, - ATOM_I2C_RECORD *Record) + ATOM_I2C_RECORD *Record, int i) { + RADEONInfoPtr info = RADEONPTR (pScrn); + + info->BiosConnector[i].i2c_line_mux = Record->sucI2cId.bfI2C_LineMux; return RADEONLookupGPIOLineForDDC(pScrn, Record->sucI2cId.bfI2C_LineMux); } @@ -1664,7 +1667,7 @@ RADEONGetATOMConnectorInfoFromBIOSObject (ScrnInfoPtr pScrn) switch (Record->ucRecordType) { case ATOM_I2C_RECORD_TYPE: info->BiosConnector[i].ddc_i2c = rhdAtomParseI2CRecord(pScrn, info->atomBIOS, - (ATOM_I2C_RECORD *)Record); + (ATOM_I2C_RECORD *)Record, i); break; case ATOM_HPD_INT_RECORD_TYPE: break; @@ -1676,6 +1679,20 @@ RADEONGetATOMConnectorInfoFromBIOSObject (ScrnInfoPtr pScrn) ((char *)Record + Record->ucRecordSize); } } + + for (i = 0; i < ATOM_MAX_SUPPORTED_DEVICE; i++) { + if (info->BiosConnector[i].valid) { + for (j = 0; j < ATOM_MAX_SUPPORTED_DEVICE; j++) { + if (info->BiosConnector[j].valid && (i != j) ) { + if (info->BiosConnector[i].i2c_line_mux == info->BiosConnector[j].i2c_line_mux) { + info->BiosConnector[i].shared_ddc = TRUE; + info->BiosConnector[j].shared_ddc = TRUE; + } + } + } + } + } + return TRUE; } @@ -1929,6 +1946,7 @@ RADEONGetATOMConnectorInfoFromBIOSConnectorTable (ScrnInfoPtr pScrn) #endif info->BiosConnector[i].valid = TRUE; + info->BiosConnector[i].shared_ddc = FALSE; info->BiosConnector[i].output_id = ci.sucI2cId.sbfAccess.bfI2C_LineMux; info->BiosConnector[i].devices = (1 << i); info->BiosConnector[i].ConnectorType = ci.sucConnectorInfo.sbfAccess.bfConnectorType; @@ -2028,6 +2046,9 @@ RADEONGetATOMConnectorInfoFromBIOSConnectorTable (ScrnInfoPtr pScrn) info->BiosConnector[j].DACType = info->BiosConnector[i].DACType; info->BiosConnector[j].devices |= info->BiosConnector[i].devices; info->BiosConnector[i].valid = FALSE; + } else { + info->BiosConnector[i].shared_ddc = TRUE; + info->BiosConnector[j].shared_ddc = TRUE; } /* other possible combos? */ } diff --git a/src/radeon_output.c b/src/radeon_output.c index bff65ad1..0ac19e75 100644 --- a/src/radeon_output.c +++ b/src/radeon_output.c @@ -243,8 +243,6 @@ radeon_ddc_connected(xf86OutputPtr output) } } if (MonInfo) { - if (!xf86ReturnOptValBool(info->Options, OPTION_IGNORE_EDID, FALSE)) - xf86OutputSetEDID(output, MonInfo); if (radeon_output->type == OUTPUT_LVDS) MonType = MT_LCD; else if (radeon_output->type == OUTPUT_DVI_D) @@ -258,6 +256,24 @@ radeon_ddc_connected(xf86OutputPtr output) MonType = MT_DFP; else MonType = MT_CRT; + + if (radeon_output->shared_ddc) { + if (radeon_output->type == OUTPUT_VGA) { + if (MonInfo->rawData[0x14] & 0x80) /* if it's digital and VGA */ + MonType = MT_NONE; + else + MonType = MT_CRT; + } else { + if (MonInfo->rawData[0x14] & 0x80) /* if it's digital and DVI/HDMI/etc. */ + MonType = MT_DFP; + else + MonType = MT_NONE; + } + } + + if (MonType != MT_NONE) + if (!xf86ReturnOptValBool(info->Options, OPTION_IGNORE_EDID, FALSE)) + xf86OutputSetEDID(output, MonInfo); } else MonType = MT_NONE; @@ -2667,6 +2683,7 @@ Bool RADEONSetupConnectors(ScrnInfoPtr pScrn) */ for (i = 0; i < RADEON_MAX_BIOS_CONNECTOR; i++) { info->BiosConnector[i].valid = FALSE; + info->BiosConnector[i].shared_ddc = FALSE; info->BiosConnector[i].ddc_i2c.valid = FALSE; info->BiosConnector[i].DACType = DAC_NONE; info->BiosConnector[i].TMDSType = TMDS_NONE; @@ -2790,6 +2807,7 @@ Bool RADEONSetupConnectors(ScrnInfoPtr pScrn) 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; + radeon_output->shared_ddc = info->BiosConnector[i].shared_ddc; 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 c14241eb..a971a312 100644 --- a/src/radeon_probe.h +++ b/src/radeon_probe.h @@ -208,6 +208,8 @@ typedef struct { int hpd_mask; RADEONI2CBusRec ddc_i2c; int igp_lane_info; + Bool shared_ddc; + int i2c_line_mux; } RADEONBIOSConnector; typedef struct _RADEONOutputPrivateRec { @@ -267,6 +269,7 @@ typedef struct _RADEONOutputPrivateRec { int output_id; int devices; Bool enabled; + Bool shared_ddc; } RADEONOutputPrivateRec, *RADEONOutputPrivatePtr; struct avivo_pll_state { |