rpms/xorg-x11-server/F-10 xserver-1.5.3-aspect-me-harder.patch, NONE, 1.1 xorg-x11-server.spec, 1.386, 1.387 xserver-1.5.0-bad-fbdev-thats-mine.patch, 1.1, 1.2 xserver-1.5.0-hide-cursor.patch, 1.1, 1.2

Adam Jackson ajax at fedoraproject.org
Mon Dec 22 18:40:40 UTC 2008


Author: ajax

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

Modified Files:
	xorg-x11-server.spec xserver-1.5.0-bad-fbdev-thats-mine.patch 
	xserver-1.5.0-hide-cursor.patch 
Added Files:
	xserver-1.5.3-aspect-me-harder.patch 
Log Message:
* Mon Dec 22 2008 Adam Jackson <ajax at redhat.com> 1.5.3-8
- xserver-1.5.3-aspect-me-harder.patch: Fix mode selection when only one
  monitor is present and it doesn't claim a preferred mode.
- xserver-1.5.0-bad-fbdev-thats-mine.patch: Do the same for sbus that we do
  for pci.
- xserver-1.5.0-hide-cursor.patch: Backport fixes to unhide logic from
  master.


xserver-1.5.3-aspect-me-harder.patch:

--- NEW FILE xserver-1.5.3-aspect-me-harder.patch ---
>From 64a83ee98d0cde089857d92bdbc080f95a623543 Mon Sep 17 00:00:00 2001
From: Adam Jackson <ajax at redhat.com>
Date: Mon, 22 Dec 2008 12:17:32 -0500
Subject: [PATCH] randr: try harder to do aspect match if there's only one head

---
 hw/xfree86/modes/xf86Crtc.c |  148 +++++++++++++++++++++++++-----------------
 1 files changed, 88 insertions(+), 60 deletions(-)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index a6afd91..4d38955 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1818,6 +1818,66 @@ nextEnabledOutput(xf86CrtcConfigPtr config, Bool *enabled, int *index)
 }
 
 static Bool
+aspectMatch(float a, float b)
+{
+    return fabs(1 - (a / b)) < 0.05;
+}
+
+static DisplayModePtr
+nextAspectMode(xf86OutputPtr o, DisplayModePtr last, float aspect)
+{
+    DisplayModePtr m = NULL;
+
+    if (!o)
+	return NULL;
+
+    if (!last)
+	m = o->probed_modes;
+    else
+	m = last->next;
+
+    for (; m; m = m->next)
+	if (aspectMatch(aspect, (float)m->HDisplay / (float)m->VDisplay))
+	    return m;
+
+    return NULL;
+}
+
+static DisplayModePtr
+bestModeForAspect(xf86CrtcConfigPtr config, Bool *enabled, float aspect)
+{
+    int o = -1, p;
+    DisplayModePtr mode = NULL, test = NULL, match = NULL;
+
+    if (!nextEnabledOutput(config, enabled, &o))
+	return NULL;
+    while ((mode = nextAspectMode(config->output[o], mode, aspect))) {
+	test = mode;
+	for (p = o; nextEnabledOutput(config, enabled, &p); ) {
+	    test = xf86OutputFindClosestMode(config->output[p], mode);
+	    if (!test)
+		break;
+	    if (test->HDisplay != mode->HDisplay ||
+		    test->VDisplay != mode->VDisplay) {
+		test = NULL;
+		break;
+	    }
+	}
+
+	/* if we didn't match it on all outputs, try the next one */
+	if (!test)
+	    continue;
+
+	/* if it's bigger than the last one, save it */
+	if (!match || (test->HDisplay > match->HDisplay))
+	    match = test;
+    }
+
+    /* return the biggest one found */
+    return match;
+}
+
+static Bool
 xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
 		    DisplayModePtr *modes, Bool *enabled,
 		    int width, int height)
@@ -1869,75 +1929,43 @@ xf86TargetPreferred(ScrnInfoPtr scrn, xf86CrtcConfigPtr config,
 	}
     }
 
