Commit 708f0775 authored by Adam Jackson's avatar Adam Jackson 🥃

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.
parent 605e6764
......@@ -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)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment