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

Keith Packard keithp at kemper.freedesktop.org
Thu Feb 1 01:39:17 EET 2007


 GL/mesa/X/xf86glx.c   |    4 +++-
 configure.ac          |    2 +-
 damageext/damageext.c |   40 +++++++++++++++++++++++++++++++++++++++-
 fb/fbpict.h           |    3 ---
 randr/randrstr.h      |    3 +++
 randr/rrcrtc.c        |   26 ++++++++++++++++++++++++++
 randr/rrpointer.c     |   24 ++++++++++++++++--------
 randr/rrproperty.c    |   14 ++++++++++++++
 randr/rrxinerama.c    |    6 ++++--
 9 files changed, 106 insertions(+), 16 deletions(-)

New commits:
diff-tree 8798c8cfa888521cc47173bf6db00b5724da4a54 (from 895250181b21a76cab815b6ee2862d8a0c3a2fbf)
Author: Keith Packard <keithp at neko.keithp.com>
Date:   Tue Jan 30 19:05:20 2007 -0800

    Allow DDX to not supply a property set notification function.
    
    Check rrOutputSetProperty and only call if it isn't NULL.

diff --git a/randr/rrproperty.c b/randr/rrproperty.c
index ed01c88..03a1b5c 100644
--- a/randr/rrproperty.c
+++ b/randr/rrproperty.c
@@ -215,7 +215,7 @@ RRChangeOutputProperty (RROutputPtr outp
 	output->properties = prop;
     }
 
-    if (!prop->is_pending) {
+    if (!prop->is_pending && pScrPriv->rrOutputSetProperty) {
 	/* What should we do in case of failure? */
 	pScrPriv->rrOutputSetProperty(output->pScreen, output,
 				      prop->propertyName, prop_value);
diff-tree 895250181b21a76cab815b6ee2862d8a0c3a2fbf (from f993e142d2b8c7ce27370fb2c18d2eafb6ff40ca)
Author: Keith Packard <keithp at neko.keithp.com>
Date:   Tue Jan 30 18:45:44 2007 -0800

    Use old resource API in backported patch.
    
    1.2 branch doesn't have the resource lookup changes, so we need to use the
    old APIs.

diff --git a/damageext/damageext.c b/damageext/damageext.c
index 36d31e8..d13c67b 100755
--- a/damageext/damageext.c
+++ b/damageext/damageext.c
@@ -281,14 +281,10 @@ ProcDamageAdd (ClientPtr client)
     REQUEST(xDamageAddReq);
     DrawablePtr	    pDrawable;
     RegionPtr	    pRegion;
-    int		    rc;
 
     REQUEST_SIZE_MATCH(xDamageAddReq);
-    VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess);
-    rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
-			   DixReadAccess);
-    if (rc != Success)
-	return rc;
+    VERIFY_REGION(pRegion, stuff->region, client, SecurityWriteAccess);
+    SECURITY_VERIFY_DRAWABLE (pDrawable, stuff->drawable, client, SecurityReadAccess);
 
     /* The region is relative to the drawable origin, so translate it out to
      * screen coordinates like damage expects.
diff-tree f993e142d2b8c7ce27370fb2c18d2eafb6ff40ca (from 72754184f1215acd2b053d476fa46142d97c8ebd)
Author: Keith Packard <keithp at neko.keithp.com>
Date:   Mon Jan 29 23:04:17 2007 -0800

    Make Xinearama screen information reflect CRTC rotation.
    
    (cherry picked from commit b6b855932109b4bc3454f07bef8cb079d79ca369)

diff --git a/randr/randrstr.h b/randr/randrstr.h
index 7a34b39..f86f9b5 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -548,6 +548,9 @@ Bool
 RRCrtcGammaSetSize (RRCrtcPtr	crtc,
 		    int		size);
 
+void
+RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height);
+
 /*
  * Destroy a Crtc at shutdown
  */
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 63898f8..1e04290 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -406,6 +406,32 @@ RRCrtcGammaNotify (RRCrtcPtr	crtc)
     return TRUE;    /* not much going on here */
 }
 
+/**
+ * Returns the width/height that the crtc scans out from the framebuffer
+ */
+void
+RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height)
+{
+    if (crtc->mode == NULL) {
+	*width = 0;
+	*height = 0;
+	return;
+    }
+
+    switch (crtc->rotation & 0xf) {
+    case RR_Rotate_0:
+    case RR_Rotate_180:
+	*width = crtc->mode->mode.width;
+	*height = crtc->mode->mode.height;
+	break;
+    case RR_Rotate_90:
+    case RR_Rotate_270:
+	*width = crtc->mode->mode.height;
+	*height = crtc->mode->mode.width;
+	break;
+    }
+}
+
 /*
  * Set the size of the gamma table at server startup time
  */
