xserver: Branch 'master' - 2 commits

Maarten Maathuis madman2003 at kemper.freedesktop.org
Fri Dec 19 10:11:54 PST 2008


 hw/xfree86/modes/xf86RandR12.c |    8 ++++----
 randr/rrxinerama.c             |   27 ++++++++++++++++++++-------
 2 files changed, 24 insertions(+), 11 deletions(-)

New commits:
commit aedd2f566df585db7a1614f302cc8d3feda54275
Author: Maarten Maathuis <madman2003 at gmail.com>
Date:   Fri Dec 19 19:10:23 2008 +0100

    randr/xfree86: Fix a one off error in the panning calculations.
    
    - Example: mode 1280x1024, panned area 1281x1024
               panned_area.x2 = 1281
               mode.width = 1280
      If you substract 1280 from 1281, then that leaves you with one.
      Which is the one pixel that you need to move to actually see the last pixel collumn.
      Substracting 1 from this will consistently prevent you from seeing the right and bottom edge.

diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index a378e3a..8c4a1fb 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -210,14 +210,14 @@ xf86RandR13Pan (xf86CrtcPtr crtc, int x, int y)
     }
     /* Validate against [xy]1 after [xy]2, to be sure that results are > 0 for [xy]1 > 0 */
     if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1) {
-	if (newX >= crtc->panningTotalArea.x2 - width)
-	    newX =  crtc->panningTotalArea.x2 - width - 1;
+	if (newX > crtc->panningTotalArea.x2 - width)
+	    newX =  crtc->panningTotalArea.x2 - width;
 	if (newX <  crtc->panningTotalArea.x1)
 	    newX =  crtc->panningTotalArea.x1;
     }
     if (crtc->panningTotalArea.y2 > crtc->panningTotalArea.y1) {
-	if (newY >= crtc->panningTotalArea.y2 - height)
-	    newY =  crtc->panningTotalArea.y2 - height - 1;
+	if (newY > crtc->panningTotalArea.y2 - height)
+	    newY =  crtc->panningTotalArea.y2 - height;
 	if (newY <  crtc->panningTotalArea.y1)
 	    newY =  crtc->panningTotalArea.y1;
     }
commit 332d65ec7a6e94d75efe95d53742f137835274de
Author: Maarten Maathuis <madman2003 at gmail.com>
Date:   Fri Dec 19 18:59:27 2008 +0100

    randr: Consider panned crtc's when calculating xinerama screen sizes.
    
    - This will allow window managers and applications to actually use the panned area.

diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c
index ad40a1e..5af6fb0 100644
--- a/randr/rrxinerama.c
+++ b/randr/rrxinerama.c
@@ -267,12 +267,26 @@ RRXineramaWriteCrtc(ClientPtr client, RRCrtcPtr crtc)
 
     if (RRXineramaCrtcActive (crtc))
     {
-	int width, height;
-	RRCrtcGetScanoutSize (crtc, &width, &height);
-	scratch.x_org  = crtc->x;
-	scratch.y_org  = crtc->y;
-	scratch.width  = width;
-	scratch.height = height;
+	ScreenPtr pScreen = crtc->pScreen;
+	rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen);
+	BoxRec panned_area;
+
+	/* Check to see if crtc is panned and return the full area when applicable. */
+	if (pScrPriv && pScrPriv->rrGetPanning &&
+	    pScrPriv->rrGetPanning (pScreen, crtc, &panned_area, NULL, NULL) &&
+	    (panned_area.x2 > panned_area.x1) && (panned_area.y2 > panned_area.y1)) {
+	    scratch.x_org  = panned_area.x1;
+	    scratch.y_org  = panned_area.y1;
+	    scratch.width  = panned_area.x2  - panned_area.x1;
+	    scratch.height = panned_area.y2  - panned_area.y1;
+	} else {
+	    int width, height;
+	    RRCrtcGetScanoutSize (crtc, &width, &height);
+	    scratch.x_org  = crtc->x;
+	    scratch.y_org  = crtc->y;
+	    scratch.width  = width;
+	    scratch.height = height;
+	}
 	if(client->swapped) {
 	    register int n;
 	    swaps(&scratch.x_org, n);
@@ -313,7 +327,6 @@ ProcRRXineramaQueryScreens(ClientPtr client)
 
     if(rep.number) {
 	rrScrPriv(pScreen);
-	xXineramaScreenInfo scratch;
 	int i;
 	int has_primary = (pScrPriv->primaryOutput != NULL);
 


More information about the xorg-commit mailing list