xf86-video-ati: Branch 'randr-1.2'

Alex Deucher agd5f at kemper.freedesktop.org
Mon Aug 20 17:53:58 PDT 2007


 man/radeon.man      |   13 ++--
 src/radeon.h        |    3 -
 src/radeon_driver.c |    1 
 src/radeon_output.c |  141 ++++++++++++++++++++++++++++++++++------------------
 4 files changed, 103 insertions(+), 55 deletions(-)

New commits:
diff-tree 9470bd67731059f26859ed5f0bea3ade09e2c80c (from b275febdb0918e8cebdffbb433b0eeb3ff4d3746)
Author: Alex Deucher <alex at botch2.com>
Date:   Mon Aug 20 20:54:06 2007 -0400

    RADEON: Add DefaultConnectorTable option
    
    This option skips the parsing the BIOS connector table
    and falls back to chip specific defaults.
    Also remove man page section for the now gone bioshotkeys
    option.

diff --git a/man/radeon.man b/man/radeon.man
index fcb6d73..63bbb9b 100644
--- a/man/radeon.man
+++ b/man/radeon.man
@@ -363,13 +363,6 @@ life by reducing power usage.  Some user
 with this enabled.  The default is
 .B off.
 .TP
-.BI "Option \*qBIOSHotkeys\*q \*q" boolean \*q
-Enable BIOS hotkey output switching. This allows the BIOS to toggle outputs
-using hotkeys (e.g., fn-f7, etc.).  Since the driver does not support ACPI, 
-there is no way to validate modes on an output switch and the BIOS can 
-potentially change things behind the driver's back.  The default is
-.B off.
-.TP
 .BI "Option \*qVGAAccess\*q \*q" boolean \*q
 Tell the driver if it can do legacy VGA IOs to the card. This is
 necessary for properly resuming consoles when in VGA text mode, but
@@ -406,6 +399,12 @@ for RN50/ES1000 and
 .B on 
 for others.
 .TP
+.BI "Option \*qDefaultConnectorTable\*q \*q" boolean \*q
+Enable this option to skip the BIOS connector table parsing and use the
+driver defaults for each chip.  
+The default is
+.B off 
+.TP
 
 .SH SEE ALSO
 __xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__)
diff --git a/src/radeon.h b/src/radeon.h
index 4f7f60e..a778cb8 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -151,7 +151,8 @@ typedef enum {
     OPTION_ACCELMETHOD,
     OPTION_CONSTANTDPI,
     OPTION_CONNECTORTABLE,
-    OPTION_DRI
+    OPTION_DRI,
+    OPTION_DEFAULT_CONNECTOR_TABLE
 } RADEONOpts;
 
 
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index ae34cf3..c822937 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -188,6 +188,7 @@ static const OptionInfoRec RADEONOptions
     { OPTION_CONSTANTDPI,    "ConstantDPI",	 OPTV_BOOLEAN, {0}, FALSE },
     { OPTION_DRI,            "DRI",       	 OPTV_BOOLEAN, {0}, FALSE },
     { OPTION_CONNECTORTABLE, "ConnectorTable",   OPTV_STRING,  {0}, FALSE },
+    { OPTION_DEFAULT_CONNECTOR_TABLE, "DefaultConnectorTable", OPTV_BOOLEAN, {0}, FALSE },
     { -1,                    NULL,               OPTV_NONE,    {0}, FALSE }
 };
 
diff --git a/src/radeon_output.c b/src/radeon_output.c
index 73e44f3..9650a39 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -2344,34 +2344,29 @@ void RADEONInitConnector(xf86OutputPtr o
 
 }
 
