Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > e265b08b6bebf8514a189c80db57a2d3 > files > 28

x11-server-1.3.0.0-25.1mdv2008.0.src.rpm

From 1ab3e2fb4b95eecd28e7e1399d4686071349ed6b Mon Sep 17 00:00:00 2001
From: Alan Hourihane <alanh@fairlite.demon.co.uk>
Date: Wed, 30 May 2007 13:06:45 +0100
Subject: [PATCH] Fix mode validation against the maximum X/Y values configured
at server startup, and not against the virtual X/Y parameters
as they can change.

This fixes an issue when canGrow is TRUE and modes get dropped
when using the virtual X/Y parameters.
---
 hw/xfree86/modes/xf86Crtc.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 391bfcc..b3c6426 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1210,8 +1210,15 @@ xf86ProbeOutputModes (ScrnInfoPtr scrn, int maxX, int maxY)
     xf86CrtcConfigPtr	config = XF86_CRTC_CONFIG_PTR(scrn);
     int			o;
 
-    if (maxX == 0 || maxY == 0)
-	xf86RandR12GetOriginalVirtualSize (scrn, &maxX, &maxY);
+    /* When canGrow was TRUE in the initial configuration we have to
+     * compare against the maximum values so that we don't drop modes.
+     * When canGrow was FALSE, the maximum values would have been clamped
+     * anyway.
+     */
+    if (maxX == 0 || maxY == 0) {
+	maxX = config->maxWidth;
+	maxY = config->maxHeight;
+    }
 
     /* Elide duplicate modes before defaulting code uses them */
     xf86PruneDuplicateMonitorModes (scrn->monitor);
-- 
1.5.2.4