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.
This commit is contained in:
Keith Packard 2007-05-17 20:22:43 -07:00
parent 0375009a97
commit 915563eba5

View File

@ -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];