-    if (ret) {
-	/* oh good, there is a match.  stash the selected modes and return. */
-	memcpy(modes, preferred_match,
-		config->num_output * sizeof(DisplayModePtr));
-    }
-
-    xfree(preferred);
-    xfree(preferred_match);
-    return ret;
-}
+    /*
+     * If there's no preferred mode, but only one monitor, pick the
+     * biggest mode for its aspect ratio, assuming one exists.
+     */
+    if (!ret) do {
+	int i = 0;
+	float aspect = 0.0;
 
-static Bool
-aspectMatch(float a, float b)
-{
-    return fabs(1 - (a / b)) < 0.05;
-}
+	/* count the number of enabled outputs */
+	for (i = 0, p = -1; nextEnabledOutput(config, enabled, &p); i++) ;
 
-static DisplayModePtr
-nextAspectMode(xf86OutputPtr o, DisplayModePtr last, float aspect)
-{
-    DisplayModePtr m = NULL;
+	if (i != 1)
+	    break;
 
-    if (!o)
-	return NULL;
+	p = -1;
+	nextEnabledOutput(config, enabled, &p);
+	if (config->output[p]->mm_height)
+	    aspect = (float)config->output[p]->mm_width /
+		     (float)config->output[p]->mm_height;
 
-    if (!last)
-	m = o->probed_modes;
-    else
-	m = last->next;
+	if (aspect)
+	    preferred_match[0] = bestModeForAspect(config, enabled, aspect);
 
-    for (; m; m = m->next)
-	if (aspectMatch(aspect, (float)m->HDisplay / (float)m->VDisplay))
-	    return m;
+	if (preferred_match[0])
+	    ret = TRUE;
 
-    return NULL;
-}
+    } while (0);
 
