diff options
author | Keith Packard <keithp@neko.keithp.com> | 2007-04-16 09:55:58 -0700 |
---|---|---|
committer | Keith Packard <keithp@neko.keithp.com> | 2007-04-16 09:55:58 -0700 |
commit | a3d73ba2cb7e13a6d129cd88d6a7f7d756e2ced2 (patch) | |
tree | f8f0bfa4f26d722c004dacf8c56d8cfd8423a2d1 | |
parent | f4a8e54caf6b9431711383a39f55a18e7fd654f4 (diff) |
Allow outputs to be explicitly enabled in config, overriding detect.
Option "Enable" "True" will force the server to enable an output at startup
time, even if the output is not connected. This also causes the default
modes to be added for this output, allowing even sync ranges to be used to
pick out standard modes.
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.c | 45 |
1 files changed, 35 insertions, 10 deletions
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 6366222c4..b293639a9 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -427,15 +427,29 @@ xf86OutputSetMonitor (xf86OutputPtr output) } static Bool -xf86OutputEnabled (xf86OutputPtr output) +xf86OutputEnabled (xf86OutputPtr output) { - /* Check to see if this output was disabled in the config file */ - if (xf86ReturnOptValBool (output->options, OPTION_ENABLE, TRUE) == FALSE || - xf86ReturnOptValBool (output->options, OPTION_DISABLE, FALSE) == TRUE) + Bool enable, disable; + + /* check to see if this output was enabled in the config file */ + if (xf86GetOptValBool (output->options, OPTION_ENABLE, &enable) && enable) + { + xf86DrvMsg (output->scrn->scrnIndex, X_INFO, + "Output %s enabled by config file\n", output->name); + return TRUE; + } + /* or if this output was disabled in the config file */ + if (xf86GetOptValBool (output->options, OPTION_DISABLE, &disable) && disable) { + xf86DrvMsg (output->scrn->scrnIndex, X_INFO, + "Output %s disabled by config file\n", output->name); return FALSE; } - return TRUE; + /* otherwise, enable if it is not disconnected */ + enable = output->status != XF86OutputStatusDisconnected; + xf86DrvMsg (output->scrn->scrnIndex, X_INFO, + "Output %s %sconnected\n", output->name, enable ? "" : "dis"); + return enable; } static Bool @@ -1225,7 +1239,7 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY) */ output->status = (*output->funcs->detect)(output); - if (output->status == XF86OutputStatusDisconnected) + if (!xf86OutputEnabled (output)) { xf86OutputSetEDID (output, NULL); continue; @@ -1527,8 +1541,7 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) xf86OutputPtr output = config->output[o]; modes[o] = NULL; - enabled[o] = (xf86OutputEnabled (output) && - output->status != XF86OutputStatusDisconnected); + enabled[o] = xf86OutputEnabled (output); } /* @@ -1573,8 +1586,20 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow) { xf86OutputPtr output = config->output[o]; - if (enabled[o] && !modes[o]) - modes[o] = xf86ClosestMode (output, target_mode, target_rotation, width, height); + if (enabled[o]) + { + if (!modes[o]) + modes[o] = xf86ClosestMode (output, target_mode, + target_rotation, width, height); + if (!modes[o]) + xf86DrvMsg (scrn->scrnIndex, X_ERROR, + "Output %s enabled but has no modes\n", + output->name); + else + xf86DrvMsg (scrn->scrnIndex, X_INFO, + "Output %s using initial mode %s\n", + output->name, modes[o]->name); + } } /* |