summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Mainz <roland.mainz@nrubsig.org>2004-12-16 02:08:34 +0000
committerRoland Mainz <roland.mainz@nrubsig.org>2004-12-16 02:08:34 +0000
commit94fcff41482b0ba459e3d0d7865447335cbe66a5 (patch)
tree4b84b67193391bea8f0268ec465a7d50aa637e99
parent44c77bf413b480ac00bbdb707d9f3d135224fc4b (diff)
xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_bios.c
//bugs.freedesktop.org/show_bug.cgi?id=1559) attachment #1133 (https://bugs.freedesktop.org/attachment.cgi?id=1133): Fix display detection regression on Radeon Mobile. Patch by HUI YU <hyu@ati.com>
-rw-r--r--src/radeon_bios.c75
-rw-r--r--src/radeon_driver.c54
2 files changed, 101 insertions, 28 deletions
diff --git a/src/radeon_bios.c b/src/radeon_bios.c
index d54c9b9..37a3e26 100644
--- a/src/radeon_bios.c
+++ b/src/radeon_bios.c
@@ -198,13 +198,28 @@ Bool RADEONGetConnectorInfoFromBIOS (ScrnInfoPtr pScrn)
return FALSE;
}
} else {
+ /* Some laptops only have one connector (VGA) listed in the connector table,
+ * we need to add LVDS in as a non-DDC display.
+ * Note, we can't assume the listed VGA will be filled in PortInfo[0],
+ * when walking through connector table. connector_found has following meaning:
+ * 0 -- nothing found,
+ * 1 -- only PortInfo[0] filled,
+ * 2 -- only PortInfo[1] filled,
+ * 3 -- both are filled.
+ */
+ int connector_found = 0;
+
if ((tmp = RADEON_BIOS16(info->ROMHeaderStart + 0x50))) {
for (i = 1; i < 4; i++) {
if (!RADEON_BIOS8(tmp + i*2) && i > 1) break; /* end of table */
tmp0 = RADEON_BIOS16(tmp + i*2);
- if (((tmp0 >> 12) & 0x1f) == 0) continue; /* no connector */
+ if (((tmp0 >> 12) & 0x0f) == 0) continue; /* no connector */
+ if (connector_found > 0) {
+ if (pRADEONEnt->PortInfo[tmp1].DDCType == ((tmp0 >> 8) & 0x0f))
+ continue; /* same connector */
+ }
/* internal DDC_DVI port will get assigned to PortInfo[0], or if there is no DDC_DVI (like in some IGPs). */
tmp1 = ((((tmp0 >> 8) & 0xf) == DDC_DVI) || (tmp1 == 1)) ? 0 : 1; /* determine port info index */
@@ -222,9 +237,7 @@ Bool RADEONGetConnectorInfoFromBIOS (ScrnInfoPtr pScrn)
pRADEONEnt->PortInfo[tmp1].TMDSType == TMDS_INT)
pRADEONEnt->PortInfo[tmp1].TMDSType = TMDS_UNKNOWN;
- xf86DrvMsg(0, X_INFO, "Connector%d: DDCType-%d, DACType-%d, TMDSType-%d, ConnectorType-%d\n",
- tmp1, pRADEONEnt->PortInfo[tmp1].DDCType, pRADEONEnt->PortInfo[tmp1].DACType,
- pRADEONEnt->PortInfo[tmp1].TMDSType, pRADEONEnt->PortInfo[tmp1].ConnectorType);
+ connector_found += (tmp1 + 1);
}
} else {
xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "No Connector Info Table found!\n");
@@ -232,14 +245,54 @@ Bool RADEONGetConnectorInfoFromBIOS (ScrnInfoPtr pScrn)
}
if (info->IsMobility) {
- if ((tmp = RADEON_BIOS16(info->ROMHeaderStart + 0x42))) {
- if ((tmp0 = RADEON_BIOS16(tmp + 0x15))) {
- if ((tmp1 = RADEON_BIOS8(tmp0+2) & 0x07)) {
- pRADEONEnt->PortInfo[0].DDCType = tmp1;
- xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "LCD DDC Info Table found!\n");
- }
+ /* For the cases where only one VGA connector is found,
+ we assume LVDS is not listed in the connector table,
+ add it in here as the first port.
+ */
+ if ((connector_found < 3) && (pRADEONEnt->PortInfo[tmp1].ConnectorType == CONNECTOR_CRT)) {
+ if (connector_found == 1) {
+ memcpy (&pRADEONEnt->PortInfo[1], &pRADEONEnt->PortInfo[0],
+ sizeof (pRADEONEnt->PortInfo[0]));
+ }
+ pRADEONEnt->PortInfo[0].DACType = DAC_TVDAC;
+ pRADEONEnt->PortInfo[0].TMDSType = TMDS_UNKNOWN;
+ pRADEONEnt->PortInfo[0].DDCType = DDC_NONE_DETECTED;
+ pRADEONEnt->PortInfo[0].ConnectorType = CONNECTOR_PROPRIETARY;
+
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "LVDS port is not in connector table, added in.\n");
+ if (connector_found == 0) connector_found = 1;
+ else connector_found = 3;
}
- }
+
+ if ((tmp = RADEON_BIOS16(info->ROMHeaderStart + 0x42))) {
+ if ((tmp0 = RADEON_BIOS16(tmp + 0x15))) {
+ if ((tmp1 = RADEON_BIOS8(tmp0+2) & 0x07)) {
+ pRADEONEnt->PortInfo[0].DDCType = tmp1;
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "LCD DDC Info Table found!\n");
+ }
+ }
+ }
+ } else if (connector_found == 2) {
+ memcpy (&pRADEONEnt->PortInfo[0], &pRADEONEnt->PortInfo[1],
+ sizeof (pRADEONEnt->PortInfo[0]));
+ pRADEONEnt->PortInfo[1].DACType = DAC_UNKNOWN;
+ pRADEONEnt->PortInfo[1].TMDSType = TMDS_UNKNOWN;
+ pRADEONEnt->PortInfo[1].DDCType = DDC_NONE_DETECTED;
+ pRADEONEnt->PortInfo[1].ConnectorType = CONNECTOR_NONE;
+ connector_found = 1;
+ }
+
+ if (connector_found == 0) {
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "No connector found in Connector Info Table.\n");
+ } else {
+ xf86DrvMsg(0, X_INFO, "Connector0: DDCType-%d, DACType-%d, TMDSType-%d, ConnectorType-%d\n",
+ pRADEONEnt->PortInfo[0].DDCType, pRADEONEnt->PortInfo[0].DACType,
+ pRADEONEnt->PortInfo[0].TMDSType, pRADEONEnt->PortInfo[0].ConnectorType);
+ }
+ if (connector_found == 3) {
+ xf86DrvMsg(0, X_INFO, "Connector1: DDCType-%d, DACType-%d, TMDSType-%d, ConnectorType-%d\n",
+ pRADEONEnt->PortInfo[1].DDCType, pRADEONEnt->PortInfo[1].DACType,
+ pRADEONEnt->PortInfo[1].TMDSType, pRADEONEnt->PortInfo[1].ConnectorType);
}
#if 0
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 9d3daa9..a80c318 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -1712,6 +1712,13 @@ static BOOL RADEONQueryConnectedMonitors(ScrnInfoPtr pScrn)
break;
}
}
+ for (i = 0; i < max_mt; i++) {
+ if (strcmp(s2, MonTypeName[i]) == 0) {
+ pRADEONEnt->PortInfo[1].MonType = MonTypeID[i];
+ break;
+ }
+ }
+
if (i == max_mt)
xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
"Invalid Monitor type specified for 2nd port \n");
@@ -1744,32 +1751,45 @@ static BOOL RADEONQueryConnectedMonitors(ScrnInfoPtr pScrn)
}
- if (pRADEONEnt->PortInfo[0].MonType == MT_UNKNOWN || pRADEONEnt->PortInfo[1].MonType == MT_UNKNOWN) {
-
- if(((!info->HasCRTC2) || info->IsDellServer) &&
- (pRADEONEnt->PortInfo[0].MonType == MT_UNKNOWN)) {
+ if(((!info->HasCRTC2) || info->IsDellServer)) {
+ if (pRADEONEnt->PortInfo[0].MonType == MT_UNKNOWN) {
if((pRADEONEnt->PortInfo[0].MonType = RADEONDisplayDDCConnected(pScrn, DDC_DVI, &pRADEONEnt->PortInfo[0])));
else if((pRADEONEnt->PortInfo[0].MonType = RADEONDisplayDDCConnected(pScrn, DDC_VGA, &pRADEONEnt->PortInfo[0])));
else if((pRADEONEnt->PortInfo[0].MonType = RADEONDisplayDDCConnected(pScrn, DDC_CRT2, &pRADEONEnt->PortInfo[0])));
else
pRADEONEnt->PortInfo[0].MonType = MT_CRT;
+ }
- if (!ignore_edid) {
- if (pRADEONEnt->PortInfo[0].MonInfo) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Monitor1 EDID data ---------------------------\n");
- xf86PrintEDID(pRADEONEnt->PortInfo[0].MonInfo );
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "End of Monitor1 EDID data --------------------\n");
- }
+ if (!ignore_edid) {
+ if (pRADEONEnt->PortInfo[0].MonInfo) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Monitor1 EDID data ---------------------------\n");
+ xf86PrintEDID(pRADEONEnt->PortInfo[0].MonInfo );
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "End of Monitor1 EDID data --------------------\n");
}
-
- pRADEONEnt->MonType1 = pRADEONEnt->PortInfo[0].MonType;
- pRADEONEnt->MonInfo1 = pRADEONEnt->PortInfo[0].MonInfo;
- pRADEONEnt->MonType2 = MT_NONE;
- pRADEONEnt->MonInfo2 = NULL;
- info->MergeType = MT_NONE;
- return TRUE;
}
+ pRADEONEnt->MonType1 = pRADEONEnt->PortInfo[0].MonType;
+ pRADEONEnt->MonInfo1 = pRADEONEnt->PortInfo[0].MonInfo;
+ pRADEONEnt->MonType2 = MT_NONE;
+ pRADEONEnt->MonInfo2 = NULL;
+ info->MergeType = MT_NONE;
+ info->DisplayType = pRADEONEnt->MonType1;
+
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Primary:\n Monitor -- %s\n Connector -- %s\n DAC Type -- %s\n TMDS Type -- %s\n DDC Type -- %s\n",
+ MonTypeName[pRADEONEnt->PortInfo[0].MonType+1],
+ info->IsAtomBios ?
+ ConnectorTypeNameATOM[pRADEONEnt->PortInfo[0].ConnectorType]:
+ ConnectorTypeName[pRADEONEnt->PortInfo[0].ConnectorType],
+ DACTypeName[pRADEONEnt->PortInfo[0].DACType+1],
+ TMDSTypeName[pRADEONEnt->PortInfo[0].TMDSType+1],
+ DDCTypeName[pRADEONEnt->PortInfo[0].DDCType]);
+
+ return TRUE;
+ }
+
+ if (pRADEONEnt->PortInfo[0].MonType == MT_UNKNOWN || pRADEONEnt->PortInfo[1].MonType == MT_UNKNOWN) {
+
/* Primary Head (DVI or Laptop Int. panel)*/
/* A ddc capable display connected on DVI port */
if (pRADEONEnt->PortInfo[0].MonType == MT_UNKNOWN) {