diff --git a/randr/rrpointer.c b/randr/rrpointer.c
index 2a5ae7d..802dcb2 100644
--- a/randr/rrpointer.c
+++ b/randr/rrpointer.c
@@ -22,32 +22,6 @@
 
 #include "randrstr.h"
 
-/**
- * Returns the width/height that the crtc scans out from the framebuffer
- */
-static void
-RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height)
-{
-    if (crtc->mode == NULL) {
-	*width = 0;
-	*height = 0;
-	return;
-    }
-
-    switch (crtc->rotation & 0xf) {
-    case RR_Rotate_0:
-    case RR_Rotate_180:
-	*width = crtc->mode->mode.width;
-	*height = crtc->mode->mode.height;
-	break;
-    case RR_Rotate_90:
-    case RR_Rotate_270:
-	*width = crtc->mode->mode.height;
-	*height = crtc->mode->mode.width;
-	break;
-    }
-}
-
 /*
  * When the pointer moves, check to see if the specified position is outside
  * any of theavailable CRTCs and move it to a 'sensible' place if so, where
diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c
index 771ed09..63a34b5 100644
--- a/randr/rrxinerama.c
+++ b/randr/rrxinerama.c
@@ -287,10 +287,12 @@ ProcRRXineramaQueryScreens(ClientPtr cli
 	    RRCrtcPtr	crtc = pScrPriv->crtcs[i];
 	    if (RRXineramaCrtcActive (crtc))
 	    {
+	        int width, height;
+		RRCrtcGetScanoutSize (crtc, &width, &height);
 		scratch.x_org  = crtc->x;
 		scratch.y_org  = crtc->y;
-		scratch.width  = crtc->mode->mode.width;
-		scratch.height = crtc->mode->mode.height;
+		scratch.width  = width;
+		scratch.height = height;
 		if(client->swapped) {
 		    register int n;
 		    swaps(&scratch.x_org, n);
diff-tree 72754184f1215acd2b053d476fa46142d97c8ebd (from 1225a49da28dc04cc8233cfa746e1fae0024bbe1)
Author: Eric Anholt <eric at anholt.net>
Date:   Mon Jan 22 08:41:50 2007 +0800

    Really fix optimized render cases being hit when they shouldn't.
    
    I don't know how this define slipped in there.  Fixes
    6fdfd9dad91d7b7aa292f8c4d268dd27c34de8d3.

diff --git a/fb/fbpict.h b/fb/fbpict.h
index 179a07d..bfcb38e 100644
--- a/fb/fbpict.h
+++ b/fb/fbpict.h
@@ -105,9 +105,6 @@ fbCanGetSolid(PicturePtr pict)
     }
 }
 
-#define fbCanGetSolid(pict) \
-(pict->pDrawable != NULL && pict->pDrawable->width == 1 && pict->pDrawable->height == 1)
-
 #define fbComposeGetSolid(pict, bits, fmt) { \
     FbBits	*__bits__; \
     FbStride	__stride__; \
diff-tree 1225a49da28dc04cc8233cfa746e1fae0024bbe1 (from 364fb547d4d489f623cd633eaaeea00f617fd75e)
Author: Eric Anholt <eric at anholt.net>
Date:   Thu Jan 18 14:28:01 2007 -0800

    Account for CRTC rotation in the cursor containment code.

diff --git a/randr/rrpointer.c b/randr/rrpointer.c
index c092e49..2a5ae7d 100644
--- a/randr/rrpointer.c
+++ b/randr/rrpointer.c
@@ -22,6 +22,32 @@
 
 #include "randrstr.h"
 
+/**
+ * Returns the width/height that the crtc scans out from the framebuffer
+ */
+static void
+RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height)
+{
+    if (crtc->mode == NULL) {
+	*width = 0;
+	*height = 0;
+	return;
+    }
+
+    switch (crtc->rotation & 0xf) {
+    case RR_Rotate_0:
+    case RR_Rotate_180:
+	*width = crtc->mode->mode.width;
+	*height = crtc->mode->mode.height;
+	break;
+    case RR_Rotate_90:
+    case RR_Rotate_270:
+	*width = crtc->mode->mode.height;
+	*height = crtc->mode->mode.width;
+	break;
+    }
+}
+
 /*
  * When the pointer moves, check to see if the specified position is outside
  * any of theavailable CRTCs and move it to a 'sensible' place if so, where
@@ -34,11 +60,15 @@ static Bool
 RRCrtcContainsPosition (RRCrtcPtr crtc, int x, int y)
 {
     RRModePtr   mode = crtc->mode;
-    
+    int		scan_width, scan_height;
+
     if (!mode)
 	return FALSE;
-    if (crtc->x <= x && x < crtc->x + mode->mode.width &&
-	crtc->y <= y && y < crtc->y + mode->mode.height)
+
+    RRCrtcGetScanoutSize (crtc, &scan_width, &scan_height);
+
+    if (crtc->x <= x && x < crtc->x + scan_width &&
+	crtc->y <= y && y < crtc->y + scan_height)
 	return TRUE;
     return FALSE;
 }
@@ -54,28 +84,32 @@ RRPointerToNearestCrtc (ScreenPtr pScree
     RRCrtcPtr	nearest = NULL;
     int		best = 0;
     int		best_dx = 0, best_dy = 0;
-    
+
     for (c = 0; c < pScrPriv->numCrtcs; c++)
     {
 	RRCrtcPtr   crtc = pScrPriv->crtcs[c];
 	RRModePtr   mode = crtc->mode;
 	int	    dx, dy;
 	int	    dist;
+	int	    scan_width, scan_height;
 
 	if (!mode)
 	    continue;
 	if (crtc == skip)
 	    continue;
+
+	RRCrtcGetScanoutSize (crtc, &scan_width, &scan_height);
+
 	if (x < crtc->x)
 	    dx = crtc->x - x;
-	else if (x > crtc->x + mode->mode.width)
-	    dx = x - (crtc->x + mode->mode.width);
+	else if (x > crtc->x + scan_width)
+	    dx = x - (crtc->x + scan_width);
 	else
 	    dx = 0;
 	if (y < crtc->y)
 	    dy = crtc->y - x;
-	else if (y > crtc->y + mode->mode.height)
-	    dy = y - (crtc->y + mode->mode.height);
+	else if (y > crtc->y + scan_height)
+	    dy = y - (crtc->y + scan_height);
 	else
 	    dy = 0;
 	dist = dx + dy;
diff-tree 364fb547d4d489f623cd633eaaeea00f617fd75e (from 11307c4b88244afc8b6a4dac36aa063c083b36d4)
Author: Eric Anholt <eric at anholt.net>
Date:   Tue Jan 16 13:01:03 2007 -0800

    When changing a non-pending property, call the screen rrOutputSetProperty hook.

diff --git a/randr/rrproperty.c b/randr/rrproperty.c
index dd1b5e0..ed01c88 100644
--- a/randr/rrproperty.c
+++ b/randr/rrproperty.c
@@ -125,6 +125,7 @@ RRChangeOutputProperty (RROutputPtr outp
 {
     RRPropertyPtr		    prop;
     xRROutputPropertyNotifyEvent    event;
+    rrScrPrivPtr		    pScrPriv = rrGetScrPriv(output->pScreen);
     int				    sizeInBytes;
     int				    totalSize;
     pointer			    data;
@@ -213,6 +214,13 @@ RRChangeOutputProperty (RROutputPtr outp
 	prop->next = output->properties;
 	output->properties = prop;
     }
+
+    if (!prop->is_pending) {
+	/* What should we do in case of failure? */
+	pScrPriv->rrOutputSetProperty(output->pScreen, output,
+				      prop->propertyName, prop_value);
+    }
+
     if (sendevent)
     {
 	event.type = RREventBase + RRNotify;
diff-tree 11307c4b88244afc8b6a4dac36aa063c083b36d4 (from 07e5c928ab9904ef21678d236b8eb5ef6419ed51)
Author: Eric Anholt <eric at anholt.net>
Date:   Tue Jan 16 12:59:34 2007 -0800

    Don't forget to add the property we configure to the properties list.

diff --git a/randr/rrproperty.c b/randr/rrproperty.c
index 13e8483..dd1b5e0 100644
--- a/randr/rrproperty.c
+++ b/randr/rrproperty.c
@@ -298,6 +298,12 @@ RRConfigureOutputProperty (RROutputPtr o
     if (prop->valid_values)
 	xfree (prop->valid_values);
     prop->valid_values = new_values;
+
+    if (add) {
+	prop->next = output->properties;
+	output->properties = prop;
+    }
+
     return Success;
 }
 
diff-tree 07e5c928ab9904ef21678d236b8eb5ef6419ed51 (from f1b95fda6ca01ff10a06e8753f66eb123d603eed)
Author: Eric Anholt <eric at anholt.net>
Date:   Tue Jan 9 16:34:40 2007 -0800

    Track rename of DamagePost -> DamageAdd.

diff --git a/damageext/damageext.c b/damageext/damageext.c
index 62525f6..36d31e8 100755
--- a/damageext/damageext.c
+++ b/damageext/damageext.c
@@ -276,14 +276,14 @@ ProcDamageSubtract (ClientPtr client)
 }
 
 static int
