summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deucher <alex@botch2.(none)>2007-11-09 17:11:43 -0500
committerAlex Deucher <alex@botch2.(none)>2007-11-09 17:11:43 -0500
commit342e3e207efda42ba679731c30dfb9d5e9d5643f (patch)
tree35f708c9531b42b2e8ac610eb77fd063a2b92d1c
parent8078c299d5941460243944d55051547c1a4d3791 (diff)
combine outputs based on id
-rw-r--r--src/radeon_bios.c34
-rw-r--r--src/radeon_output.c1
-rw-r--r--src/radeon_probe.h2
3 files changed, 24 insertions, 13 deletions
diff --git a/src/radeon_bios.c b/src/radeon_bios.c
index 9218079f..342e458b 100644
--- a/src/radeon_bios.c
+++ b/src/radeon_bios.c
@@ -162,7 +162,7 @@ Bool RADEONGetBIOSInfo(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
static Bool RADEONGetATOMConnectorInfoFromBIOS (ScrnInfoPtr pScrn)
{
RADEONInfoPtr info = RADEONPTR (pScrn);
- int offset, i, tmp, tmp0, crtc, portinfo, gpio;
+ int offset, i, j, tmp, tmp0, id, portinfo, gpio;
if (!info->VBIOS) return FALSE;
@@ -176,10 +176,11 @@ static Bool RADEONGetATOMConnectorInfoFromBIOS (ScrnInfoPtr pScrn)
portinfo = RADEON_BIOS16(offset + 6 + i * 2);
info->BiosConnector[i].DACType = (portinfo & 0xf) - 1;
info->BiosConnector[i].ConnectorType = (portinfo >> 4) & 0xf;
- crtc = (portinfo >> 8) & 0xf;
+ id = (portinfo >> 8) & 0xf;
tmp0 = RADEON_BIOS16(info->MasterDataStart + 24);
- gpio = RADEON_BIOS16(tmp0 + 4 + 27 * crtc) * 4;
+ gpio = RADEON_BIOS16(tmp0 + 4 + 27 * id) * 4;
info->BiosConnector[i].gpio = gpio;
+ info->BiosConnector[i].output_id = id;
switch(gpio) {
case RADEON_GPIO_MONID:
@@ -221,18 +222,25 @@ static Bool RADEONGetATOMConnectorInfoFromBIOS (ScrnInfoPtr pScrn)
return FALSE;
}
- /* DVI-I ports have 2 entries: one for analog, one for digital. combine them */
- if (info->BiosConnector[0].valid && info->BiosConnector[7].valid) {
- info->BiosConnector[7].DACType = info->BiosConnector[0].DACType;
- info->BiosConnector[0].valid = FALSE;
- }
-
- if (info->BiosConnector[4].valid && info->BiosConnector[3].valid) {
- info->BiosConnector[3].DACType = info->BiosConnector[4].DACType;
- info->BiosConnector[4].valid = FALSE;
+ for (i = 0; i < 8; i++) {
+ if (info->BiosConnector[i].valid) {
+ for (j = 0; j < 8; j++) {
+ if (info->BiosConnector[j].valid && (i != j) ) {
+ if (info->BiosConnector[i].output_id == info->BiosConnector[j].output_id) {
+ if ((i == 3) || (i == 7)) {
+ info->BiosConnector[i].DACType = info->BiosConnector[j].DACType;
+ info->BiosConnector[j].valid = FALSE;
+ } else if ((j == 3) || (j == 7)) {
+ info->BiosConnector[j].DACType = info->BiosConnector[i].DACType;
+ info->BiosConnector[i].valid = FALSE;
+ }
+ /* other possible combos? */
+ }
+ }
+ }
+ }
}
-
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Bios Connector table: \n");
for (i = 0; i < RADEON_MAX_BIOS_CONNECTOR; i++) {
if (info->BiosConnector[i].valid) {
diff --git a/src/radeon_output.c b/src/radeon_output.c
index ca9b110d..e6b5e3f7 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -3240,6 +3240,7 @@ Bool RADEONSetupConnectors(ScrnInfoPtr pScrn)
radeon_output->MonType = MT_UNKNOWN;
radeon_output->ConnectorType = info->BiosConnector[i].ConnectorType;
radeon_output->gpio = info->BiosConnector[i].gpio;
+ radeon_output->output_id = info->BiosConnector[i].output_id;
radeon_output->DDCType = info->BiosConnector[i].DDCType;
if (info->IsAtomBios) {
if (radeon_output->ConnectorType == CONNECTOR_DVI_D_ATOM)
diff --git a/src/radeon_probe.h b/src/radeon_probe.h
index db808d22..c24993c7 100644
--- a/src/radeon_probe.h
+++ b/src/radeon_probe.h
@@ -192,6 +192,7 @@ typedef struct {
RADEONConnectorType ConnectorType;
Bool valid;
int gpio;
+ int output_id;
} RADEONBIOSConnector;
typedef struct _RADEONOutputPrivateRec {
@@ -240,6 +241,7 @@ typedef struct _RADEONOutputPrivateRec {
unsigned long gpio;
char *name;
+ int output_id;
} RADEONOutputPrivateRec, *RADEONOutputPrivatePtr;
#define RADEON_MAX_CRTC 2