diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2009-01-20 00:58:18 -0500 |
---|---|---|
committer | Alex Deucher <alexdeucher@gmail.com> | 2009-01-20 00:58:18 -0500 |
commit | 152d1d4c179c262be4d0a5618400aa13b4820342 (patch) | |
tree | 56f1ebea11cc29aa8303502cdffe4f4d2d15894d /src/radeon_bios.c | |
parent | 7cc7ba8bf9ce2f0eebfd9b48aa648c416c333ff4 (diff) |
First pass at converting legacy code to encoder objects
Diffstat (limited to 'src/radeon_bios.c')
-rw-r--r-- | src/radeon_bios.c | 162 |
1 files changed, 147 insertions, 15 deletions
diff --git a/src/radeon_bios.c b/src/radeon_bios.c index badcb018..cfd858f1 100644 --- a/src/radeon_bios.c +++ b/src/radeon_bios.c @@ -543,21 +543,138 @@ static Bool RADEONGetLegacyConnectorInfoFromBIOS (ScrnInfoPtr pScrn) switch (ConnectorType) { case CONNECTOR_PROPRIETARY_LEGACY: info->BiosConnector[i].ConnectorType = CONNECTOR_DVI_D; + if ((tmp >> 4) & 0x1) { + info->BiosConnector[i].TMDSType = TMDS_EXT; + info->BiosConnector[i].devices |= ATOM_DEVICE_DFP2_SUPPORT; + info->BiosConnector[i].encoders[ATOM_DEVICE_DFP2_INDEX] = + radeon_add_encoder(pScrn, + radeon_get_encoder_id_from_supported_device(pScrn, + ATOM_DEVICE_DFP2_SUPPORT, + 0), + ATOM_DEVICE_DFP2_SUPPORT); + } else { + info->BiosConnector[i].TMDSType = TMDS_INT; + info->BiosConnector[i].devices |= ATOM_DEVICE_DFP1_SUPPORT; + info->BiosConnector[i].encoders[ATOM_DEVICE_DFP1_INDEX] = + radeon_add_encoder(pScrn, + radeon_get_encoder_id_from_supported_device(pScrn, + ATOM_DEVICE_DFP1_SUPPORT, + 0), + ATOM_DEVICE_DFP1_SUPPORT); + } break; case CONNECTOR_CRT_LEGACY: info->BiosConnector[i].ConnectorType = CONNECTOR_VGA; + if (tmp & 0x1) { + info->BiosConnector[i].DACType = DAC_TVDAC; + info->BiosConnector[i].load_detection = FALSE; + info->BiosConnector[i].devices |= ATOM_DEVICE_CRT2_SUPPORT; + info->BiosConnector[i].encoders[ATOM_DEVICE_CRT2_INDEX] = + radeon_add_encoder(pScrn, + radeon_get_encoder_id_from_supported_device(pScrn, + ATOM_DEVICE_CRT2_SUPPORT, + 0), + ATOM_DEVICE_CRT2_SUPPORT); + } else { + info->BiosConnector[i].DACType = DAC_PRIMARY; + info->BiosConnector[i].load_detection = TRUE; + info->BiosConnector[i].devices |= ATOM_DEVICE_CRT1_SUPPORT; + info->BiosConnector[i].encoders[ATOM_DEVICE_CRT1_INDEX] = + radeon_add_encoder(pScrn, + radeon_get_encoder_id_from_supported_device(pScrn, + ATOM_DEVICE_CRT1_SUPPORT, + 0), + ATOM_DEVICE_CRT1_SUPPORT); + } break; case CONNECTOR_DVI_I_LEGACY: info->BiosConnector[i].ConnectorType = CONNECTOR_DVI_I; + if (tmp & 0x1) { + info->BiosConnector[i].DACType = DAC_TVDAC; + info->BiosConnector[i].load_detection = FALSE; + info->BiosConnector[i].devices |= ATOM_DEVICE_CRT2_SUPPORT; + info->BiosConnector[i].encoders[ATOM_DEVICE_CRT2_INDEX] = + radeon_add_encoder(pScrn, + radeon_get_encoder_id_from_supported_device(pScrn, + ATOM_DEVICE_CRT2_SUPPORT, + 0), + ATOM_DEVICE_CRT2_SUPPORT); + } else { + info->BiosConnector[i].DACType = DAC_PRIMARY; + info->BiosConnector[i].load_detection = TRUE; + info->BiosConnector[i].devices |= ATOM_DEVICE_CRT1_SUPPORT; + info->BiosConnector[i].encoders[ATOM_DEVICE_CRT1_INDEX] = + radeon_add_encoder(pScrn, + radeon_get_encoder_id_from_supported_device(pScrn, + ATOM_DEVICE_CRT1_SUPPORT, + 0), + ATOM_DEVICE_CRT1_SUPPORT); + } + if ((tmp >> 4) & 0x1) { + info->BiosConnector[i].TMDSType = TMDS_EXT; + info->BiosConnector[i].devices |= ATOM_DEVICE_DFP2_SUPPORT; + info->BiosConnector[i].encoders[ATOM_DEVICE_DFP2_INDEX] = + radeon_add_encoder(pScrn, + radeon_get_encoder_id_from_supported_device(pScrn, + ATOM_DEVICE_DFP2_SUPPORT, + 0), + ATOM_DEVICE_DFP2_SUPPORT); + } else { + info->BiosConnector[i].TMDSType = TMDS_INT; + info->BiosConnector[i].devices |= ATOM_DEVICE_DFP1_SUPPORT; + info->BiosConnector[i].encoders[ATOM_DEVICE_DFP1_INDEX] = + radeon_add_encoder(pScrn, + radeon_get_encoder_id_from_supported_device(pScrn, + ATOM_DEVICE_DFP1_SUPPORT, + 0), + ATOM_DEVICE_DFP1_SUPPORT); + } break; case CONNECTOR_DVI_D_LEGACY: info->BiosConnector[i].ConnectorType = CONNECTOR_DVI_D; + if ((tmp >> 4) & 0x1) { + info->BiosConnector[i].TMDSType = TMDS_EXT; + info->BiosConnector[i].devices |= ATOM_DEVICE_DFP2_SUPPORT; + info->BiosConnector[i].encoders[ATOM_DEVICE_DFP2_INDEX] = + radeon_add_encoder(pScrn, + radeon_get_encoder_id_from_supported_device(pScrn, + ATOM_DEVICE_DFP2_SUPPORT, + 0), + ATOM_DEVICE_DFP2_SUPPORT); + } else { + info->BiosConnector[i].TMDSType = TMDS_INT; + info->BiosConnector[i].devices |= ATOM_DEVICE_DFP1_SUPPORT; + info->BiosConnector[i].encoders[ATOM_DEVICE_DFP1_INDEX] = + radeon_add_encoder(pScrn, + radeon_get_encoder_id_from_supported_device(pScrn, + ATOM_DEVICE_DFP1_SUPPORT, + 0), + ATOM_DEVICE_DFP1_SUPPORT); + } break; case CONNECTOR_CTV_LEGACY: info->BiosConnector[i].ConnectorType = CONNECTOR_CTV; + info->BiosConnector[i].DACType = DAC_TVDAC; + info->BiosConnector[i].load_detection = FALSE; + info->BiosConnector[i].devices = ATOM_DEVICE_TV1_SUPPORT; + info->BiosConnector[i].encoders[ATOM_DEVICE_CRT2_INDEX] = + radeon_add_encoder(pScrn, + radeon_get_encoder_id_from_supported_device(pScrn, + ATOM_DEVICE_CRT2_SUPPORT, + 0), + ATOM_DEVICE_CRT2_SUPPORT); break; case CONNECTOR_STV_LEGACY: info->BiosConnector[i].ConnectorType = CONNECTOR_STV; + info->BiosConnector[i].DACType = DAC_TVDAC; + info->BiosConnector[i].load_detection = FALSE; + info->BiosConnector[i].devices = ATOM_DEVICE_TV1_SUPPORT; + info->BiosConnector[i].encoders[ATOM_DEVICE_CRT2_INDEX] = + radeon_add_encoder(pScrn, + radeon_get_encoder_id_from_supported_device(pScrn, + ATOM_DEVICE_CRT2_SUPPORT, + 0), + ATOM_DEVICE_CRT2_SUPPORT); break; default: xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Unknown Connector Type: %d\n", ConnectorType); @@ -586,21 +703,6 @@ static Bool RADEONGetLegacyConnectorInfoFromBIOS (ScrnInfoPtr pScrn) break; } - if (tmp & 0x1) - info->BiosConnector[i].DACType = DAC_TVDAC; - else - info->BiosConnector[i].DACType = DAC_PRIMARY; - - if ((tmp >> 4) & 0x1) - info->BiosConnector[i].TMDSType = TMDS_EXT; - else - info->BiosConnector[i].TMDSType = TMDS_INT; - - if (info->BiosConnector[i].DACType == DAC_TVDAC) - info->BiosConnector[i].load_detection = FALSE; - else - info->BiosConnector[i].load_detection = TRUE; - RADEONApplyLegacyQuirks(pScrn, i); } @@ -617,8 +719,23 @@ static Bool RADEONGetLegacyConnectorInfoFromBIOS (ScrnInfoPtr pScrn) info->BiosConnector[0].valid = TRUE; info->BiosConnector[0].ConnectorType = CONNECTOR_DVI_I; info->BiosConnector[0].DACType = DAC_PRIMARY; + info->BiosConnector[0].load_detection = TRUE; info->BiosConnector[0].TMDSType = TMDS_INT; info->BiosConnector[0].ddc_i2c = legacy_setup_i2c_bus(RADEON_GPIO_DVI_DDC); + info->BiosConnector[0].TMDSType = TMDS_INT; + info->BiosConnector[0].devices = ATOM_DEVICE_CRT1_SUPPORT | ATOM_DEVICE_DFP1_INDEX; + info->BiosConnector[0].encoders[ATOM_DEVICE_DFP1_INDEX] = + radeon_add_encoder(pScrn, + radeon_get_encoder_id_from_supported_device(pScrn, + ATOM_DEVICE_DFP1_SUPPORT, + 0), + ATOM_DEVICE_DFP1_SUPPORT); + info->BiosConnector[0].encoders[ATOM_DEVICE_CRT1_INDEX] = + radeon_add_encoder(pScrn, + radeon_get_encoder_id_from_supported_device(pScrn, + ATOM_DEVICE_CRT1_SUPPORT, + 0), + ATOM_DEVICE_CRT1_SUPPORT); } else return FALSE; } @@ -635,6 +752,14 @@ static Bool RADEONGetLegacyConnectorInfoFromBIOS (ScrnInfoPtr pScrn) info->BiosConnector[4].LVDSType = LVDS_INT; info->BiosConnector[4].ddc_i2c.valid = FALSE; + info->BiosConnector[4].devices = ATOM_DEVICE_LCD1_SUPPORT; + info->BiosConnector[4].encoders[ATOM_DEVICE_LCD1_INDEX] = + radeon_add_encoder(pScrn, + radeon_get_encoder_id_from_supported_device(pScrn, + ATOM_DEVICE_LCD1_SUPPORT, + 0), + ATOM_DEVICE_LCD1_SUPPORT); + tmp = RADEON_BIOS16(info->ROMHeaderStart + 0x42); if (tmp) { tmp0 = RADEON_BIOS16(tmp + 0x15); @@ -701,6 +826,13 @@ static Bool RADEONGetLegacyConnectorInfoFromBIOS (ScrnInfoPtr pScrn) info->BiosConnector[5].load_detection = FALSE; info->BiosConnector[5].TMDSType = TMDS_NONE; info->BiosConnector[5].ddc_i2c.valid = FALSE; + info->BiosConnector[5].devices = ATOM_DEVICE_TV1_SUPPORT; + info->BiosConnector[5].encoders[ATOM_DEVICE_CRT2_INDEX] = + radeon_add_encoder(pScrn, + radeon_get_encoder_id_from_supported_device(pScrn, + ATOM_DEVICE_CRT2_SUPPORT, + 0), + ATOM_DEVICE_CRT2_SUPPORT); } } } |