-ProcDamagePost (ClientPtr client)
+ProcDamageAdd (ClientPtr client)
 {
-    REQUEST(xDamagePostReq);
+    REQUEST(xDamageAddReq);
     DrawablePtr	    pDrawable;
     RegionPtr	    pRegion;
     int		    rc;
 
-    REQUEST_SIZE_MATCH(xDamagePostReq);
+    REQUEST_SIZE_MATCH(xDamageAddReq);
     VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess);
     rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
 			   DixReadAccess);
@@ -303,7 +303,7 @@ ProcDamagePost (ClientPtr client)
 /* Major version controls available requests */
 static const int version_requests[] = {
     X_DamageQueryVersion,	/* before client sends QueryVersion */
-    X_DamagePost,		/* Version 1 */
+    X_DamageAdd,		/* Version 1 */
 };
 
 #define NUM_VERSION_REQUESTS	(sizeof (version_requests) / sizeof (version_requests[0]))
@@ -315,7 +315,7 @@ int	(*ProcDamageVector[XDamageNumberRequ
     ProcDamageDestroy,
     ProcDamageSubtract,
 /*************** Version 1.1 ****************/
-    ProcDamagePost,
+    ProcDamageAdd,
 };
 
 
@@ -385,10 +385,10 @@ SProcDamageSubtract (ClientPtr client)
 }
 
 static int
