xorg-x11-server/xserver-1.3.0-randr-preferred-mode-fix.patch
Adam Jackson a133a7b192 * Fri Oct 05 2007 Adam Jackson <ajax@redhat.com> 1.3.0.0-29
- xserver-1.3.0-randr-preferred-mode-fix.patch: Fix infinite loop on X
  startup when a mode is requested in the config file. (#318731)
- Fix License tag.
2007-10-05 16:17:44 +00:00

34 lines
983 B
Diff

diff -up xorg-server-1.3.0.0/hw/xfree86/modes/xf86Crtc.c.jx xorg-server-1.3.0.0/hw/xfree86/modes/xf86Crtc.c
--- xorg-server-1.3.0.0/hw/xfree86/modes/xf86Crtc.c.jx 2007-10-03 13:10:28.000000000 -0400
+++ xorg-server-1.3.0.0/hw/xfree86/modes/xf86Crtc.c 2007-10-05 09:58:11.000000000 -0400
@@ -1420,6 +1420,9 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn,
{
if (!strcmp (preferred_mode, mode->name))
{
+ DisplayModePtr m;
+
+ /* Sort it to the front of the list */
if (mode != output->probed_modes)
{
if (mode->prev)
@@ -1431,10 +1434,17 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn,
mode->prev = NULL;
output->probed_modes = mode;
}
+
+ /* Mark it preferred */
mode->type |= M_T_PREFERRED;
+
+ /* And unprefer everything else */
+ for (m = output->probed_modes; m; m = m->next)
+ if (m != mode)
+ m->type &= ~M_T_PREFERRED;
+
+ break;
}
- else
- mode->type &= ~M_T_PREFERRED;
}
}