[PATCH] modes: Force output modes for manually enabled heads
Chris Wilson
chris at chris-wilson.co.uk
Thu Oct 8 09:43:16 PDT 2009
In a headless configuration, in order to convince the XServer to start
the user must explicitly enable an output. Except that doing so does
not initialise any output modes, and so the server still gives up in
disgust. Instead by rearranging the user override, we can continue to
setup the default modes for explicitly enabled outputs (and skip the
probing for explicitly disabled outputs).
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Keith Packard <keithp at keithp.com>
Cc: Dave Airlie <airlied at redhat.com>
---
hw/xfree86/modes/xf86Crtc.c | 38 ++++++++++++++++++++------------------
1 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 506fbb9..f9b73a9 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -524,22 +524,7 @@ xf86OutputSetMonitor (xf86OutputPtr output)
static Bool
xf86OutputEnabled (xf86OutputPtr output, Bool strict)
{
- 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;
- }
+ Bool enable;
/* If not, try to only light up the ones we know are connected */
if (strict) {
@@ -1555,6 +1540,7 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
int min_clock = 0;
int max_clock = 0;
double clock;
+ Bool user_enable;
Bool add_default_modes = TRUE;
enum { sync_config, sync_edid, sync_default } sync_source = sync_default;
@@ -1564,8 +1550,24 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
/*
* Check connection status
*/
- output->status = (*output->funcs->detect)(output);
-
+ if (xf86GetOptValBool (output->options, OPTION_ENABLE, &user_enable) && user_enable)
+ {
+ /* Was this output enabled in the config file? */
+ xf86DrvMsg (output->scrn->scrnIndex, X_INFO,
+ "Output %s enabled by config file\n", output->name);
+ output->status = XF86OutputStatusConnected;
+ }
+ else if (xf86GetOptValBool (output->options, OPTION_DISABLE, &user_enable) && user_enable)
+ {
+ /* Or was it explicitly disabled? */
+ xf86DrvMsg (output->scrn->scrnIndex, X_INFO,
+ "Output %s disabled by config file\n", output->name);
+ output->status = XF86OutputStatusDisconnected;
+ }
+ else
+ {
+ output->status = (*output->funcs->detect)(output);
+ }
if (output->status == XF86OutputStatusDisconnected)
{
xf86OutputSetEDID (output, NULL);
--
1.6.4.3
More information about the xorg-devel
mailing list