xf86-video-ati: Branch 'master'

Alex Deucher agd5f at kemper.freedesktop.org
Sun Jan 6 22:13:17 PST 2008


 src/radeon_driver.c |   52 +++++++++++++++++++++++++++++++++++++++++++---------
 src/radeon_output.c |    4 ++--
 2 files changed, 45 insertions(+), 11 deletions(-)

New commits:
commit fa3e2055225c27e25465fc46786da1b7574fd3cc
Author: Alex Deucher <alex at botch2.(none)>
Date:   Mon Jan 7 01:13:09 2008 -0500

    RADEON: add default outputs if no connected devices
    
    If no connected devices found at server startup, default
    to something so the server comes up.  LVDS on mobility chips,
    DAC or TMDS on others.

diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 176e80d..d10d81b 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -2653,6 +2653,7 @@ static Bool RADEONPreInitControllers(ScrnInfoPtr pScrn)
     RADEONInfoPtr info = RADEONPTR(pScrn);
     int i;
     int mask;
+    int found = 0;
 
     if (!info->IsPrimary && !info->IsSecondary)
 	mask = 3;
@@ -2677,17 +2678,50 @@ static Bool RADEONPreInitControllers(ScrnInfoPtr pScrn)
       
     RADEONPrintPortMap(pScrn);
 
-    for (i = 0; i < config->num_output; i++) 
-    {
-      xf86OutputPtr	      output = config->output[i];
+    for (i = 0; i < config->num_output; i++) {
+	xf86OutputPtr	      output = config->output[i];
       
-      output->status = (*output->funcs->detect) (output);
-      ErrorF("finished output detect: %d\n", i);
-      if (info->IsPrimary || info->IsSecondary) {
-             if (output->status != XF86OutputStatusConnected)
-	         return FALSE;
-      }
+	output->status = (*output->funcs->detect) (output);
+	ErrorF("finished output detect: %d\n", i);
+	if (info->IsPrimary || info->IsSecondary) {
+	    if (output->status != XF86OutputStatusConnected)
+		return FALSE;
+	}
+	if (output->status != XF86OutputStatusDisconnected)
+	    found++;
+    }
+
+    if (!found) {
+	/* nothing connected, light up some defaults so the server comes up */
+	xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No connected devices found!\n");
+	for (i = 0; i < config->num_output; i++) {
+	    xf86OutputPtr output = config->output[i];
+	    RADEONOutputPrivatePtr radeon_output = output->driver_private;
+
+	    if (info->IsMobility) {
+		if (radeon_output->type == OUTPUT_LVDS) {
+		    radeon_output->MonType = MT_LCD;
+		    output->status = XF86OutputStatusConnected;
+		    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Using LVDS default\n");
+		    break;
+		}
+	    } else {
+		if (radeon_output->type == OUTPUT_VGA ||
+		    radeon_output->type == OUTPUT_DVI_I) {
+		    radeon_output->MonType = MT_CRT;
+		    output->status = XF86OutputStatusUnknown;
+		    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Using VGA default\n");
+		    break;
+		} else if (radeon_output->type == OUTPUT_DVI_D) {
+		    radeon_output->MonType = MT_DFP;
+		    output->status = XF86OutputStatusUnknown;
+		    xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Using DVI default\n");
+		    break;
+		}
+	    }
+	}
     }
+
     ErrorF("finished all detect\n");
     return TRUE;
 }
diff --git a/src/radeon_output.c b/src/radeon_output.c
index b9c8165..b62eeaf 100644
--- a/src/radeon_output.c
+++ b/src/radeon_output.c
@@ -626,7 +626,6 @@ static xf86OutputStatus
 radeon_detect(xf86OutputPtr output)
 {
     ScrnInfoPtr	    pScrn = output->scrn;
-    RADEONInfoPtr info = RADEONPTR(pScrn);
     RADEONOutputPrivatePtr radeon_output = output->driver_private;
     Bool connected = TRUE;
 
@@ -675,6 +674,7 @@ radeon_detect(xf86OutputPtr output)
 	  break;
       }
 
+#if 0
       if (!connected) {
 	  /* default to unknown for flaky chips/connectors
 	   * so we can get something on the screen
@@ -690,6 +690,7 @@ radeon_detect(xf86OutputPtr output)
 	      return XF86OutputStatusUnknown;
 	  }
       }
+#endif
 
       if (connected)
 	  return XF86OutputStatusConnected;
@@ -755,7 +756,6 @@ radeon_create_resources(xf86OutputPtr output)
     INT32 range[2];
     int data, err;
     const char *s;
-    char *optstr;
 
     /* backlight control */
     if (radeon_output->type == OUTPUT_LVDS) {


More information about the xorg-commit mailing list