rpms/xorg-x11-server/devel xserver-1.6.99-right-of.patch, NONE, 1.1 xorg-x11-server.spec, 1.455, 1.456

Adam Jackson ajax at fedoraproject.org
Tue Jul 28 18:41:30 UTC 2009


Author: ajax

Update of /cvs/pkgs/rpms/xorg-x11-server/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv31397

Modified Files:
	xorg-x11-server.spec 
Added Files:
	xserver-1.6.99-right-of.patch 
Log Message:
* Tue Jul 28 2009 Adam Jackson <ajax at redhat.com> 1.6.99-21.20090724
- xserver-1.6.99-right-of.patch: Default to right-of initial placement
  for RANDR 1.2 drivers with enough virtual space.


xserver-1.6.99-right-of.patch:
 xf86Crtc.c |   72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 file changed, 64 insertions(+), 8 deletions(-)

--- NEW FILE xserver-1.6.99-right-of.patch ---
>From 9d16f202248b0ca29b832d28441871b96d0b040d Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax at redhat.com>
Date: Tue, 28 Jul 2009 11:07:13 -0400
Subject: [PATCH] RANDR: right-of placement by default

---
 hw/xfree86/modes/xf86Crtc.c |   71 ++++++++++++++++++++++++++++++++++++++----
 1 files changed, 64 insertions(+), 7 deletions(-)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 94fc158..4f14a75 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1140,6 +1140,15 @@ xf86InitialOutputPositions (ScrnInfoPtr scrn, DisplayModePtr *modes)
     int			o;
     int			min_x, min_y;
     
+    /* check for initial right-of heuristic */
+    for (o = 0; o < config->num_output; o++)
+    {
+	xf86OutputPtr	output = config->output[o];
+
+	if (output->initial_x || output->initial_y)
+            return TRUE;
+    }
+    
     for (o = 0; o < config->num_output; o++)
     {
 	xf86OutputPtr	output = config->output[o];
@@ -2025,6 +2034,54 @@ bestModeForAspect(xf86CrtcConfigPtr config, Bool *enabled, float aspect)
     return match;
 }
 
+static int
+numEnabledOutputs(xf86CrtcConfigPtr config, Bool *enabled)
+{
+    int i = 0, p;
+
+    for (i = 0, p = -1; nextEnabledOutput(config, enabled, &p); i++) ;
+
+    return i;
+}
+
+static Bool
+xf86TargetRightOf(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
+		  DisplayModePtr *modes, Bool *enabled,
+		  int width, int height)
+{
+    int o;
+    int w = 0;
+
+    if (numEnabledOutputs(config, enabled) < 2)
+	return FALSE;
+    
+    for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
+	DisplayModePtr mode =
+	    xf86OutputHasPreferredMode(config->output[o], width, height);
+
+	if (!mode)
+	    return FALSE;
+
+	w += mode->HDisplay;
+    }
+
+    if (w > width)
+	return FALSE;
+
+    w = 0;
+    for (o = -1; nextEnabledOutput(config, enabled, &o); ) {
+	DisplayModePtr mode =
+	    xf86OutputHasPreferredMode(config->output[o], width, height);
+
+	config->output[o]->initial_x = w;
+	w += mode->HDisplay;
+
+	modes[o] = mode;
+    }
+
+    return TRUE;
+}
+
 static Bool
 xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
 		    DisplayModePtr *modes, Bool *enabled,
@@ -2082,13 +2139,9 @@ xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
      * biggest mode for its aspect ratio, assuming one exists.
      */
     if (!ret) do {
-	int i = 0;
 	float aspect = 0.0;
 
-	/* count the number of enabled outputs */
-	for (i = 0, p = -1; nextEnabledOutput(config, enabled, &p); i++) ;
-
-	if (i != 1)
+	if (numEnabledOutputs(config, enabled) != 1)
 	    break;
 
 	p = -1;
@@ -2375,6 +2428,8 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
 
     if (xf86TargetUserpref(scrn, config, modes, enabled, width, height))
 	xf86DrvMsg(i, X_INFO, "Using user preference for initial modes\n");
+    else if (xf86TargetRightOf(scrn, config, modes, enabled, width, height))
+	xf86DrvMsg(i, X_INFO, "Using spanning desktop for initial modes\n");
     else if (xf86TargetPreferred(scrn, config, modes, enabled, width, height))
 	xf86DrvMsg(i, X_INFO, "Using exact sizes for initial modes\n");
     else if (xf86TargetAspect(scrn, config, modes, enabled, width, height))
@@ -2391,8 +2446,10 @@ xf86InitialConfiguration (ScrnInfoPtr scrn, Bool canGrow)
 			config->output[o]->name);
 	else
 	    xf86DrvMsg (scrn->scrnIndex, X_INFO,
-			"Output %s using initial mode %s\n",
-			config->output[o]->name, modes[o]->name);
+			"Output %s using initial mode %s +%d+%d\n",
+			config->output[o]->name, modes[o]->name,
+                        config->output[o]->initial_x,
+                        config->output[o]->initial_y);
     }
 
     /*
-- 
1.6.3.3



Index: xorg-x11-server.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-server/devel/xorg-x11-server.spec,v
retrieving revision 1.455
retrieving revision 1.456
diff -u -p -r1.455 -r1.456
--- xorg-x11-server.spec	28 Jul 2009 14:33:20 -0000	1.455
+++ xorg-x11-server.spec	28 Jul 2009 18:41:28 -0000	1.456
@@ -19,7 +19,7 @@
 Summary:   X.Org X11 X server
 Name:      xorg-x11-server
 Version:   1.6.99
-Release:   20.%{gitdate}%{?dist}
+Release:   21.%{gitdate}%{?dist}
 URL:       http://www.x.org
 License:   MIT
 Group:     User Interface/X
@@ -76,8 +76,8 @@ Patch6023: xserver-1.6.99-use-pci-access
 # ajax needs to upstream this
 Patch6027: xserver-1.6.0-displayfd.patch
 Patch6028: xserver-1.6.99-randr-error-debugging.patch
-
-Patch6042: xserver-1.6.1-proc-cmdline.patch
+Patch6029: xserver-1.6.1-proc-cmdline.patch
+Patch6030: xserver-1.6.99-right-of.patch
 
 %define moduledir	%{_libdir}/xorg/modules
 %define drimoduledir	%{_libdir}/dri
@@ -525,6 +525,10 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Tue Jul 28 2009 Adam Jackson <ajax at redhat.com> 1.6.99-21.20090724
+- xserver-1.6.99-right-of.patch: Default to right-of initial placement
+  for RANDR 1.2 drivers with enough virtual space.
+
 * Tue Jul 28 2009 Adam Jackson <ajax at redhat.com> 1.6.99-20.20090724
 - xserver-1.6.99-use-pci-access-boot.patch: Some chips (thanks Intel) will
   change their PCI class at runtime if you disable their VGA decode, so




More information about the fedora-extras-commits mailing list