-/*
- * initialise the static data sos we don't have to re-do at randr change */
-Bool RADEONSetupConnectors(ScrnInfoPtr pScrn)
+static void RADEONSetupGenericConnectors(ScrnInfoPtr pScrn)
 {
     RADEONInfoPtr info       = RADEONPTR(pScrn);
-    RADEONEntPtr pRADEONEnt  = RADEONEntPriv(pScrn);
-    xf86OutputPtr output;
-    char *optstr;
-    int i = 0;
-    int num_vga = 0;
-    int num_dvi = 0;
 
-    /* We first get the information about all connectors from BIOS.
-     * This is how the card is phyiscally wired up.
-     * The information should be correct even on a OEM card.
-     * If not, we may have problem -- need to use MonitorLayout option.
-     */
-    for (i = 0; i < RADEON_MAX_BIOS_CONNECTOR; i++) {
-	info->BiosConnector[i].valid = FALSE;
-	info->BiosConnector[i].DDCType = DDC_NONE_DETECTED;
-	info->BiosConnector[i].DACType = DAC_UNKNOWN;
-	info->BiosConnector[i].TMDSType = TMDS_UNKNOWN;
-	info->BiosConnector[i].ConnectorType = CONNECTOR_NONE;
-    }
+    if (info->IsMobility) {
+	/* Below is the most common setting, but may not be true */
+	if (info->IsIGP) {
+	    info->BiosConnector[0].DDCType = DDC_LCD;
+	    info->BiosConnector[0].DACType = DAC_UNKNOWN;
+	    info->BiosConnector[0].TMDSType = TMDS_UNKNOWN;
+	    info->BiosConnector[0].ConnectorType = CONNECTOR_PROPRIETARY;
+	    info->BiosConnector[0].valid = TRUE;
 
-    if (!RADEONGetConnectorInfoFromBIOS(pScrn)) {
-	if (info->IsMobility) {
-	    /* Below is the most common setting, but may not be true */
+	    /* IGP only has TVDAC */
+	    if (info->ChipFamily == CHIP_FAMILY_RS400)
+		info->BiosConnector[1].DDCType = DDC_CRT2;
+	    else
+		info->BiosConnector[1].DDCType = DDC_VGA;
+	    info->BiosConnector[1].DACType = DAC_TVDAC;
+	    info->BiosConnector[1].TMDSType = TMDS_UNKNOWN;
+	    info->BiosConnector[1].ConnectorType = CONNECTOR_CRT;
+	    info->BiosConnector[1].valid = TRUE;
+	} else {
 #if defined(__powerpc__)
 	    info->BiosConnector[0].DDCType = DDC_DVI;
 #else
@@ -2387,9 +2382,28 @@ Bool RADEONSetupConnectors(ScrnInfoPtr p
 	    info->BiosConnector[1].TMDSType = TMDS_EXT;
 	    info->BiosConnector[1].ConnectorType = CONNECTOR_CRT;
 	    info->BiosConnector[1].valid = TRUE;
+	}
+    } else {
+	/* Below is the most common setting, but may not be true */
+	if (info->IsIGP) {
+	    if (info->ChipFamily == CHIP_FAMILY_RS400)
+		info->BiosConnector[0].DDCType = DDC_CRT2;
+	    else
+		info->BiosConnector[0].DDCType = DDC_VGA;
+	    info->BiosConnector[0].DACType = DAC_TVDAC;
+	    info->BiosConnector[0].TMDSType = TMDS_UNKNOWN;
+	    info->BiosConnector[0].ConnectorType = CONNECTOR_CRT;
+	    info->BiosConnector[0].valid = TRUE;
 
+	    /* not sure what a good default DDCType for DVI on 
+	     * IGP desktop chips is
+	     */
+	    info->BiosConnector[1].DDCType = DDC_MONID; /* DDC_DVI? */
+	    info->BiosConnector[1].DACType = DAC_UNKNOWN;
+	    info->BiosConnector[1].TMDSType = TMDS_EXT;
+	    info->BiosConnector[1].ConnectorType = CONNECTOR_DVI_D;
+	    info->BiosConnector[1].valid = TRUE;
 	} else {
-	    /* Below is the most common setting, but may not be true */
 	    info->BiosConnector[0].DDCType = DDC_DVI;
 	    info->BiosConnector[0].DACType = DAC_TVDAC;
 	    info->BiosConnector[0].TMDSType = TMDS_INT;
@@ -2402,35 +2416,68 @@ Bool RADEONSetupConnectors(ScrnInfoPtr p
 	    info->BiosConnector[1].ConnectorType = CONNECTOR_CRT;
 	    info->BiosConnector[1].valid = TRUE;
 	}
+    }
 
-	if (info->InternalTVOut) {
-	    info->BiosConnector[2].ConnectorType = CONNECTOR_STV;
-	    info->BiosConnector[2].DACType = DAC_TVDAC;
-	    info->BiosConnector[2].TMDSType = TMDS_NONE;
-	    info->BiosConnector[2].DDCType = DDC_NONE_DETECTED;
-	    info->BiosConnector[2].valid = TRUE;
-	}
+    if (info->InternalTVOut) {
+	info->BiosConnector[2].ConnectorType = CONNECTOR_STV;
+	info->BiosConnector[2].DACType = DAC_TVDAC;
+	info->BiosConnector[2].TMDSType = TMDS_NONE;
+	info->BiosConnector[2].DDCType = DDC_NONE_DETECTED;
+	info->BiosConnector[2].valid = TRUE;
+    }
+
+    /* Some cards have the DDC lines swapped and we have no way to
+     * detect it yet (Mac cards)
+     */
+    if (xf86ReturnOptValBool(info->Options, OPTION_REVERSE_DDC, FALSE)) {
+	info->BiosConnector[0].DDCType = DDC_VGA;
+	info->BiosConnector[1].DDCType = DDC_DVI;
+    }
+
+}
+
+/*
+ * initialise the static data sos we don't have to re-do at randr change */
+Bool RADEONSetupConnectors(ScrnInfoPtr pScrn)
+{
+    RADEONInfoPtr info       = RADEONPTR(pScrn);
+    RADEONEntPtr pRADEONEnt  = RADEONEntPriv(pScrn);
+    xf86OutputPtr output;
+    char *optstr;
+    int i = 0;
+    int num_vga = 0;
+    int num_dvi = 0;
 
-       /* Some cards have the DDC lines swapped and we have no way to
-        * detect it yet (Mac cards)
-        */
-       if (xf86ReturnOptValBool(info->Options, OPTION_REVERSE_DDC, FALSE)) {
-           info->BiosConnector[0].DDCType = DDC_VGA;
-           info->BiosConnector[1].DDCType = DDC_DVI;
-        }
+    /* We first get the information about all connectors from BIOS.
+     * This is how the card is phyiscally wired up.
+     * The information should be correct even on a OEM card.
+     */
+    for (i = 0; i < RADEON_MAX_BIOS_CONNECTOR; i++) {
+	info->BiosConnector[i].valid = FALSE;
+	info->BiosConnector[i].DDCType = DDC_NONE_DETECTED;
+	info->BiosConnector[i].DACType = DAC_UNKNOWN;
+	info->BiosConnector[i].TMDSType = TMDS_UNKNOWN;
+	info->BiosConnector[i].ConnectorType = CONNECTOR_NONE;
+    }
+
+    if (xf86ReturnOptValBool(info->Options, OPTION_DEFAULT_CONNECTOR_TABLE, FALSE)) {
+	RADEONSetupGenericConnectors(pScrn);
+    } else {
+	if (!RADEONGetConnectorInfoFromBIOS(pScrn))
+	    RADEONSetupGenericConnectors(pScrn);
     }
 
     if (info->HasSingleDAC) {
         /* For RS300/RS350/RS400 chips, there is no primary DAC. Force VGA port to use TVDAC*/
-        if (info->BiosConnector[0].ConnectorType == CONNECTOR_CRT) {
-            info->BiosConnector[0].DACType = DAC_TVDAC;
-            info->BiosConnector[1].DACType = DAC_NONE;
-        } else {
-            info->BiosConnector[1].DACType = DAC_TVDAC;
-            info->BiosConnector[0].DACType = DAC_NONE;
-        }
+	for (i = 0; i < RADEON_MAX_BIOS_CONNECTOR; i++) {
+	    if (info->BiosConnector[i].ConnectorType == CONNECTOR_CRT)
+		info->BiosConnector[i].DACType = DAC_TVDAC;
+	}
     } else if (!pRADEONEnt->HasCRTC2) {
-        info->BiosConnector[0].DACType = DAC_PRIMARY;
+	for (i = 0; i < RADEON_MAX_BIOS_CONNECTOR; i++) {
+	    if (info->BiosConnector[i].ConnectorType == CONNECTOR_CRT)
+		info->BiosConnector[i].DACType = DAC_PRIMARY;
+	}
     }
 
     /* parse connector table option */


More information about the xorg-commit mailing list