-static DisplayModePtr
-bestModeForAspect(xf86CrtcConfigPtr config, Bool *enabled, float aspect)
-{
-    int o = -1, p;
-    DisplayModePtr mode = NULL, test = NULL, match = NULL;
-
-    if (!nextEnabledOutput(config, enabled, &o))
-	return NULL;
-    while ((mode = nextAspectMode(config->output[o], mode, aspect))) {
-	test = mode;
-	for (p = o; nextEnabledOutput(config, enabled, &p); ) {
-	    test = xf86OutputFindClosestMode(config->output[p], mode);
-	    if (!test)
-		break;
-	    if (test->HDisplay != mode->HDisplay ||
-		    test->VDisplay != mode->VDisplay) {
-		test = NULL;
-		break;
-	    }
-	}
-
-	/* if we didn't match it on all outputs, try the next one */
-	if (!test)
-	    continue;
-
-	/* if it's bigger than the last one, save it */
-	if (!match || (test->HDisplay > match->HDisplay))
-	    match = test;
+    if (ret) {
+	/* oh good, there is a match.  stash the selected modes and return. */
+	memcpy(modes, preferred_match,
+		config->num_output * sizeof(DisplayModePtr));
     }
 
-    /* return the biggest one found */
-    return match;
+    xfree(preferred);
+    xfree(preferred_match);
+    return ret;
 }
 
 static Bool
-- 
1.6.0.6



Index: xorg-x11-server.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-server/F-10/xorg-x11-server.spec,v
retrieving revision 1.386
retrieving revision 1.387
diff -u -r1.386 -r1.387
--- xorg-x11-server.spec	13 Dec 2008 16:47:11 -0000	1.386
+++ xorg-x11-server.spec	22 Dec 2008 18:40:09 -0000	1.387
@@ -19,7 +19,7 @@
 Summary:   X.Org X11 X server
 Name:      xorg-x11-server
 Version:   1.5.3
-Release:   7%{?dist}
+Release:   8%{?dist}
 URL:       http://www.x.org
 License:   MIT
 Group:     User Interface/X
@@ -95,6 +95,8 @@
 # http://cgit.freedesktop.org/xorg/xserver/commit/?id=24e863b0eb6ff11010a14cfd252a39df87a09d0e
 Patch6006: xserver-1.5.2-sbusAutoDetection.patch
 
+Patch6007: xserver-1.5.3-aspect-me-harder.patch
+
 %define moduledir	%{_libdir}/xorg/modules
 %define drimoduledir	%{_libdir}/dri
 %define sdkdir		%{_includedir}/xorg
@@ -298,6 +300,7 @@
 sed -i 's/git/&+ssh/' .git/config
 %else
 git-init-db
+git config --add apply.whitespace nowarn
 if [ -z "$GIT_COMMITTER_NAME" ]; then
     git-config user.email "x at fedoraproject.org"
     git-config user.name "Fedora X Ninjas"
@@ -525,6 +528,14 @@
 
 
 %changelog
+* Mon Dec 22 2008 Adam Jackson <ajax at redhat.com> 1.5.3-8
+- xserver-1.5.3-aspect-me-harder.patch: Fix mode selection when only one
+  monitor is present and it doesn't claim a preferred mode.
+- xserver-1.5.0-bad-fbdev-thats-mine.patch: Do the same for sbus that we do
+  for pci.
+- xserver-1.5.0-hide-cursor.patch: Backport fixes to unhide logic from
+  master.
+
 * Sat Dec 13 2008 Tom "spot" Callaway <tcallawa at redhat.com> 1.5.3-7
 - sbusAutoDetection from upstream
   http://cgit.freedesktop.org/xorg/xserver/commit/?id=24e863b0eb6ff11010a14cfd252a39df87a09d0e

xserver-1.5.0-bad-fbdev-thats-mine.patch:

Index: xserver-1.5.0-bad-fbdev-thats-mine.patch
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-server/F-10/xserver-1.5.0-bad-fbdev-thats-mine.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- xserver-1.5.0-bad-fbdev-thats-mine.patch	13 Mar 2008 06:37:36 -0000	1.1
+++ xserver-1.5.0-bad-fbdev-thats-mine.patch	22 Dec 2008 18:40:09 -0000	1.2
@@ -1,4 +1,4 @@
-From 656ca314bb97341a07d4bbd7fcfe7af9a3689761 Mon Sep 17 00:00:00 2001
+From cb1ac4a749a208eb8f9995042a110134977146d2 Mon Sep 17 00:00:00 2001
 From: Dave Airlie <airlied at panoply-rh.(none)>
 Date: Thu, 13 Mar 2008 16:16:46 +1000
 Subject: [PATCH] fbdev: make entity fail if PCI claimed already.
@@ -6,8 +6,8 @@
 bad kitty fbdev.
 ---
  hw/xfree86/common/xf86Bus.c   |    3 +++
- hw/xfree86/common/xf86fbBus.c |    3 +++
- 2 files changed, 6 insertions(+), 0 deletions(-)
+ hw/xfree86/common/xf86fbBus.c |    7 +++++++
+ 2 files changed, 10 insertions(+), 0 deletions(-)
 
 diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
 index f7ffac8..9f4e0ca 100644
@@ -24,19 +24,23 @@
  	return NULL;
      
 diff --git a/hw/xfree86/common/xf86fbBus.c b/hw/xfree86/common/xf86fbBus.c
-index 102f6b1..48e101b 100644
+index 102f6b1..cfd8811 100644
 --- a/hw/xfree86/common/xf86fbBus.c
 +++ b/hw/xfree86/common/xf86fbBus.c
-@@ -58,6 +58,9 @@ xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active)
+@@ -58,6 +58,13 @@ xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active)
  {
      EntityPtr p;
      int num;
 +
 +    if (pciSlotClaimed)
 +	return -1;
++#if defined(__sparc__) || defined (__sparc64__)
++    if (sbusSlotClaimed)
++	return -1;
++#endif
      
      num = xf86AllocateEntity();
      p = xf86Entities[num];
 -- 
-1.5.4.3
+1.6.0.6
 

xserver-1.5.0-hide-cursor.patch:

Index: xserver-1.5.0-hide-cursor.patch
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-server/F-10/xserver-1.5.0-hide-cursor.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- xserver-1.5.0-hide-cursor.patch	22 Aug 2008 20:08:52 -0000	1.1
+++ xserver-1.5.0-hide-cursor.patch	22 Dec 2008 18:40:09 -0000	1.2
@@ -1,17 +1,17 @@
-From e99347a3e82e6db47dd482169b6799968afc3893 Mon Sep 17 00:00:00 2001
+From 82b1de694b9c26099c8c0065f455e7cb217c8561 Mon Sep 17 00:00:00 2001
 From: Adam Jackson <ajax at redhat.com>
 Date: Wed, 20 Aug 2008 10:11:07 -0400
 Subject: [PATCH] Hide the cursor until the first XDefineCursor() call.
 
 ---
- xfixes/cursor.c |   28 ++++++++++++++++++++++++++--
- 1 files changed, 26 insertions(+), 2 deletions(-)
+ xfixes/cursor.c |   14 ++++++++++++--
+ 1 files changed, 12 insertions(+), 2 deletions(-)
 
 diff --git a/xfixes/cursor.c b/xfixes/cursor.c
-index d51251f..c8c4c9f 100755
+index d51251f..26a5d61 100755
 --- a/xfixes/cursor.c
 +++ b/xfixes/cursor.c
-@@ -70,7 +70,7 @@
+@@ -70,7 +70,7 @@ static void deleteCursorHideCountsForScreen (ScreenPtr pScreen);
  	return BadCursor; \
      } \
  }
