xserver: Branch 'randr-1.2-for-server-1.2' - 2 commits

Keith Packard keithp at kemper.freedesktop.org
Wed Dec 13 11:22:40 EET 2006


 randr/rrcrtc.c   |   12 ++++++++++--
 randr/rrscreen.c |   25 +++++++++++++++++++------
 2 files changed, 29 insertions(+), 8 deletions(-)

New commits:
diff-tree 91396f14307537557ecd6eacf778fa091dd410c6 (from parents)
Merge: 612a8e61803da8db0e305cbb093696b8e4284572 6dc711833d7387372012fdff1ce1df3aefa2d234
Author: Keith Packard <keithp at neko.keithp.com>
Date:   Wed Dec 13 01:21:53 2006 -0800

    Merge branch 'randr-1.2-for-server-1.2-origin' into randr-1.2-for-server-1.2

diff-tree 612a8e61803da8db0e305cbb093696b8e4284572 (from 66b6358a393972946f16394918db2401c51dc5ed)
Author: Keith Packard <keithp at neko.keithp.com>
Date:   Wed Dec 13 01:21:32 2006 -0800

    RandR 1.2 rotation code must adjust width/height.
    
    Mode lines reflect the monitor mode, not the projected size into the frame
    buffer. Flip width/height around so that the dimensions are oriented
    correctly.

diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index e8a7b79..7409e96 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -698,7 +698,15 @@ ProcRRSetCrtcConfig (ClientPtr client)
 	 */
 	if (pScrPriv->rrScreenSetSize)
 	{
-	    if (stuff->x + mode->mode.width > pScreen->width)
+	    int source_width = mode->mode.width;
+	    int	source_height = mode->mode.height;
+
+	    if (rotation == RR_Rotate_90 || rotation == RR_Rotate_270)
+	    {
+		source_width = mode->mode.height;
+		source_height = mode->mode.width;
+	    }
+	    if (stuff->x + source_width > pScreen->width)
 	    {
 		client->errorValue = stuff->x;
 		if (outputs)
@@ -706,7 +714,7 @@ ProcRRSetCrtcConfig (ClientPtr client)
 		return BadValue;
 	    }
 	    
-	    if (stuff->y + mode->mode.height > pScreen->height)
+	    if (stuff->y + source_height > pScreen->height)
 	    {
 		client->errorValue = stuff->y;
 		if (outputs)
diff --git a/randr/rrscreen.c b/randr/rrscreen.c
index 76c16b0..38dbaed 100644
--- a/randr/rrscreen.c
+++ b/randr/rrscreen.c
@@ -268,7 +268,6 @@ ProcRRSetScreenSize (ClientPtr client)
     WindowPtr		pWin;
     ScreenPtr		pScreen;
     rrScrPrivPtr	pScrPriv;
-    RRCrtcPtr		crtc;
     int			i;
     
     REQUEST_SIZE_MATCH(xRRSetScreenSizeReq);
@@ -291,12 +290,26 @@ ProcRRSetScreenSize (ClientPtr client)
 	client->errorValue = stuff->height;
 	return BadValue;
     }
-    for (i = 0; i < pScrPriv->numCrtcs; i++) {
-	crtc = pScrPriv->crtcs[i];
-	if (crtc->mode &&
-	    (crtc->x + crtc->mode->mode.width > stuff->width ||
-	     crtc->y + crtc->mode->mode.height > stuff->height))
+    for (i = 0; i < pScrPriv->numCrtcs; i++) 
+    {
+	RRCrtcPtr   crtc = pScrPriv->crtcs[i];
+	RRModePtr   mode = crtc->mode;
+	if (mode)
+	{
+	    int		source_width = mode->mode.width;
+	    int		source_height = mode->mode.height;
+	    Rotation	rotation = crtc->rotation;
+
+	    if (rotation == RR_Rotate_90 || rotation == RR_Rotate_270)
+	    {
+		source_width = mode->mode.height;
+		source_height = mode->mode.width;
+	    }
+	    
+	    if (crtc->x + source_width > stuff->width ||
+		crtc->y + source_height > stuff->height)
 	    return BadMatch;
+	}
     }
     if (stuff->widthInMillimeters == 0 || stuff->heightInMillimeters == 0)
     {



More information about the xorg-commit mailing list