From 915563eba530c5e2fdc2456cf1c7c3cc09b3add0 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 17 May 2007 20:22:43 -0700 Subject: [PATCH] Disable all outputs and crtcs at startup. Leaving devices enabled during server startup can cause problems during the initial mode setting in the server, especially when they are used for different purposes by the X server than by the BIOS. Disabling all of them before any mode setting is attempted provides a stable base upon which the remaining mode setting operations can be built. --- hw/xfree86/modes/xf86Crtc.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 00ec56c00..88c31af58 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -1723,8 +1723,26 @@ Bool xf86SetDesiredModes (ScrnInfoPtr scrn) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn); - int c; + int c, o; + /* + * Turn off everything so mode setting is done + * with hardware in a consistent state + */ + for (o = 0; o < config->num_output; o++) + { + xf86OutputPtr output = config->output[o]; + (*output->funcs->dpms)(output, DPMSModeOff); + } + + for (c = 0; c < config->num_crtc; c++) + { + xf86CrtcPtr crtc = config->crtc[c]; + + crtc->funcs->dpms(crtc, DPMSModeOff); + memset(&crtc->mode, 0, sizeof(crtc->mode)); + } + for (c = 0; c < config->num_crtc; c++) { xf86CrtcPtr crtc = config->crtc[c];