-SProcDamagePost (ClientPtr client)
+SProcDamageAdd (ClientPtr client)
 {
     register int n;
-    REQUEST(xDamagePostReq);
+    REQUEST(xDamageAddReq);
 
     swaps (&stuff->length, n);
     REQUEST_SIZE_MATCH(xDamageSubtractReq);
@@ -404,7 +404,7 @@ int	(*SProcDamageVector[XDamageNumberReq
     SProcDamageDestroy,
     SProcDamageSubtract,
 /*************** Version 1.1 ****************/
-    SProcDamagePost,
+    SProcDamageAdd,
 };
 
 static int
diff-tree f1b95fda6ca01ff10a06e8753f66eb123d603eed (from cd5fe7890d9b940b9d3e00043a6c81a10ae3db69)
Author: Keith Packard <keithp at neko.keithp.com>
Date:   Mon Jan 29 23:01:37 2007 -0800

    Add support for the DamagePost (XDamage 1.1) request.
    
    This makes damageproto >= 1.1 a requirement to build.
    (cherry picked from 0b73a7eb17fd848c6bdc6a65ba835aa2cbfc3cfd)

diff --git a/configure.ac b/configure.ac
index 6c0aa3a..a939687 100644
--- a/configure.ac
+++ b/configure.ac
@@ -514,7 +514,7 @@ XEXT_LIB='$(top_builddir)/Xext/libXext.l
 XEXTXORG_LIB='$(top_builddir)/Xext/libXextbuiltin.la'
 
 dnl Core modules for most extensions, et al.
-REQUIRED_MODULES="randrproto renderproto [fixesproto >= 4.0] damageproto xcmiscproto xextproto xproto xtrans xf86miscproto xf86vidmodeproto xf86bigfontproto [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto inputproto xf86dgaproto [kbproto >= 1.0.3]"
+REQUIRED_MODULES="[randrproto >= 1.2] renderproto [fixesproto >= 4.0] [damageproto >= 1.1] xcmiscproto xextproto xproto xtrans xf86miscproto xf86vidmodeproto xf86bigfontproto [scrnsaverproto >= 1.1] bigreqsproto resourceproto fontsproto inputproto xf86dgaproto [kbproto >= 1.0.3]"
 REQUIRED_LIBS="xfont xau fontenc"
 
 AM_CONDITIONAL(XV, [test "x$XV" = xyes])
diff --git a/damageext/damageext.c b/damageext/damageext.c
index 225f9ec..62525f6 100755
--- a/damageext/damageext.c
+++ b/damageext/damageext.c
@@ -275,10 +275,35 @@ ProcDamageSubtract (ClientPtr client)
     return (client->noClientException);
 }
 
+static int
+ProcDamagePost (ClientPtr client)
+{
+    REQUEST(xDamagePostReq);
+    DrawablePtr	    pDrawable;
+    RegionPtr	    pRegion;
+    int		    rc;
+
+    REQUEST_SIZE_MATCH(xDamagePostReq);
+    VERIFY_REGION(pRegion, stuff->region, client, DixWriteAccess);
+    rc = dixLookupDrawable(&pDrawable, stuff->drawable, client, 0,
+			   DixReadAccess);
+    if (rc != Success)
+	return rc;
+
+    /* The region is relative to the drawable origin, so translate it out to
+     * screen coordinates like damage expects.
+     */
+    REGION_TRANSLATE(pScreen, pRegion, pDrawable->x, pDrawable->y);
+    DamageDamageRegion(pDrawable, pRegion);
+    REGION_TRANSLATE(pScreen, pRegion, -pDrawable->x, -pDrawable->y);
+
+    return (client->noClientException);
+}
+
 /* Major version controls available requests */
 static const int version_requests[] = {
     X_DamageQueryVersion,	/* before client sends QueryVersion */
-    X_DamageSubtract,		/* Version 1 */
+    X_DamagePost,		/* Version 1 */
 };
 
 #define NUM_VERSION_REQUESTS	(sizeof (version_requests) / sizeof (version_requests[0]))
@@ -289,6 +314,8 @@ int	(*ProcDamageVector[XDamageNumberRequ
     ProcDamageCreate,
     ProcDamageDestroy,
     ProcDamageSubtract,
+/*************** Version 1.1 ****************/
+    ProcDamagePost,
 };
 
 
@@ -357,12 +384,27 @@ SProcDamageSubtract (ClientPtr client)
     return (*ProcDamageVector[stuff->damageReqType]) (client);
 }
 
+static int
+SProcDamagePost (ClientPtr client)
+{
+    register int n;
+    REQUEST(xDamagePostReq);
+
+    swaps (&stuff->length, n);
+    REQUEST_SIZE_MATCH(xDamageSubtractReq);
+    swapl (&stuff->drawable, n);
+    swapl (&stuff->region, n);
+    return (*ProcDamageVector[stuff->damageReqType]) (client);
+}
+
 int	(*SProcDamageVector[XDamageNumberRequests])(ClientPtr) = {
 /*************** Version 1 ******************/
     SProcDamageQueryVersion,
     SProcDamageCreate,
     SProcDamageDestroy,
     SProcDamageSubtract,
+/*************** Version 1.1 ****************/
+    SProcDamagePost,
 };
 
 static int
diff-tree cd5fe7890d9b940b9d3e00043a6c81a10ae3db69 (from 1a34f1966c23fbc291a56e9e747aec8eaf9ca2a4)
Author: Eric Anholt <eric at anholt.net>
Date:   Thu Jan 4 12:24:48 2007 -0800

    Keep track of how many visuals we set up for GLcore, to avoid an invalid free.
    
    The proper fix would involve actually setting up the ARGB visual for GLcore,
    but I just want the server to not crash at exit.

diff --git a/GL/mesa/X/xf86glx.c b/GL/mesa/X/xf86glx.c
index 94959d6..47c87f6 100644
--- a/GL/mesa/X/xf86glx.c
+++ b/GL/mesa/X/xf86glx.c
@@ -78,6 +78,7 @@ typedef struct __GLXMESAdrawable __GLXME
 struct __GLXMESAscreen {
     __GLXscreen   base;
     int           index;
+    int		  num_vis;
     XMesaVisual  *xm_vis;
 };
 
@@ -280,7 +281,7 @@ __glXMesaScreenDestroy(__GLXscreen *scre
     __GLXMESAscreen *mesaScreen = (__GLXMESAscreen *) screen;
     int i;
 
-    for (i = 0; i < screen->numVisuals; i++) {
+    for (i = 0; i < mesaScreen->num_vis; i++) {
 	if (mesaScreen->xm_vis[i])
 	    XMesaDestroyVisual(mesaScreen->xm_vis[i]);
     }
@@ -389,6 +390,7 @@ static void init_screen_visuals(__GLXMES
 
     xfree(used);
 
+    screen->num_vis = pScreen->numVisuals;
     screen->xm_vis = pXMesaVisual;
 }
 



More information about the xorg-commit mailing list