@@ -20,15 +20,7 @@
  /*
   * There is a global list of windows selecting for cursor events
   */
-@@ -109,6 +109,7 @@
- 
- typedef struct _CursorScreen {
-     DisplayCursorProcPtr	DisplayCursor;
-+    ChangeWindowAttributesProcPtr ChangeWindowAttributes;
-     CloseScreenProcPtr		CloseScreen;
-     CursorHideCountPtr          pCursorHideCounts;
- } CursorScreenRec, *CursorScreenPtr;
-@@ -119,6 +120,9 @@
+@@ -119,6 +119,9 @@ typedef struct _CursorScreen {
  #define Wrap(as,s,elt,func)	(((as)->elt = (s)->elt), (s)->elt = func)
  #define Unwrap(as,s,elt)	((s)->elt = (as)->elt)
  
@@ -38,57 +30,22 @@
  static Bool
  CursorDisplayCursor (ScreenPtr pScreen,
  		     CursorPtr pCursor)
-@@ -128,7 +132,7 @@
+@@ -128,7 +131,14 @@ CursorDisplayCursor (ScreenPtr pScreen,
  
      Unwrap (cs, pScreen, DisplayCursor);
  
 -    if (cs->pCursorHideCounts != NULL) {
++    /*
++     * Have to check ConnectionInfo to distinguish client requests from
++     * initial root window setup.  Not a great way to do it, I admit.
++     */
++    if (ConnectionInfo)
++	CursorVisible = TRUE;
++
 +    if (cs->pCursorHideCounts != NULL || !CursorVisible) {
  	ret = (*pScreen->DisplayCursor) (pScreen, pInvisibleCursor);
      } else {
  	ret = (*pScreen->DisplayCursor) (pScreen, pCursor);
-@@ -161,6 +165,24 @@
- }
- 
- static Bool
-+CursorChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
-+{
-+    ScreenPtr           pScreen = pWin->drawable.pScreen;
-+    CursorScreenPtr	cs = GetCursorScreen(pScreen);
-+    Bool		ret;
-+    extern char *ConnectionInfo;
-+
-+    if ((mask & CWCursor) && ConnectionInfo)
-+	CursorVisible = TRUE;
-+
-+    Unwrap(cs, pScreen, ChangeWindowAttributes);
-+    ret = pScreen->ChangeWindowAttributes(pWin, mask);
-+    Wrap(cs, pScreen, ChangeWindowAttributes, CursorChangeWindowAttributes);
-+
-+    return ret;
-+}
-+
-+static Bool
- CursorCloseScreen (int index, ScreenPtr pScreen)
- {
-     CursorScreenPtr	cs = GetCursorScreen (pScreen);
-@@ -168,6 +190,7 @@
- 
-     Unwrap (cs, pScreen, CloseScreen);
-     Unwrap (cs, pScreen, DisplayCursor);
-+    Unwrap (cs, pScreen, ChangeWindowAttributes);
-     deleteCursorHideCountsForScreen(pScreen);
-     ret = (*pScreen->CloseScreen) (index, pScreen);
-     xfree (cs);
-@@ -1042,6 +1065,8 @@
- 	    return FALSE;
- 	Wrap (cs, pScreen, CloseScreen, CursorCloseScreen);
- 	Wrap (cs, pScreen, DisplayCursor, CursorDisplayCursor);
-+	Wrap (cs, pScreen, ChangeWindowAttributes,
-+	      CursorChangeWindowAttributes);
- 	cs->pCursorHideCounts = NULL;
- 	SetCursorScreen (pScreen, cs);
-     }
 -- 
-1.5.6.4
+1.6.0.6
 




More information about the fedora-extras-commits mailing list