Blob Blame Raw
--- xorg-server-1.3.0.0/hw/xfree86/modes/xf86Crtc.c.jx	2007-04-16 12:53:50.000000000 -0400
+++ xorg-server-1.3.0.0/hw/xfree86/modes/xf86Crtc.c	2007-05-02 14:03:28.000000000 -0400
@@ -1202,6 +1202,23 @@
     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;
+}
+
 #define DEBUG_REPROBE 1
 
 void
@@ -1377,8 +1394,7 @@
 	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)
 	{