RANDR 1.2: Inherit PreferredMode from the global configuration, if any.

If you don't do this, then Modes "800x600" in the Display subsection will
be dutifully ignored and the driver will start at whatever resolution it
feels like.
This commit is contained in:
Adam Jackson 2008-03-03 15:49:48 -05:00
parent 28c156e2ba
commit 5d2946655b

View file

@ -1261,6 +1261,23 @@ xf86SortModes (DisplayModePtr input)
return output;
}
static char *
preferredMode(ScrnInfoPtr pScrn, xf86OutputPtr output)
{
char *preferred_mode = NULL;
/* Check for a configured preference for a particular mode */
preferred_mode = xf86GetOptValString (output->options,
OPTION_PREFERRED_MODE);
if (preferred_mode)
return preferred_mode;
if (pScrn->display->modes && *pScrn->display->modes)
preferred_mode = *pScrn->display->modes;
return preferred_mode;
}
_X_EXPORT void
xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
{
@ -1445,8 +1462,7 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
output->probed_modes = xf86SortModes (output->probed_modes);
/* Check for a configured preference for a particular mode */
preferred_mode = xf86GetOptValString (output->options,
OPTION_PREFERRED_MODE);
preferred_mode = preferredMode(scrn, output);
if (preferred_mode)
{