xserver: Branch 'server-1.11-branch'

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Mon Oct 24 10:19:32 PDT 2011


 hw/xfree86/modes/xf86Crtc.c |   25 ++++++++++++++++++++-----
 1 file changed, 20 insertions(+), 5 deletions(-)

New commits:
commit c8c5ed998aac2c91dbec1f86af3395e08ddab373
Author: Jesse Barnes <jbarnes at virtuousgeek.org>
Date:   Thu Oct 13 12:01:10 2011 -0700

    crtc: match full preferred modes if possible when choosing an initial config
    
    It's fairly common to have multiple, identical monitors plugged in.  In
    that case, it's preferable to run the monitor's preferred mode on each
    output, rather than just matching the width & height and end up with
    different timings or refresh rates.
    
    Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 3e145d3d67b472cb5d74cb8078b614160c4722b7)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 3fae039..d75cd77 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -2060,13 +2060,28 @@ xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
 		if (o == p)
 		    continue;
 
-		for (mode = output->probed_modes; mode; mode = mode->next) {
-		    Rotation r = output->initial_rotation;
-		    if (xf86ModeWidth(mode, r) == pref_width &&
-			    xf86ModeHeight(mode, r) == pref_height) {
+		/*
+		 * First see if the preferred mode matches on the next
+		 * output as well.  This catches the common case of identical
+		 * monitors and makes sure they all have the same timings
+		 * and refresh.  If that fails, we fall back to trying to
+		 * match just width & height.
+		 */
+		mode = xf86OutputHasPreferredMode(output, pref_width,
+						  pref_height);
+		if (mode && xf86ModesEqual(mode, preferred[p])) {
 			preferred[o] = mode;
 			match = TRUE;
-		    }
+		} else {
+			for (mode = output->probed_modes; mode;
+			     mode = mode->next) {
+				Rotation r = output->initial_rotation;
+				if (xf86ModeWidth(mode, r) == pref_width &&
+				    xf86ModeHeight(mode, r) == pref_height) {
+					preferred[o] = mode;
+					match = TRUE;
+				}
+			}
 		}
 
 		all_match &= match;


More information about the xorg-commit mailing list