summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlex Deucher <alex@botch2.(none)>2008-01-07 01:13:09 -0500
committerAlex Deucher <alex@botch2.(none)>2008-01-07 01:13:09 -0500
commitfa3e2055225c27e25465fc46786da1b7574fd3cc (patch)
tree92aa60ecbb1f8369e6615235a3e8422d391924a6 /src
parentd972cc9237eb90b49b11f8d2bdc5b61f628911dc (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/radeon_driver.c52
-rw-r--r--src/radeon_output.c4
2 files changed, 45 insertions, 11 deletions
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 176e80d6..d10d81be 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 b9c81652..b62eeaf7 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) {