[Xquartz-changes] xserver: Branch 'refs/tags/XQuartz-2.5.0' - 93 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Mon Mar 29 16:22:50 PDT 2010


Rebased ref, commits from common ancestor:
commit 163286ee33b016cf900f171bb3699bbb1ad2f8a5
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Mon Mar 22 09:30:51 2010 -0700

    GLX: Remove a redundant initialization
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    (cherry picked from commit 1c307d64d74ae8719680afcb750840851d33161f)

diff --git a/glx/indirect_dispatch.c b/glx/indirect_dispatch.c
index 6665519..ecd2bc8 100644
--- a/glx/indirect_dispatch.c
+++ b/glx/indirect_dispatch.c
@@ -98,8 +98,6 @@ void __glXDisp_CallLists(GLbyte * pc)
     const GLenum type = *(GLenum   *)(pc +  4);
     const GLvoid * lists =  (const GLvoid *)(pc +  8);
 
-    lists = (const GLvoid *) (pc + 8);
-
     CALL_CallLists( GET_DISPATCH(), (
         n,
         type,
commit d585d5c980bac7e91c0adee4c69872054a27c348
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Sun Jan 31 01:38:53 2010 -0800

    fb: Revert fb changes that broke XQuartz
    
    http://bugs.freedesktop.org/show_bug.cgi?id=26124
    
    Revert "Fix source pictures getting random transforms after 2d6a8f668342a5190cdf43b5."
    Revert "fb: backport fb changes from master for src window operations."
    
    This reverts commit 66b6e2fd49fdc650703e56aa176a902e4921251c.
    This reverts commit 2d6a8f668342a5190cdf43b5d385f592d10f5900.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>

diff --git a/fb/fb.h b/fb/fb.h
index 8b2839a..37de71e 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -700,41 +700,38 @@ typedef struct {
 #define __fbPixOffXPix(pPix)	(__fbPixDrawableX(pPix))
 #define __fbPixOffYPix(pPix)	(__fbPixDrawableY(pPix))
 
-#define fbGetDrawablePixmap(pDrawable, pixmap, xoff, yoff) {			\
-    if ((pDrawable)->type != DRAWABLE_PIXMAP) { 				\
-	(pixmap) = fbGetWindowPixmap(pDrawable);				\
-	(xoff) = __fbPixOffXWin(pixmap); 					\
-	(yoff) = __fbPixOffYWin(pixmap); 					\
-    } else { 									\
-	(pixmap) = (PixmapPtr) (pDrawable);					\
-	(xoff) = __fbPixOffXPix(pixmap); 					\
-	(yoff) = __fbPixOffYPix(pixmap); 					\
-    } 										\
-    fbPrepareAccess(pDrawable); 						\
-}
-
-#define fbGetPixmapBitsData(pixmap, pointer, stride, bpp) {			\
-    (pointer) = (FbBits *) (pixmap)->devPrivate.ptr; 			       	\
-    (stride) = ((int) (pixmap)->devKind) / sizeof (FbBits); (void)(stride);	\
-    (bpp) = (pixmap)->drawable.bitsPerPixel;  (void)(bpp); 			\
-}
-
-#define fbGetPixmapStipData(pixmap, pointer, stride, bpp) {			\
-    (pointer) = (FbStip *) (pixmap)->devPrivate.ptr; 			       	\
-    (stride) = ((int) (pixmap)->devKind) / sizeof (FbStip); (void)(stride);	\
-    (bpp) = (pixmap)->drawable.bitsPerPixel;  (void)(bpp); 			\
-}
-
-#define fbGetDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { 		\
-    PixmapPtr   _pPix; 								\
-    fbGetDrawablePixmap(pDrawable, _pPix, xoff, yoff); 				\
-    fbGetPixmapBitsData(_pPix, pointer, stride, bpp);				\
+#define fbGetDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
+    PixmapPtr   _pPix; \
+    if ((pDrawable)->type != DRAWABLE_PIXMAP) { \
+	_pPix = fbGetWindowPixmap(pDrawable); \
+	(xoff) = __fbPixOffXWin(_pPix); \
+	(yoff) = __fbPixOffYWin(_pPix); \
+    } else { \
+	_pPix = (PixmapPtr) (pDrawable); \
+	(xoff) = __fbPixOffXPix(_pPix); \
+	(yoff) = __fbPixOffYPix(_pPix); \
+    } \
+    fbPrepareAccess(pDrawable); \
+    (pointer) = (FbBits *) _pPix->devPrivate.ptr; \
+    (stride) = ((int) _pPix->devKind) / sizeof (FbBits); (void)(stride); \
+    (bpp) = _pPix->drawable.bitsPerPixel;  (void)(bpp); \
 }
 
-#define fbGetStipDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { 	\
-    PixmapPtr   _pPix; 								\
-    fbGetDrawablePixmap(pDrawable, _pPix, xoff, yoff);				\
-    fbGetPixmapStipData(_pPix, pointer, stride, bpp);				\
+#define fbGetStipDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
+    PixmapPtr   _pPix; \
+    if ((pDrawable)->type != DRAWABLE_PIXMAP) { \
+	_pPix = fbGetWindowPixmap(pDrawable); \
+	(xoff) = __fbPixOffXWin(_pPix); \
+	(yoff) = __fbPixOffYWin(_pPix); \
+    } else { \
+	_pPix = (PixmapPtr) (pDrawable); \
+	(xoff) = __fbPixOffXPix(_pPix); \
+	(yoff) = __fbPixOffYPix(_pPix); \
+    } \
+    fbPrepareAccess(pDrawable); \
+    (pointer) = (FbStip *) _pPix->devPrivate.ptr; \
+    (stride) = ((int) _pPix->devKind) / sizeof (FbStip); (void)(stride); \
+    (bpp) = _pPix->drawable.bitsPerPixel; (void)(bpp); \
 }
 
 /*
@@ -2082,16 +2079,9 @@ fbFillRegionSolid (DrawablePtr	pDrawable,
 		   FbBits	xor);
 
 extern _X_EXPORT pixman_image_t *
-image_from_pict (PicturePtr	pict,
-		 Bool		has_clip,
-		 Bool		is_src);
-
-extern _X_EXPORT pixman_image_t *
-image_from_pict_18 (PicturePtr	pict,
-		 Bool		has_clip,
-		 int		*xoff,
-		 int		*yoff);
-
+image_from_pict (PicturePtr pict,
+		 Bool       has_clip,
+		 Bool       is_src);
 extern _X_EXPORT void free_pixman_pict (PicturePtr, pixman_image_t *);
 
 #endif /* _FB_H_ */
diff --git a/fb/fbpict.c b/fb/fbpict.c
index c046bae..8fdaa58 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -158,24 +158,19 @@ fbComposite (CARD8      op,
 	     CARD16     height)
 {
     pixman_image_t *src, *mask, *dest;
-    int src_xoff, src_yoff;
-    int msk_xoff, msk_yoff;
-    int dst_xoff, dst_yoff;
     
-    miCompositeSourceValidate (pSrc, xSrc - xDst, ySrc - yDst, width, height);
+    miCompositeSourceValidate (pSrc, xSrc, ySrc, width, height);
     if (pMask)
-	miCompositeSourceValidate (pMask, xMask - xDst, yMask - yDst, width, height);
+	miCompositeSourceValidate (pMask, xMask, yMask, width, height);
     
-    src = image_from_pict_18 (pSrc, FALSE, &src_xoff, &src_yoff);
-    mask = image_from_pict_18 (pMask, FALSE, &msk_xoff, &msk_yoff);
-    dest = image_from_pict_18 (pDst, TRUE, &dst_xoff, &dst_yoff);
+    src = image_from_pict (pSrc, TRUE, TRUE);
+    mask = image_from_pict (pMask, TRUE, TRUE);
+    dest = image_from_pict (pDst, TRUE, FALSE);
 
     if (src && dest && !(pMask && !mask))
     {
 	pixman_image_composite (op, src, mask, dest,
-				xSrc + src_xoff, ySrc + src_yoff,
-				xMask + msk_xoff, yMask + msk_yoff,
-				xDst + dst_xoff, yDst + dst_yoff,
+				xSrc, ySrc, xMask, yMask, xDst, yDst,
 				width, height);
     }
 
@@ -275,22 +270,22 @@ create_conical_gradient_image (PictGradient *gradient)
 
 static pixman_image_t *
 create_bits_picture (PicturePtr pict,
-		     Bool       has_clip,
-		     int	*xoff,
-		     int	*yoff)
+		     Bool       has_clip)
 {
-    PixmapPtr pixmap;
     FbBits *bits;
     FbStride stride;
-    int bpp;
+    int bpp, xoff, yoff;
     pixman_image_t *image;
     
-    fbGetDrawablePixmap (pict->pDrawable, pixmap, *xoff, *yoff);
-    fbGetPixmapBitsData(pixmap, bits, stride, bpp);
+    fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff);
+
+    bits = (FbBits*)((CARD8*)bits +
+		     (pict->pDrawable->y + yoff) * stride * sizeof(FbBits) +
+		     (pict->pDrawable->x + xoff) * (bpp / 8));
 
     image = pixman_image_create_bits (
 	pict->format,
-	pixmap->drawable.width, pixmap->drawable.height,
+	pict->pDrawable->width, pict->pDrawable->height,
 	(uint32_t *)bits, stride * sizeof (FbStride));
     
     
@@ -316,52 +311,30 @@ create_bits_picture (PicturePtr pict,
 	if (pict->clientClipType != CT_NONE)
 	    pixman_image_set_has_client_clip (image, TRUE);
 
-	if (*xoff || *yoff)
-	    pixman_region_translate (pict->pCompositeClip, *xoff, *yoff);
+	pixman_region_translate (pict->pCompositeClip, - pict->pDrawable->x, - pict->pDrawable->y);
 
 	pixman_image_set_clip_region (image, pict->pCompositeClip);
 
-	if (*xoff || *yoff)
-	    pixman_region_translate (pict->pCompositeClip, -*xoff, -*yoff);
+	pixman_region_translate (pict->pCompositeClip, pict->pDrawable->x, pict->pDrawable->y);
     }
     
     /* Indexed table */
     if (pict->pFormat->index.devPrivate)
 	pixman_image_set_indexed (image, pict->pFormat->index.devPrivate);
 
-    /* Add in drawable origin to position within the image */
-    *xoff += pict->pDrawable->x;
-    *yoff += pict->pDrawable->y;
-
     return image;
 }
 
 static void
-set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
+set_image_properties (pixman_image_t *image, PicturePtr pict)
 {
     pixman_repeat_t repeat;
     pixman_filter_t filter;
     
     if (pict->transform)
     {
-	/* For source images, adjust the transform to account
-	 * for the drawable offset within the pixman image,
-	 * then set the offset to 0 as it will be used
-	 * to compute positions within the transformed image.
-	 */
-	if (!has_clip) {
-	    struct pixman_transform	adjusted;
-
-	    adjusted = *pict->transform;
-	    pixman_transform_translate(&adjusted,
-				       NULL,
-				       pixman_int_to_fixed(*xoff),
-				       pixman_int_to_fixed(*yoff));
-	    pixman_image_set_transform (image, &adjusted);
-	    *xoff = 0;
-	    *yoff = 0;
-	} else
-	    pixman_image_set_transform (image, pict->transform);
+	pixman_image_set_transform (
+	    image, (pixman_transform_t *)pict->transform);
     }
     
     switch (pict->repeatType)
@@ -388,8 +361,7 @@ set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int
     
     if (pict->alphaMap)
     {
-	int alpha_xoff, alpha_yoff;
-	pixman_image_t *alpha_map = image_from_pict_18 (pict->alphaMap, FALSE, &alpha_xoff, &alpha_yoff);
+	pixman_image_t *alpha_map = image_from_pict (pict->alphaMap, TRUE, TRUE);
 	
 	pixman_image_set_alpha_map (
 	    image, alpha_map, pict->alphaOrigin.x, pict->alphaOrigin.y);
@@ -421,9 +393,10 @@ set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int
     pixman_image_set_source_clipping (image, TRUE);
 }
 
-
 pixman_image_t *
-image_from_pict_18 (PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
+image_from_pict (PicturePtr pict,
+		 Bool has_clip,
+		 Bool is_src)
 {
     pixman_image_t *image = NULL;
 
@@ -432,7 +405,7 @@ image_from_pict_18 (PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
 
     if (pict->pDrawable)
     {
-	image = create_bits_picture (pict, has_clip, xoff, yoff);
+	image = create_bits_picture (pict, has_clip);
     }
     else if (pict->pSourcePict)
     {
@@ -453,22 +426,14 @@ image_from_pict_18 (PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
 	    else if (sp->type == SourcePictTypeConical)
 		image = create_conical_gradient_image (gradient);
 	}
-	*xoff = *yoff = 0;
     }
     
     if (image)
-	set_image_properties (image, pict, has_clip, xoff, yoff);
+	set_image_properties (image, pict);
     
     return image;
 }
 
-pixman_image_t *
-image_from_pict (PicturePtr pict, Bool has_clip, Bool is_src)
-{
-    int xoff = 0, yoff = 0;
-    return image_from_pict_18(pict, has_clip, &xoff, &yoff);
-}
-
 void
 free_pixman_pict (PicturePtr pict, pixman_image_t *image)
 {
@@ -498,4 +463,3 @@ fbPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
 
     return TRUE;
 }
-
diff --git a/fb/fbtrap.c b/fb/fbtrap.c
index 5b5aeae..b1e1eff 100644
--- a/fb/fbtrap.c
+++ b/fb/fbtrap.c
@@ -40,8 +40,7 @@ fbAddTraps (PicturePtr	pPicture,
 	    int		ntrap,
 	    xTrap	*traps)
 {
-    int image_xoff, image_yoff;
-    pixman_image_t *image = image_from_pict_18 (pPicture, FALSE, &image_xoff, &image_yoff);
+    pixman_image_t *image = image_from_pict (pPicture, FALSE, FALSE);
 
     if (!image)
 	return;
@@ -57,8 +56,7 @@ fbRasterizeTrapezoid (PicturePtr    pPicture,
 		      int	    x_off,
 		      int	    y_off)
 {
-    int	mask_xoff, mask_yoff;
-    pixman_image_t *image = image_from_pict_18 (pPicture, FALSE, &mask_xoff, &mask_yoff);
+    pixman_image_t *image = image_from_pict (pPicture, FALSE, FALSE);
 
     if (!image)
 	return;
diff --git a/fb/wfbrename.h b/fb/wfbrename.h
index e9cdca8..73ee510 100644
--- a/fb/wfbrename.h
+++ b/fb/wfbrename.h
@@ -187,5 +187,4 @@
 #define fbZeroSegment wfbZeroSegment
 #define free_pixman_pict wfb_free_pixman_pict
 #define image_from_pict wfb_image_from_pict
-#define image_from_pict_18 wfb_image_from_pict_18
 #define composeFunctions wfbComposeFunctions
commit a7f60537227c2c667a9075b6fab308a5de996903
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Mar 17 14:32:38 2010 +1000

    dix: if owner-events is true for passive grabs, add the window mask (#25400)
    
    A client requesting a GrabModeSync button grab, owner-events true, with only
    the ButtonRelease mask set would never receive the press event even if the
    grab window had the ButtonPress mask set.
    
    The protocol requires that if owner-events is true, then the delivery mask
    is the combination of the grab mask + the window event mask.
    
    X.Org Bug 25400 <http://bugs.freedesktop.org/show_bug.cgi?id=25400>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Tested-by: Jim Ramsay <i.am at jimramsay.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 1c612acca8568fcdf9761d23f112adaf4d496f1b)

diff --git a/dix/events.c b/dix/events.c
index 3c625db..732740e 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3552,6 +3552,8 @@ CheckPassiveGrabsOnWindow(
                 xE = &core;
                 count = 1;
                 mask = grab->eventMask;
+                if (grab->ownerEvents)
+                    mask |= pWin->eventMask;
             } else if (match & XI2_MATCH)
             {
                 rc = EventToXI2((InternalEvent*)event, &xE);
@@ -3573,6 +3575,24 @@ CheckPassiveGrabsOnWindow(
                     mask = grab->xi2mask[device->id][((xGenericEvent*)xE)->evtype/8];
                 else if (event->type == XI_Enter || event->type == XI_FocusIn)
                     mask = grab->xi2mask[device->id][event->type/8];
+
+                if (grab->ownerEvents && wOtherInputMasks(grab->window))
+                {
+                    InputClientsPtr icp =
+                        wOtherInputMasks(grab->window)->inputClients;
+
+                    while(icp)
+                    {
+                        if (rClient(icp) == rClient(grab))
+                        {
+                            int evtype = (xE) ? ((xGenericEvent*)xE)->evtype : event->type;
+                            mask |= icp->xi2mask[device->id][evtype/8];
+                            break;
+                        }
+
+                        icp = icp->next;
+                    }
+                }
             } else
             {
                 rc = EventToXI((InternalEvent*)event, &xE, &count);
@@ -3584,6 +3604,22 @@ CheckPassiveGrabsOnWindow(
                     continue;
                 }
                 mask = grab->eventMask;
+                if (grab->ownerEvents && wOtherInputMasks(grab->window))
+                {
+                    InputClientsPtr icp =
+                        wOtherInputMasks(grab->window)->inputClients;
+
+                    while(icp)
+                    {
+                        if (rClient(icp) == rClient(grab))
+                        {
+                            mask |= icp->mask[device->id];
+                            break;
+                        }
+
+                        icp = icp->next;
+                    }
+                }
             }
 
 	    (*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE);
commit 8faac273d3fa2394fbc686be52476bd229754338
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Mon Mar 22 14:20:56 2010 -0700

    XKB: Fix garbage initialization
    
    XkbEnableDisableControls set extra garbage bits on the xkbControlsNotify
    changedControls mask because it was uninitialized on the stack.
    
    Found by clang
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    (cherry picked from commit e081ef1d26c03a38da58f1eacf21ebe8fff5a7d9)

diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
index 75e243c..30ec438 100644
--- a/xkb/xkbUtils.c
+++ b/xkb/xkbUtils.c
@@ -753,7 +753,7 @@ XkbSrvLedInfoPtr	sli;
     if (cause!=NULL) {
 	xkbControlsNotify cn;
 	cn.numGroups= ctrls->num_groups;
-	cn.changedControls|= XkbControlsEnabledMask;
+	cn.changedControls= XkbControlsEnabledMask;
 	cn.enabledControls= ctrls->enabled_ctrls;
 	cn.enabledControlChanges= (ctrls->enabled_ctrls^old);
 	cn.keycode= cause->kc;
commit 49a2b55e0e1e265c1393c04c9df8e73f30dccd33
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sun Mar 28 13:46:23 2010 -0700

    XQuartz: Re-query dixScreenOrigins as the value could've changed.
    
    Fix a regression in 9c9c3a85b094a3c7b2763a572715d710325091aa
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    Acked-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit 28a5f14b4089dccb8045cc4fdc923542a73dd22d)

diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c
index 59107be..a611854 100644
--- a/hw/xquartz/quartz.c
+++ b/hw/xquartz/quartz.c
@@ -268,8 +268,11 @@ void QuartzUpdateScreens(void) {
     DarwinAdjustScreenOrigins(&screenInfo);
     quartzProcs->UpdateScreen(pScreen);
     
-    sx = x + darwinMainScreenX;
-    sy = y + darwinMainScreenY;
+    /* DarwinAdjustScreenOrigins or UpdateScreen may change dixScreenOrigins,
+     * so use it rather than x/y
+     */
+    sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX;
+    sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY;
     
     /* Adjust the root window. */
     pRoot = WindowTable[pScreen->myNum];
commit 68319e7f0755a7d36ed1544214dceae0afa05b76
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Thu Mar 25 22:15:58 2010 -0700

    XQuartz: Workaround weird key data reported on some layouts
    
    This should make 'Unicode Hex Input' work as an input layout.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    Acked-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit 339207be6f184cc783076fc7e2cc12f92f57f2ba)

diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index c9ef7cc..a4a0b08 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -735,7 +735,10 @@ Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) {
                     if (err != noErr) continue;
                 }
 
-                if (len > 0 && s[0] != 0x0010) {
+                /* Not sure why 0x0010 is there.
+                 * 0x0000 - <rdar://problem/7793566> 'Unicode Hex Input' ...
+                 */
+                if (len > 0 && s[0] != 0x0010 && s[0] != 0x0000) {
                     k[j] = ucs2keysym (s[0]);
                     if (dead_key_state != 0) k[j] = make_dead_key (k[j]);
                 }
commit 2ad8aae749fe08f139e3046e923da8233b9a7cd5
Author: Roland Scheidegger <sroland at vmware.com>
Date:   Fri Mar 12 16:53:30 2010 +0100

    hw/xfree86: move reference counting out of the UseHWCursor[ARGB] functions
    
    The problem is that the xf86_use_hw_cursor(_argb) functions may get this
    correctly now, some drivers will replace these generic versions with their
    own functions. It is pretty insane to expect them to do reference counting
    of the cursor (as an example, look at driver/xf86-video-vmware to see how
    that looks like as a workaround). There are even places in xserver itself
    which replace these two functions.
    The segfaults if no reference counting is done are caused because the
    reference count of the cursor reached zero, hence the cursor was freed,
    however xf86CursorEnableDisableFBAccess() brought it back to life from
    the dead (from the SavedCursor).
    This patch hence adds reference counting in xf86CursorSetCursor. As per Michel
    Daenzer's suggestion, also free the cursor upon xf86CursorCloseScreen.
    In theory with this it should be possible to remove the reference
    counting in the UseHwCursor functions I think, though it should also be
    safe to keep them.
    
    Signed-off-by: Roland Scheidegger <sroland at vmware.com>
    Reviewed-by: Michel Dänzer <michel at daenzer.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 67a8c659f25218904bae64aac6e98e326c90330b)

diff --git a/hw/xfree86/ramdac/xf86Cursor.c b/hw/xfree86/ramdac/xf86Cursor.c
index 6b71f46..7f23d9e 100644
--- a/hw/xfree86/ramdac/xf86Cursor.c
+++ b/hw/xfree86/ramdac/xf86Cursor.c
@@ -129,6 +129,9 @@ xf86CursorCloseScreen(int i, ScreenPtr pScreen)
     if (ScreenPriv->isUp && pScrn->vtSema)
 	xf86SetCursor(pScreen, NullCursor, ScreenPriv->x, ScreenPriv->y);
 
+    if (ScreenPriv->CurrentCursor)
+	FreeCursor(ScreenPriv->CurrentCursor, None);
+
     pScreen->CloseScreen = ScreenPriv->CloseScreen;
     pScreen->QueryBestSize = ScreenPriv->QueryBestSize;
     pScreen->RecolorCursor = ScreenPriv->RecolorCursor;
@@ -317,6 +320,9 @@ xf86CursorSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCurs,
     if (pDev == inputInfo.pointer ||
         (!IsMaster(pDev) && pDev->u.master == inputInfo.pointer))
     {
+	pCurs->refcnt++;
+	if (ScreenPriv->CurrentCursor)
+	    FreeCursor(ScreenPriv->CurrentCursor, None);
 	ScreenPriv->CurrentCursor = pCurs;
 	ScreenPriv->x = x;
 	ScreenPriv->y = y;
commit e481a4912bc53a09429002b2bf8c321b516d236f
Author: Tomas Carnecky <tom at dbservice.com>
Date:   Mon Mar 22 11:20:15 2010 -0700

    Fix typos in the swap functions
    
    This should fix bug #3539.
    
    Signed-off-by: Tomas Carnecky <tom at dbservice.com>
    Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 0c2fde5c8ad6e94b4ed1588aa93256a2b64f74d9)

diff --git a/glx/glxcmdsswap.c b/glx/glxcmdsswap.c
index f1c0ce6..c414dc8 100644
--- a/glx/glxcmdsswap.c
+++ b/glx/glxcmdsswap.c
@@ -354,7 +354,7 @@ int __glXDispSwap_CreateGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
 
 int __glXDispSwap_DestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
 {
-    xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) req;
+    xGLXDestroyPbufferReq *req = (xGLXDestroyPbufferReq *) pc;
     __GLX_DECLARE_SWAP_VARIABLES;
 
     __GLX_SWAP_INT(&req->pbuffer);
@@ -364,7 +364,7 @@ int __glXDispSwap_DestroyPbuffer(__GLXclientState *cl, GLbyte *pc)
 
 int __glXDispSwap_DestroyGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
 {
-    xGLXDestroyGLXPbufferSGIXReq *req = (xGLXDestroyGLXPbufferSGIXReq *) req;
+    xGLXDestroyGLXPbufferSGIXReq *req = (xGLXDestroyGLXPbufferSGIXReq *) pc;
     __GLX_DECLARE_SWAP_VARIABLES;
 
     __GLX_SWAP_INT(&req->pbuffer);
@@ -375,7 +375,7 @@ int __glXDispSwap_DestroyGLXPbufferSGIX(__GLXclientState *cl, GLbyte *pc)
 int __glXDispSwap_ChangeDrawableAttributes(__GLXclientState *cl, GLbyte *pc)
 {
     xGLXChangeDrawableAttributesReq *req =
-	(xGLXChangeDrawableAttributesReq *) req;
+	(xGLXChangeDrawableAttributesReq *) pc;
     __GLX_DECLARE_SWAP_VARIABLES;
     __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
     CARD32 *attribs;
@@ -392,7 +392,7 @@ int __glXDispSwap_ChangeDrawableAttributesSGIX(__GLXclientState *cl,
 					       GLbyte *pc)
 {
     xGLXChangeDrawableAttributesSGIXReq *req =
-	(xGLXChangeDrawableAttributesSGIXReq *) req;
+	(xGLXChangeDrawableAttributesSGIXReq *) pc;
     __GLX_DECLARE_SWAP_VARIABLES;
     __GLX_DECLARE_SWAP_ARRAY_VARIABLES;
     CARD32 *attribs;
commit 2fa794f246b0224c458295a271a4246b52eb75c0
Author: Peter Harris <pharris at opentext.com>
Date:   Tue Mar 23 12:08:19 2010 -0400

    Fix crash when all glyphs of a given depth are freed, but not all glyphsets
    
    This is how the crash can be triggered with only two clients on the system:
    Client A: (already running)
    Client B: Connect
    Client B: CreateGlyphSet(depthN)
    Client A: Disconnect
    Server: free globalGlyphs(depthN)
    Client B: AddGlyphs(depthN)
    Server: SEGV
    
    This crash was introduced with the FindGlyphsByHash function
    in 516b96387b0e57b524a37a96da22dbeeeb041712. Before that revision,
    ResizeGlyphSet was always called before FindGlyphRef, which would
    re-create globalGlyphs(depthN) if necessary.
    
    X.Org Bug 20718 <http://bugs.freedesktop.org/show_bug.cgi?id=20718>
    
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Peter Harris <pharris at opentext.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 185185eeb44a277c324be0f58a4b4a469b56b69b)

diff --git a/render/glyph.c b/render/glyph.c
index 7fcdfd9..7282705 100644
--- a/render/glyph.c
+++ b/render/glyph.c
@@ -235,6 +235,9 @@ FindGlyphByHash (unsigned char sha1[20], int format)
     GlyphRefPtr gr;
     CARD32 signature = *(CARD32 *) sha1;
 
+    if (!globalGlyphs[format].hashSet)
+	return NULL;
+
     gr = FindGlyphRef (&globalGlyphs[format],
 		       signature, TRUE, sha1);
 
commit 4c85c3815a6f1698e91d2043d51a716948f8c1df
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Fri Mar 19 17:24:27 2010 -0700

    XQuartz: Constrain the pointer to the updated display bounds on display reconfigure.
    
    http://xquartz.macosforge.org/trac/ticket/346
    (cherry picked from commit ed31d50b5f7f25e4db986711699704e615b8afcb)

diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c
index 3c04205..59107be 100644
--- a/hw/xquartz/quartz.c
+++ b/hw/xquartz/quartz.c
@@ -241,6 +241,7 @@ void QuartzUpdateScreens(void) {
     WindowPtr pRoot;
     int x, y, width, height, sx, sy;
     xEvent e;
+    BoxRec bounds;
     
     if (noPseudoramiXExtension || screenInfo.numScreens != 1)
     {
@@ -277,8 +278,16 @@ void QuartzUpdateScreens(void) {
     //pScreen->PaintWindowBackground (pRoot, &pRoot->borderClip,  PW_BACKGROUND);
     miPaintWindow(pRoot, &pRoot->borderClip,  PW_BACKGROUND);
 
-//  TODO: This is a noop in 1.6 and nuked in master... we may need to do something else now to handle it
-//    DefineInitialRootWindow(pRoot);
+    /* <rdar://problem/7770779> pointer events are clipped to old display region after display reconfiguration
+     * http://xquartz.macosforge.org/trac/ticket/346
+     */
+    bounds.x1 = 0;
+    bounds.x2 = width;
+    bounds.y1 = 0;
+    bounds.y2 = height;
+    pScreen->ConstrainCursor(inputInfo.pointer, pScreen, &bounds);
+    inputInfo.pointer->spriteInfo->sprite->physLimits = bounds;
+    inputInfo.pointer->spriteInfo->sprite->hotLimits = bounds;
 
     DEBUG_LOG("Root Window: %dx%d @ (%d, %d) darwinMainScreen (%d, %d) xy (%d, %d) dixScreenOrigins (%d, %d)\n", width, height, x - sx, y - sy, darwinMainScreenX, darwinMainScreenY, x, y, dixScreenOrigins[pScreen->myNum].x, dixScreenOrigins[pScreen->myNum].y);
 
commit b226618f55a5393e32f339a963ae7aaf145c51a4
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Sat Mar 20 11:03:28 2010 -0700

    XQuartz: pbproxy: Make standalone xpbproxy respect the launchd prefix
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>
    (cherry picked from commit 38215cc43e4c012588c7a50344b8fe368d1252cc)

diff --git a/hw/xquartz/pbproxy/Makefile.am b/hw/xquartz/pbproxy/Makefile.am
index 02da6b2..1886642 100644
--- a/hw/xquartz/pbproxy/Makefile.am
+++ b/hw/xquartz/pbproxy/Makefile.am
@@ -1,5 +1,7 @@
-AM_CPPFLAGS=-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks
-AM_CFLAGS=$(XPBPROXY_CFLAGS)
+AM_CPPFLAGS=-F/System/Library/Frameworks/ApplicationServices.framework/Frameworks \
+	-DLAUNCHD_ID_PREFIX=\"$(LAUNCHD_ID_PREFIX)\"
+
+AM_CFLAGS=$(XPBPROXY_CFLAGS) 
 
 noinst_LTLIBRARIES = libxpbproxy.la
 libxpbproxy_la_SOURCES = \
diff --git a/hw/xquartz/pbproxy/app-main.m b/hw/xquartz/pbproxy/app-main.m
index b30dfb8..b00e90a 100644
--- a/hw/xquartz/pbproxy/app-main.m
+++ b/hw/xquartz/pbproxy/app-main.m
@@ -34,7 +34,7 @@
 #include <unistd.h> /*for getpid*/
 #include <Cocoa/Cocoa.h>
 
-static const char *app_prefs_domain = "org.x.X11";
+static const char *app_prefs_domain = 	LAUNCHD_ID_PREFIX".xpbproxy";
 CFStringRef app_prefs_domain_cfstr;
 
 /* Stubs */
@@ -73,7 +73,7 @@ int main (int argc, const char *argv[]) {
             printf("usage: xpbproxy OPTIONS\n"
                    "Pasteboard proxying for X11.\n\n"
                    "--prefs-domain <domain>   Change the domain used for reading preferences\n"
-                   "                          (default: org.x.X11)\n");
+                   "                          (default: %s)\n", app_prefs_domain);
             return 0;
         } else {
             fprintf(stderr, "usage: xpbproxy OPTIONS...\n"
commit 088777f2b683d61d948cf346564a73b048da1ea2
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Sat Mar 20 03:28:57 2010 -0700

    XQuartz: xpbproxy: Cleanup xpbproxy threading
    
    Confine xpbproxy to a single thread
    Runs inside its own CFRunLoop
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>
    (cherry picked from commit 69869d79f4c21eb385ff3c64bac649d93c7dd2ad)

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 3faa1cb..5406640 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -52,7 +52,7 @@
 #include <Xplugin.h>
 
 // pbproxy/pbproxy.h
-extern BOOL xpbproxy_init (void);
+extern int xpbproxy_run (void);
 
 #define DEFAULTS_FILE X11LIBDIR"/X11/xserver/Xquartz.plist"
 
@@ -908,6 +908,26 @@ environment the next time you start X11?", @"Startup xinitrc dialog");
     [X11App prefs_synchronize];
 }
 
+static inline pthread_t create_thread(void *func, void *arg) {
+    pthread_attr_t attr;
+    pthread_t tid;
+    
+    pthread_attr_init(&attr);
+    pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
+    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+    pthread_create(&tid, &attr, func, arg);
+    pthread_attr_destroy(&attr);
+    
+    return tid;
+}
+
+static void *xpbproxy_x_thread(void *args) {
+    xpbproxy_run();
+
+    fprintf(stderr, "xpbproxy thread is terminating unexpectedly.\n");
+    return NULL;
+}
+
 void X11ApplicationMain (int argc, char **argv, char **envp) {
     NSAutoreleasePool *pool;
 
@@ -962,8 +982,7 @@ void X11ApplicationMain (int argc, char **argv, char **envp) {
      */
     check_xinitrc();
     
-    if(!xpbproxy_init())
-        fprintf(stderr, "Error initializing xpbproxy\n");
+    create_thread(xpbproxy_x_thread, NULL);
 
 #if XQUARTZ_SPARKLE
     [[X11App controller] setup_sparkle];
diff --git a/hw/xquartz/pbproxy/app-main.m b/hw/xquartz/pbproxy/app-main.m
index f3f683a..b30dfb8 100644
--- a/hw/xquartz/pbproxy/app-main.m
+++ b/hw/xquartz/pbproxy/app-main.m
@@ -84,16 +84,10 @@ int main (int argc, const char *argv[]) {
     
     app_prefs_domain_cfstr = CFStringCreateWithCString(NULL, app_prefs_domain, kCFStringEncodingUTF8);
     
-    if(!xpbproxy_init())
-        return EXIT_FAILURE;
-    
     signal (SIGINT, signal_handler);
     signal (SIGTERM, signal_handler);
     signal (SIGHUP, signal_handler);
     signal (SIGPIPE, SIG_IGN);
 
-    [NSApplication sharedApplication];
-    [NSApp run];
-    
-    return EXIT_SUCCESS;
+    return xpbproxy_run();
 }
diff --git a/hw/xquartz/pbproxy/main.m b/hw/xquartz/pbproxy/main.m
index d26b1b1..560cf01 100644
--- a/hw/xquartz/pbproxy/main.m
+++ b/hw/xquartz/pbproxy/main.m
@@ -82,25 +82,12 @@ static int x_error_handler (Display *dpy, XErrorEvent *errevent) {
     return 0;
 }
 
-static inline pthread_t create_thread(void *func, void *arg) {
-    pthread_attr_t attr;
-    pthread_t tid;
-    
-    pthread_attr_init(&attr);
-    pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
-    pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-    pthread_create(&tid, &attr, func, arg);
-    pthread_attr_destroy(&attr);
-    
-    return tid;
-}
-
-static void *xpbproxy_x_thread(void *args) {
+int xpbproxy_run (void) {
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     size_t i;
-
+    
     wait_for_server_init();
-
+    
     for(i=0, xpbproxy_dpy=NULL; !xpbproxy_dpy && i<5; i++) {
         xpbproxy_dpy = XOpenDisplay(NULL);
         
@@ -108,7 +95,7 @@ static void *xpbproxy_x_thread(void *args) {
             char _display[32];
             snprintf(_display, sizeof(_display), ":%s", display);
             setenv("DISPLAY", _display, TRUE);
-
+            
             xpbproxy_dpy=XOpenDisplay(_display);
         }
         if(!xpbproxy_dpy)
@@ -118,7 +105,7 @@ static void *xpbproxy_x_thread(void *args) {
     if (xpbproxy_dpy == NULL) {
         fprintf (stderr, "xpbproxy: can't open default display\n");
         [pool release];
-        return NULL;
+        return EXIT_FAILURE;
     }
     
     XSetIOErrorHandler (x_io_error_handler);
@@ -128,11 +115,11 @@ static void *xpbproxy_x_thread(void *args) {
                                  &xpbproxy_apple_wm_error_base)) {
         fprintf (stderr, "xpbproxy: can't open AppleWM server extension\n");
         [pool release];
-        return NULL;
+        return EXIT_FAILURE;
     }
-    
+
     xpbproxy_have_xfixes = XFixesQueryExtension(xpbproxy_dpy, &xpbproxy_xfixes_event_base, &xpbproxy_xfixes_error_base);
-    
+
     XAppleWMSelectInput (xpbproxy_dpy, AppleWMActivationNotifyMask |
                          AppleWMPasteboardNotifyMask);
     
@@ -140,18 +127,14 @@ static void *xpbproxy_x_thread(void *args) {
     
     if(!xpbproxy_input_register()) {
         [pool release];
-        return NULL;
+        return EXIT_FAILURE;
     }
-
+    
     [pool release];
- 
-    xpbproxy_input_loop();
-    return NULL;
-}
+    
+    CFRunLoopRun();
 
-BOOL xpbproxy_init (void) {
-    create_thread(xpbproxy_x_thread, NULL);
-    return TRUE;
+    return EXIT_SUCCESS;
 }
 
 id xpbproxy_selection_object (void) {
diff --git a/hw/xquartz/pbproxy/pbproxy.h b/hw/xquartz/pbproxy/pbproxy.h
index a6798ef..013f981 100644
--- a/hw/xquartz/pbproxy/pbproxy.h
+++ b/hw/xquartz/pbproxy/pbproxy.h
@@ -67,7 +67,7 @@ extern void xpbproxy_set_is_active (BOOL state);
 extern BOOL xpbproxy_get_is_active (void);
 extern id xpbproxy_selection_object (void);
 extern Time xpbproxy_current_timestamp (void);
-extern BOOL xpbproxy_init (void);
+extern int xpbproxy_run (void);
 
 extern Display *xpbproxy_dpy;
 extern int xpbproxy_apple_wm_event_base, xpbproxy_apple_wm_error_base;
@@ -76,7 +76,6 @@ extern BOOL xpbproxy_have_xfixes;
 
 /* from x-input.m */
 extern BOOL xpbproxy_input_register (void);
-extern void xpbproxy_input_loop();
 
 #ifdef DEBUG
 /* BEWARE: this can cause a string memory leak, according to the leaks program. */
diff --git a/hw/xquartz/pbproxy/x-input.m b/hw/xquartz/pbproxy/x-input.m
index 6ba30c6..405ba3c 100644
--- a/hw/xquartz/pbproxy/x-input.m
+++ b/hw/xquartz/pbproxy/x-input.m
@@ -39,17 +39,12 @@
 
 #include <unistd.h>
 
-#include <pthread.h>
-
 static CFRunLoopSourceRef xpbproxy_dpy_source;
 
 #ifdef STANDALONE_XPBPROXY
 BOOL xpbproxy_prefs_reload = NO;
 #endif
 
-static pthread_mutex_t xpbproxy_dpy_rdy_lock = PTHREAD_MUTEX_INITIALIZER;
-static pthread_cond_t xpbproxy_dpy_rdy_cond = PTHREAD_COND_INITIALIZER;
-
 /* Timestamp when the X server last told us it's active */
 static Time last_activation_time;
 
@@ -88,58 +83,51 @@ static void x_event_apple_wm_notify(XAppleWMNotifyEvent *e) {
     }
 }
 
-void xpbproxy_input_loop() {
-    pthread_mutex_lock(&xpbproxy_dpy_rdy_lock);
-    while(true) {
-        NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+static void xpbproxy_process_xevents(void) {
+    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+    
+    if(pool == nil) {
+        fprintf(stderr, "unable to allocate/init auto release pool!\n");
+        return;
+    }
+    
+    while (XPending(xpbproxy_dpy) != 0) {
+        XEvent e;
         
-        if(pool == nil) {
-            fprintf(stderr, "unable to allocate/init auto release pool!\n");
-            break;
-        }
+        XNextEvent (xpbproxy_dpy, &e);
         
-        while (XPending(xpbproxy_dpy) != 0) {
-            XEvent e;
-            
-            pthread_mutex_unlock(&xpbproxy_dpy_rdy_lock);
-            XNextEvent (xpbproxy_dpy, &e);
-            
-            switch (e.type) {                
-                case SelectionClear:
-                    if([xpbproxy_selection_object() is_active])
-                        [xpbproxy_selection_object () clear_event:&e.xselectionclear];
-                    break;
-                    
-                case SelectionRequest:
-                    [xpbproxy_selection_object () request_event:&e.xselectionrequest];
-                    break;
-                    
-                case SelectionNotify:
-                    [xpbproxy_selection_object () notify_event:&e.xselection];
-                    break;
-                    
-                case PropertyNotify:
-                    [xpbproxy_selection_object () property_event:&e.xproperty];
-                    break;
-                    
-                default:
-                    if(e.type >= xpbproxy_apple_wm_event_base &&
-                       e.type < xpbproxy_apple_wm_event_base + AppleWMNumberEvents) {
-                        x_event_apple_wm_notify((XAppleWMNotifyEvent *) &e);
-                    } else if(e.type == xpbproxy_xfixes_event_base + XFixesSelectionNotify) {
-                        [xpbproxy_selection_object() xfixes_selection_notify:(XFixesSelectionNotifyEvent *)&e];
-                    }
-                    break;
-            }
-            
-            XFlush(xpbproxy_dpy);
-            pthread_mutex_lock(&xpbproxy_dpy_rdy_lock);
+        switch (e.type) {                
+            case SelectionClear:
+                if([xpbproxy_selection_object() is_active])
+                    [xpbproxy_selection_object () clear_event:&e.xselectionclear];
+                break;
+                
+            case SelectionRequest:
+                [xpbproxy_selection_object () request_event:&e.xselectionrequest];
+                break;
+                
+            case SelectionNotify:
+                [xpbproxy_selection_object () notify_event:&e.xselection];
+                break;
+                
+            case PropertyNotify:
+                [xpbproxy_selection_object () property_event:&e.xproperty];
+                break;
+                
+            default:
+                if(e.type >= xpbproxy_apple_wm_event_base &&
+                   e.type < xpbproxy_apple_wm_event_base + AppleWMNumberEvents) {
+                    x_event_apple_wm_notify((XAppleWMNotifyEvent *) &e);
+                } else if(e.type == xpbproxy_xfixes_event_base + XFixesSelectionNotify) {
+                    [xpbproxy_selection_object() xfixes_selection_notify:(XFixesSelectionNotifyEvent *)&e];
+                }
+                break;
         }
         
-        [pool release];
-        
-        pthread_cond_wait(&xpbproxy_dpy_rdy_cond, &xpbproxy_dpy_rdy_lock);
+        XFlush(xpbproxy_dpy);
     }
+    
+    [pool release];
 }
 
 static BOOL add_input_socket (int sock, CFOptionFlags callback_types,
@@ -161,7 +149,7 @@ static BOOL add_input_socket (int sock, CFOptionFlags callback_types,
     if (*cf_source == NULL)
         return FALSE;
     
-    CFRunLoopAddSource (CFRunLoopGetMain (),
+    CFRunLoopAddSource (CFRunLoopGetCurrent (),
                         *cf_source, kCFRunLoopDefaultMode);
     return TRUE;
 }
@@ -175,10 +163,8 @@ static void x_input_callback (CFSocketRef sock, CFSocketCallBackType type,
         xpbproxy_prefs_reload = NO;
     }
 #endif
-
-    pthread_mutex_lock(&xpbproxy_dpy_rdy_lock);
-    pthread_cond_broadcast(&xpbproxy_dpy_rdy_cond);
-    pthread_mutex_unlock(&xpbproxy_dpy_rdy_lock);
+    
+    xpbproxy_process_xevents();
 }
 
 BOOL xpbproxy_input_register(void) {
commit b3f4a9a64be4b6bcc81f13cf9677a486b42dd2b4
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Fri Mar 19 17:23:12 2010 -0700

    XQuartz: Minor cleanup
    
    Move RandRInit to where it will need to be (not yet implemented)
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    (cherry picked from commit 7da4f9df9c6490e3e604c170415d5af2d8c8ff29)

diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c
index c4142a8..3c04205 100644
--- a/hw/xquartz/quartz.c
+++ b/hw/xquartz/quartz.c
@@ -166,6 +166,11 @@ void QuartzInitOutput(
         FatalError("Could not register block and wakeup handlers.");
     }
 
+#if defined(RANDR) && !defined(FAKE_RANDR)
+    if(!QuartzRandRInit(pScreen))
+        FatalError("Failed to init RandR extension.\n");
+#endif
+
     // Do display mode specific initialization
     quartzProcs->DisplayInit();
 }
@@ -259,16 +264,11 @@ void QuartzUpdateScreens(void) {
     pScreen->width = width;
     pScreen->height = height;
     
-#ifndef FAKE_RANDR
-    if(!QuartzRandRInit(pScreen))
-        FatalError("Failed to init RandR extension.\n");
-#endif
-    
     DarwinAdjustScreenOrigins(&screenInfo);
     quartzProcs->UpdateScreen(pScreen);
     
-    sx = dixScreenOrigins[pScreen->myNum].x + darwinMainScreenX;
-    sy = dixScreenOrigins[pScreen->myNum].y + darwinMainScreenY;
+    sx = x + darwinMainScreenX;
+    sy = y + darwinMainScreenY;
     
     /* Adjust the root window. */
     pRoot = WindowTable[pScreen->myNum];
commit b444205399c236c21c68e2dda32ce51497dcd7e4
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri Mar 19 15:26:50 2010 -0700

    XQuartz: GLX: Fix Availability for Tiger ppc workaround
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>
    (cherry picked from commit 88baffc25a193c7c7154a94a687e7cb0f8b180ba)

diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c
index 44380ff..5035443 100644
--- a/hw/xquartz/GL/indirect.c
+++ b/hw/xquartz/GL/indirect.c
@@ -120,7 +120,7 @@
 /* Tiger PPC doesn't have the associated symbols, but glext.h says it does.  Liars!
  * http://trac.macports.org/ticket/20638
  */
-#if defined(__ppc__) && MAC_OS_X_VERSION_MIN_REQUIRED == 1040
+#if defined(__ppc__) && MAC_OS_X_VERSION_MIN_REQUIRED < 1050
 #undef GL_EXT_gpu_program_parameters
 #define GL_EXT_gpu_program_parameters 0
 #endif
commit c552ec12f9112901d5266c00fb3aaf4e06f5d614
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Mar 17 10:49:28 2010 +1000

    xserver 1.7.6
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/configure.ac b/configure.ac
index c215b5c..4a19ae4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.7.5.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2010-03-12"
+AC_INIT([xorg-server], 1.7.6, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2010-03-17"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([dist-bzip2 foreign])
 AM_MAINTAINER_MODE
commit 63ef872068299aa2ea6bfd7d11935c222cc1e102
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Tue Mar 16 11:40:53 2010 -0700

    Revert "XQuartz: Explicitly pass a bellProc to make XBell() work again."
    
    I'm not quite sure why this was necessary, but DDXRingBell is being called
    from CoreKeyboardBell, so we don't need a separate bellProc which would
    result in multiple rings.
    
    This reverts commit 7e7e7935eeb86b5990664a662471800cfd2e7ce0.
    
    Conflicts:
    
    	hw/xquartz/quartzKeyboard.c
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index 7e36a9a..c9ef7cc 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -184,12 +184,6 @@ static void DarwinChangeKeyboardControl(DeviceIntPtr device, KeybdCtrl *ctrl) {
     // keyclick, bell volume / pitch, autorepead, LED's
 }
 
-static void DarwinKeyboardBell(int volume, DeviceIntPtr pDev, pointer arg, int something) {
-    KeybdCtrl *ctrl = arg;
-
-    DDXRingBell(volume, ctrl->bell_pitch, ctrl->bell_duration);
-}
-
 //-----------------------------------------------------------------------------
 // Utility functions to help parse Darwin keymap
 //-----------------------------------------------------------------------------
@@ -301,7 +295,7 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) {
     // for a kIOHIDParamConnectType connection.
     assert(darwinParamConnect = NXOpenEventStatus());
 
-    InitKeyboardDeviceStruct(pDev, NULL, DarwinKeyboardBell, DarwinChangeKeyboardControl);
+    InitKeyboardDeviceStruct(pDev, NULL, NULL, DarwinChangeKeyboardControl);
 
     DarwinKeyboardReloadHandler();
 
commit 31292a7c775e4a249926140a86bc19c3805cdd96
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Wed Feb 10 15:52:14 2010 -0800

    XQuartz: Use an empty xkb keymap by default
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    (cherry picked from commit 5172253bae3b9867118c6717434e73c173acd5e9)

diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index 30b8905..8b6ce62 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -45,6 +45,7 @@
 #include "site.h"
 #include "globals.h"
 #include "dix.h"
+#include "xkbsrv.h"
 
 #include <X11/extensions/XI.h>
 #include <X11/extensions/XIproto.h>
@@ -463,6 +464,11 @@ int DarwinParseModifierList(const char *constmodifiers, int separatelr)
  */
 void InitInput( int argc, char **argv )
 {
+    XkbRMLVOSet rmlvo = { .rules = "base", .model = "empty", .layout = "empty",
+                          .variant = NULL, .options = NULL };
+    /* We need to really have rules... or something... */
+    XkbSetRulesDflts(&rmlvo);
+
     darwinKeyboard = AddInputDevice(serverClient, DarwinKeybdProc, TRUE);
     RegisterKeyboardDevice( darwinKeyboard );
     darwinKeyboard->name = strdup("keyboard");
diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index 3b4eac3..7e36a9a 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -301,9 +301,6 @@ void DarwinKeyboardInit(DeviceIntPtr pDev) {
     // for a kIOHIDParamConnectType connection.
     assert(darwinParamConnect = NXOpenEventStatus());
 
-    /* We need to really have rules... or something... */
-    //XkbSetRulesDflts("base", "pc105", "us", NULL, NULL);
-
     InitKeyboardDeviceStruct(pDev, NULL, DarwinKeyboardBell, DarwinChangeKeyboardControl);
 
     DarwinKeyboardReloadHandler();
@@ -775,12 +772,9 @@ Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) {
 #endif
         }
 
-        // There seems to be an issue with this in 1.5+, shift-space is not
-        // producing space, it's sending NoSymbol... ?
-        //if (k[3] == k[2]) k[3] = NoSymbol;
-        //if (k[1] == k[0]) k[1] = NoSymbol;
-        //if (k[0] == k[2] && k[1] == k[3]) k[2] = k[3] = NoSymbol;
-        //if (k[3] == k[0] && k[2] == k[1] && k[2] == NoSymbol) k[3] = NoSymbol;
+        if (k[3] == k[2]) k[3] = NoSymbol;
+        if (k[1] == k[0]) k[1] = NoSymbol;
+        if (k[0] == k[2] && k[1] == k[3]) k[2] = k[3] = NoSymbol;
     }
 
     /* Fix up some things that are normally missing.. */
@@ -791,7 +785,7 @@ Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) {
 
             if    (k[0] == NoSymbol && k[1] == NoSymbol
                 && k[2] == NoSymbol && k[3] == NoSymbol)
-	      k[0] = k[1] = k[2] = k[3] = known_keys[i].keysym;
+	      k[0] = known_keys[i].keysym;
         }
     }
 
@@ -804,7 +798,7 @@ Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) {
             k = info->keyMap + known_numeric_keys[i].keycode * GLYPHS_PER_KEY;
 
             if (k[0] == known_numeric_keys[i].normal)
-                k[0] = k[1] = k[2] = k[3] = known_numeric_keys[i].keypad;
+                k[0] = known_numeric_keys[i].keypad;
         }
     }
 
commit 5b4fabb910eefb393eb3bfb45df5e63fdeb71f26
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Mar 15 08:44:01 2010 +1000

    configure: restore SHA1_LIB for XSERVER_SYS_LIBS
    
    Accidentally removed in ff5fb43a4b38c707a, caused by
    a botched merge when cherry-picking 178da6534fe7ab4b99fb.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/configure.ac b/configure.ac
index 2046157..c215b5c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1326,7 +1326,7 @@ PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS])
 #
 XSERVER_CFLAGS="${XSERVERCFLAGS_CFLAGS} ${SHA1_CFLAGS}"
 XSERVER_LIBS="$DIX_LIB $CONFIG_LIB $MI_LIB $OS_LIB"
-XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS}"
+XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS} ${SHA1_LIB}"
 AC_SUBST([XSERVER_LIBS])
 AC_SUBST([XSERVER_SYS_LIBS])
 
commit 5a2b3f36a05d1e0fcfd1b0f85d6584478ba24eda
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Mar 12 16:53:06 2010 +1000

    xserver 1.7.5.902
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/configure.ac b/configure.ac
index 9dca987..2046157 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.7.5.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2010-03-05"
+AC_INIT([xorg-server], 1.7.5.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2010-03-12"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([dist-bzip2 foreign])
 AM_MAINTAINER_MODE
commit c25b34fe61cb3fc7c3583a8ccf62c470cc8ead06
Merge: 3ae6a37... ff5fb43...
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Mar 12 16:37:28 2010 +1000

    Merge branch 'server-1.7-nominations' into server-1.7-branch

commit ff5fb43a4b38c707a1a9948ace621a62b5b2457a
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Mar 12 14:39:19 2010 +1000

    Xext: Link to external libraries when necessary.
    
    Although the DDX should be linked to the necessary libraries, we may
    also need to pull them in directly to the module to ensure the symbols
    are resolved at runtime. Should fix this bug with XSELINUX:
    
    /usr/bin/X: symbol lookup error:
    /usr/lib64/xorg/modules/extensions/libextmod.so: undefined symbol:
    is_selinux_enabled
    
    -v2: use _LIBADD instead of _LIBS; remove SELINUX_LIBS from
         XSERVER_SYS_LIBS as it should only be needed in extmod.
    
    Signed-off-by: Dan Nicholson <dbn.lists at gmail.com>
    Signed-off-by: Eamon Walsh <ewalsh at tycho.nsa.gov>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 178da6534fe7ab4b99fb87925c04e6f963c88583)
    
    Conflicts:
    
    	configure.ac

diff --git a/Xext/Makefile.am b/Xext/Makefile.am
index ac45f95..4f05ce9 100644
--- a/Xext/Makefile.am
+++ b/Xext/Makefile.am
@@ -32,6 +32,7 @@ BUILTIN_SRCS =			\
 
 # Sources always included in libXextmodule.la & libXext.la. That's right, zero.
 MODULE_SRCS =
+MODULE_LIBS =
 
 # Optional sources included if extension enabled by configure.ac rules
 
@@ -83,6 +84,7 @@ endif
 XSELINUX_SRCS = xselinux.c xselinux.h
 if XSELINUX
 MODULE_SRCS += $(XSELINUX_SRCS)
+MODULE_LIBS += $(SELINUX_LIBS)
 endif
 
 # Security extension: multi-level security to protect clients from each other
@@ -119,11 +121,13 @@ endif
 # Now take all of the above, mix well, bake for 10 minutes and get libXext*.la
 
 libXext_la_SOURCES =		$(BUILTIN_SRCS) $(MODULE_SRCS)
+libXext_la_LIBADD =		$(MODULE_LIBS)
 
 if XORG
 libXextbuiltin_la_SOURCES =	$(BUILTIN_SRCS)
 
 libXextmodule_la_SOURCES =	$(MODULE_SRCS)
+libXextmodule_la_LIBADD =	$(MODULE_LIBS)
 endif
 
 EXTRA_DIST = \
diff --git a/configure.ac b/configure.ac
index 08e444e..9dca987 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1326,7 +1326,7 @@ PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS])
 #
 XSERVER_CFLAGS="${XSERVERCFLAGS_CFLAGS} ${SHA1_CFLAGS}"
 XSERVER_LIBS="$DIX_LIB $CONFIG_LIB $MI_LIB $OS_LIB"
-XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS} ${SHA1_LIB} ${SELINUX_LIBS}"
+XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS}"
 AC_SUBST([XSERVER_LIBS])
 AC_SUBST([XSERVER_SYS_LIBS])
 
commit a69c7a4c539f933df3f6aa5444cdde95e4d5698a
Author: Daniel Stone <daniel at fooishbar.org>
Date:   Thu Mar 11 14:19:04 2010 +0200

    Record: Avoid duplicates from replaying frozen events
    
    Reintroduce a check which used to be there in the old
    ProcessKeyboardEvent/ProcessPointerEvent codepath, which avoids us
    recording events subject to a grab twice: once when it's first processed
    in EnqueueEvent, and then again when it's thawed and being replayed.
    
    This required a tiny amount of code motion to expose syncEvents.
    
    Signed-off-by: Daniel Stone <daniel at fooishbar.org>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit a2ea8c2f2cc53607d57d60f41c879380ea70cd02)
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index a63b65b..e680f6f 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1051,7 +1051,7 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
             break;
     }
 
-    if (DeviceEventCallback) {
+    if (DeviceEventCallback && !syncEvents.playingEvents) {
 	DeviceEventInfoRec eventinfo;
 	SpritePtr pSprite = device->spriteInfo->sprite;
 
diff --git a/dix/events.c b/dix/events.c
index 02079be..3c625db 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -253,33 +253,7 @@ extern BOOL EventIsKeyRepeat(xEvent *event);
  */
 InputInfo inputInfo;
 
-/**
- * syncEvents is the global structure for queued events.
- *
- * Devices can be frozen through GrabModeSync pointer grabs. If this is the
- * case, events from these devices are added to "pending" instead of being
- * processed normally. When the device is unfrozen, events in "pending" are
- * replayed and processed as if they would come from the device directly.
- */
-static struct {
-    QdEventPtr		pending, /**<  list of queued events */
-                        *pendtail; /**< last event in list */
-    /** The device to replay events for. Only set in AllowEvents(), in which
-     * case it is set to the device specified in the request. */
-    DeviceIntPtr	replayDev;	/* kludgy rock to put flag for */
-
-    /**
-     * The window the events are supposed to be replayed on.
-     * This window may be set to the grab's window (but only when
-     * Replay{Pointer|Keyboard} is given in the XAllowEvents()
-     * request. */
-    WindowPtr		replayWin;	/*   ComputeFreezes            */
-    /**
-     * Flag to indicate whether we're in the process of
-     * replaying events. Only set in ComputeFreezes(). */
-    Bool		playingEvents;
-    TimeStamp		time;
-} syncEvents;
+EventSyncInfoRec syncEvents;
 
 /**
  * The root window the given device is currently on.
diff --git a/include/inputstr.h b/include/inputstr.h
index 29ad5a8..15184d0 100644
--- a/include/inputstr.h
+++ b/include/inputstr.h
@@ -557,4 +557,34 @@ typedef struct _QdEvent {
     InternalEvent	*event;
 } QdEventRec;
 
+/**
+ * syncEvents is the global structure for queued events.
+ *
+ * Devices can be frozen through GrabModeSync pointer grabs. If this is the
+ * case, events from these devices are added to "pending" instead of being
+ * processed normally. When the device is unfrozen, events in "pending" are
+ * replayed and processed as if they would come from the device directly.
+ */
+typedef struct _EventSyncInfo {
+    QdEventPtr          pending, /**<  list of queued events */
+                        *pendtail; /**< last event in list */
+    /** The device to replay events for. Only set in AllowEvents(), in which
+     * case it is set to the device specified in the request. */
+    DeviceIntPtr        replayDev;      /* kludgy rock to put flag for */
+
+    /**
+     * The window the events are supposed to be replayed on.
+     * This window may be set to the grab's window (but only when
+     * Replay{Pointer|Keyboard} is given in the XAllowEvents()
+     * request. */
+    WindowPtr           replayWin;      /*   ComputeFreezes            */
+    /**
+     * Flag to indicate whether we're in the process of
+     * replaying events. Only set in ComputeFreezes(). */
+    Bool                playingEvents;
+    TimeStamp           time;
+} EventSyncInfoRec, *EventSyncInfoPtr;
+
+extern EventSyncInfoRec syncEvents;
+
 #endif /* INPUTSTRUCT_H */
commit 3ae6a3779d9040a4d7c3e1b7901117e24e0d3ecf
Author: Dave Airlie <airlied at redhat.com>
Date:   Wed Mar 10 16:07:09 2010 +1000

    dri2: return FALSE not BadValue.
    
    With 1.7 if you try and send a DRI2Connect with this value set
    to anything but 0, the server will segfault due to the strlen
    in the function this returns to, since BadValue != FALSE.
    
    Fixed via other work in 1.8.
    
    Signed-off-by: Dave Airlie <airlied at redhat.com>

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index d15ced1..1cc7b63 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -387,7 +387,7 @@ DRI2Connect(ScreenPtr pScreen, unsigned int driverType, int *fd,
 	return FALSE;
 
     if (driverType != DRI2DriverDRI)
-	return BadValue;
+	return FALSE;
 
     *fd = ds->fd;
     *driverName = ds->driverName;
commit 2086e4920a16248aa150114236dfb0637c20559a
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Mar 9 09:42:42 2010 +1000

    Revert "dix: Use DeliverGrabbedEvent for implicit passive grabs (#25400)"
    
    Reported-by: Florian Mickerl <florian at mickler.org>
    "this regresses my desktop. fluxbox is not able to move the windows around
    anymore. also popup of context-menue does not work. (well sometimes it does,
    but then the fluxbox-keyboard-shortcuts do not work)"
    
    This reverts commit 351d11fd466fae731df860a6ff4cf50ad565f43f.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/events.c b/dix/events.c
index c6aa4ab..02079be 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3462,6 +3462,7 @@ CheckPassiveGrabsOnWindow(
     {
 	DeviceIntPtr	gdev;
 	XkbSrvInfoPtr	xkbi = NULL;
+	Mask		mask = 0;
 
 	gdev= grab->modifierDevice;
         if (grab->grabtype == GRABTYPE_CORE)
@@ -3514,6 +3515,10 @@ CheckPassiveGrabsOnWindow(
 	     (grab->confineTo->realized &&
 				BorderSizeNotEmpty(device, grab->confineTo))))
 	{
+            int rc, count = 0;
+            xEvent *xE = NULL;
+            xEvent core;
+
             event->corestate &= 0x1f00;
             event->corestate |= tempGrab.modifiersDetail.exact & (~0x1f00);
             grabinfo = &device->deviceGrab;
@@ -3560,8 +3565,62 @@ CheckPassiveGrabsOnWindow(
             }
 
 
+            if (match & CORE_MATCH)
+            {
+                rc = EventToCore((InternalEvent*)event, &core);
+                if (rc != Success)
+                {
+                    if (rc != BadMatch)
+                        ErrorF("[dix] %s: core conversion failed in CPGFW "
+                                "(%d, %d).\n", device->name, event->type, rc);
+                    continue;
+                }
+                xE = &core;
+                count = 1;
+                mask = grab->eventMask;
+            } else if (match & XI2_MATCH)
+            {
+                rc = EventToXI2((InternalEvent*)event, &xE);
+                if (rc != Success)
+                {
+                    if (rc != BadMatch)
+                        ErrorF("[dix] %s: XI2 conversion failed in CPGFW "
+                                "(%d, %d).\n", device->name, event->type, rc);
+                    continue;
+                }
+                count = 1;
+
+                /* FIXME: EventToXI2 returns NULL for enter events, so
+                 * dereferencing the event is bad. Internal event types are
+                 * aligned with core events, so the else clause is valid.
+                 * long-term we should use internal events for enter/focus
+                 * as well */
+                if (xE)
+                    mask = grab->xi2mask[device->id][((xGenericEvent*)xE)->evtype/8];
+                else if (event->type == XI_Enter || event->type == XI_FocusIn)
+                    mask = grab->xi2mask[device->id][event->type/8];
+            } else
+            {
+                rc = EventToXI((InternalEvent*)event, &xE, &count);
+                if (rc != Success)
+                {
+                    if (rc != BadMatch)
+                        ErrorF("[dix] %s: XI conversion failed in CPGFW "
+                                "(%d, %d).\n", device->name, event->type, rc);
+                    continue;
+                }
+                mask = grab->eventMask;
+            }
+
 	    (*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE);
-            DeliverGrabbedEvent((InternalEvent*)event, device, FALSE);
+
+            if (xE)
+            {
+                FixUpEventFromWindow(device, xE, grab->window, None, TRUE);
+
+                TryClientEvents(rClient(grab), device, xE, count, mask,
+                                       GetEventFilter(device, xE), grab);
+            }
 
 	    if (grabinfo->sync.state == FROZEN_NO_EVENT)
 	    {
@@ -3571,6 +3630,8 @@ CheckPassiveGrabsOnWindow(
 		grabinfo->sync.state = FROZEN_WITH_EVENT;
             }
 
+            if (match & (XI_MATCH | XI2_MATCH))
+                xfree(xE); /* on core match xE == &core */
 	    return TRUE;
 	}
     }
commit 1242e494c8abc25d51fa0f8120ba353ffcf7be08
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Mar 5 09:27:13 2010 +1000

    xserver 1.7.5.901
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/configure.ac b/configure.ac
index 0726bd2..08e444e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.7.5, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2010-02-16"
+AC_INIT([xorg-server], 1.7.5.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2010-03-05"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([dist-bzip2 foreign])
 AM_MAINTAINER_MODE
commit d023b78c739672894d6b8196d91129845614e369
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Feb 25 11:37:05 2010 -0800

    Allow for missing or disabled compat_output
    
    When the compat output is missing (I don't think this is actually
    possible), or is disabled (and hence has no crtc), we would like to
    avoid dereferencing NULL pointers. This patch creates inline functions
    to extract the current compat output, crtc or associated RandR crtc
    structure, carefully checking for NULL pointers everywhere.
    
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit de86a3a3448f0a55c1cd99aee9ea80070a589877)

diff --git a/hw/xfree86/common/xf86cmap.c b/hw/xfree86/common/xf86cmap.c
index edd5ae9..f60d96e 100644
--- a/hw/xfree86/common/xf86cmap.c
+++ b/hw/xfree86/common/xf86cmap.c
@@ -1001,8 +1001,7 @@ xf86ChangeGammaRamp(
     CMapLinkPtr pLink;
 
     if (xf86_crtc_supports_gamma(pScrn)) {
-	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
-	RRCrtcPtr crtc = config->output[config->compat_output]->crtc->randr_crtc;
+	RRCrtcPtr crtc = xf86CompatRRCrtc(pScrn);
 
 	if (crtc) {
 	    if (crtc->gammaSize != size)
@@ -1076,8 +1075,7 @@ xf86GetGammaRampSize(ScreenPtr pScreen)
     CMapScreenPtr pScreenPriv;
 
     if (xf86_crtc_supports_gamma(pScrn)) {
-	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
-	RRCrtcPtr crtc = config->output[config->compat_output]->crtc->randr_crtc;
+	RRCrtcPtr crtc = xf86CompatRRCrtc(pScrn);
 
 	if (crtc)
 	    return crtc->gammaSize;
@@ -1106,8 +1104,7 @@ xf86GetGammaRamp(
     int shift, sigbits;
 
     if (xf86_crtc_supports_gamma(pScrn)) {
-	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
-	RRCrtcPtr crtc = config->output[config->compat_output]->crtc->randr_crtc;
+	RRCrtcPtr crtc = xf86CompatRRCrtc(pScrn);
 
 	if (crtc) {
 	    if (crtc->gammaSize < size)
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 9370640..334fad4 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -2571,8 +2571,8 @@ xf86SetDesiredModes (ScrnInfoPtr scrn)
 	if (!crtc->enabled)
 	    continue;
 
-	if (config->output[config->compat_output]->crtc == crtc)
-	    output = config->output[config->compat_output];
+	if (xf86CompatOutput(scrn) && xf86CompatCrtc(scrn) == crtc)
+	    output = xf86CompatOutput(scrn);
 	else
 	{
 	    for (o = 0; o < config->num_output; o++)
@@ -2692,14 +2692,16 @@ xf86SetSingleMode (ScrnInfoPtr pScrn, DisplayModePtr desired, Rotation rotation)
 {
     xf86CrtcConfigPtr	config = XF86_CRTC_CONFIG_PTR(pScrn);
     Bool		ok = TRUE;
-    xf86OutputPtr	compat_output = config->output[config->compat_output];
-    DisplayModePtr	compat_mode;
+    xf86OutputPtr	compat_output;
+    DisplayModePtr	compat_mode = NULL;
     int			c;
 
     /*
      * Let the compat output drive the final mode selection
      */
-    compat_mode = xf86OutputFindClosestMode (compat_output, desired);
+    compat_output = xf86CompatOutput(pScrn);
+    if (compat_output)
+	compat_mode = xf86OutputFindClosestMode (compat_output, desired);
     if (compat_mode)
 	desired = compat_mode;
     
@@ -2894,7 +2896,7 @@ xf86OutputSetEDID (xf86OutputPtr output, xf86MonPtr edid_mon)
     }
 
     /* Set the DDC properties for the 'compat' output */
-    if (output == config->output[config->compat_output])
+    if (output == xf86CompatOutput(scrn))
         xf86SetDDCproperties(scrn, edid_mon);
 
 #ifdef RANDR_12_INTERFACE
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index 9baa956..68a968c 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -689,6 +689,32 @@ extern _X_EXPORT int xf86CrtcConfigPrivateIndex;
 
 #define XF86_CRTC_CONFIG_PTR(p)	((xf86CrtcConfigPtr) ((p)->privates[xf86CrtcConfigPrivateIndex].ptr))
 
+static _X_INLINE xf86OutputPtr
+xf86CompatOutput(ScrnInfoPtr pScrn)
+{
+    xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
+    return config->output[config->compat_output];
+}
+
+static _X_INLINE xf86CrtcPtr
+xf86CompatCrtc(ScrnInfoPtr pScrn)
+{
+    xf86OutputPtr compat_output = xf86CompatOutput(pScrn);
+    if (!compat_output)
+	return NULL;
+    return compat_output->crtc;
+}
+
+static _X_INLINE RRCrtcPtr
+xf86CompatRRCrtc(ScrnInfoPtr pScrn)
+{
+    xf86CrtcPtr	compat_crtc = xf86CompatCrtc(pScrn);
+    if (!compat_crtc)
+	return NULL;
+    return compat_crtc->randr_crtc;
+}
+
+
 /*
  * Initialize xf86CrtcConfig structure
  */
diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 1fc63c4..7ba09b6 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -805,9 +805,10 @@ xf86RandR12CreateScreenResources (ScreenPtr pScreen)
 	}
 	else
 	{
-	    xf86OutputPtr   output = config->output[config->compat_output];
+	    xf86OutputPtr   output = xf86CompatOutput(pScrn);
 
-	    if (output->conf_monitor &&
+	    if (output &&
+		output->conf_monitor &&
 		(output->conf_monitor->mon_width  > 0 &&
 		 output->conf_monitor->mon_height > 0))
 	    {
@@ -1719,10 +1720,13 @@ xf86RandR12ChangeGamma(int scrnIndex, Gamma gamma)
 {
     CARD16 *points, *red, *green, *blue;
     ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
-    xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
-    RRCrtcPtr crtc = config->output[config->compat_output]->crtc->randr_crtc;
-    int size = max(0, crtc->gammaSize);
+    RRCrtcPtr crtc = xf86CompatRRCrtc(pScrn);
+    int size;
 
+    if (!crtc)
+	return Success;
+
+    size = max(0, crtc->gammaSize);
     if (!size)
 	return Success;
 
commit 7def5cdf7dce0ace34e0befb3a9730e1bd607b61
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu Mar 4 15:42:47 2010 +1000

    configure: move SELINUX_LIBS to XSERVER_SYS_LIBS
    
    All ddxs require linking against selinux if enabled.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>
    Reviewed-by: Eamon Walsh <ewalsh at tycho.nsa.gov>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 1c2abec479cfbac9aeadc121af0825d368317658)
    
    Conflicts:
    
    	configure.ac

diff --git a/configure.ac b/configure.ac
index 562111c..0726bd2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1326,7 +1326,7 @@ PKG_CHECK_MODULES([XSERVERLIBS], [$REQUIRED_LIBS])
 #
 XSERVER_CFLAGS="${XSERVERCFLAGS_CFLAGS} ${SHA1_CFLAGS}"
 XSERVER_LIBS="$DIX_LIB $CONFIG_LIB $MI_LIB $OS_LIB"
-XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS} ${SHA1_LIB}"
+XSERVER_SYS_LIBS="${XSERVERLIBS_LIBS} ${SYS_LIBS} ${LIBS} ${SHA1_LIB} ${SELINUX_LIBS}"
 AC_SUBST([XSERVER_LIBS])
 AC_SUBST([XSERVER_SYS_LIBS])
 
@@ -1479,7 +1479,7 @@ if test "x$XORG" = xyes; then
 	AC_CHECK_FUNCS([pci_device_vgaarb_init])
 	LIBS=$SAVE_LIBS
 	CFLAGS=$SAVE_CFLAGS
-	XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $DLOPEN_LIBS $GLX_SYS_LIBS $SELINUX_LIBS"
+	XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $DLOPEN_LIBS $GLX_SYS_LIBS"
 	XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
 
 	case $host_os in
commit 402668251135b63b7329722397fe7885e065f27c
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu Mar 4 15:41:53 2010 +1000

    configure: move libselinux requirement up to the common section.
    
    Let's have all version-specific requirements in one block.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>
    Reviewed-by: Eamon Walsh <ewalsh at tycho.nsa.gov>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit cab99b947c66a42dbf8a906bdb02e23aa7cab519)
    
    Conflicts:
    
    	configure.ac

diff --git a/configure.ac b/configure.ac
index 558de87..562111c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -759,6 +759,7 @@ LIBXI="xi >= 1.2.99.1"
 LIBXTST="xtst >= 1.0.99.2"
 LIBPCIACCESS="pciaccess >= 0.8.0"
 LIBGLIB="glib-2.0 >= 2.16"
+LIBSELINUX="libselinux >= 2.0.86"
 
 dnl HAVE_DBUS is true if we actually have the D-Bus library, whereas
 dnl CONFIG_DBUS_API is true if we want to enable the D-Bus config
@@ -1014,7 +1015,7 @@ if test "x$XSELINUX" = xyes; then
 	fi
 	AC_CHECK_HEADERS([libaudit.h], [], AC_MSG_ERROR([SELinux extension requires audit system headers]))
 	AC_CHECK_LIB(audit, audit_open, [], AC_MSG_ERROR([SELinux extension requires audit system library]))
-	PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.0.86])
+	PKG_CHECK_MODULES([SELINUX], $LIBSELINUX)
 	SELINUX_LIBS="$SELINUX_LIBS -laudit"
 	AC_DEFINE(XSELINUX, 1, [Build SELinux extension])
 fi
commit 351d11fd466fae731df860a6ff4cf50ad565f43f
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu Feb 25 12:49:21 2010 +1000

    dix: Use DeliverGrabbedEvent for implicit passive grabs (#25400)
    
    A client requesting a GrabModeSync button grab, owner-events true, with only
    the ButtonRelease mask set would never receive the press event even if the
    grab window had the ButtonPress mask set.
    
    The protocol requires that if owner-events is true, then the delivery mask
    is the combination of the grab mask + the window event mask.
    
    DeliverGrabbedEvents does this already for us, checking first the delivery
    based on owner_events and then based on the grab mask. AFAICT, the device
    cannot enter the states FREEZE_BOTH_NEXT_EVENT or FREEZE_NEXT_EVENT that
    would be handled by DGE in any possible path here.
    
    Bonus point - CheckPassiveGrabsOnWindows suddenly becomes a lot lesss
    complicated.
    
    X.Org Bug 25400 <http://bugs.freedesktop.org/show_bug.cgi?id=25400>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit cf72b5437d2d620521279077a29c5df6d0fbb576)
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/events.c b/dix/events.c
index 02079be..c6aa4ab 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3462,7 +3462,6 @@ CheckPassiveGrabsOnWindow(
     {
 	DeviceIntPtr	gdev;
 	XkbSrvInfoPtr	xkbi = NULL;
-	Mask		mask = 0;
 
 	gdev= grab->modifierDevice;
         if (grab->grabtype == GRABTYPE_CORE)
@@ -3515,10 +3514,6 @@ CheckPassiveGrabsOnWindow(
 	     (grab->confineTo->realized &&
 				BorderSizeNotEmpty(device, grab->confineTo))))
 	{
-            int rc, count = 0;
-            xEvent *xE = NULL;
-            xEvent core;
-
             event->corestate &= 0x1f00;
             event->corestate |= tempGrab.modifiersDetail.exact & (~0x1f00);
             grabinfo = &device->deviceGrab;
@@ -3565,62 +3560,8 @@ CheckPassiveGrabsOnWindow(
             }
 
 
-            if (match & CORE_MATCH)
-            {
-                rc = EventToCore((InternalEvent*)event, &core);
-                if (rc != Success)
-                {
-                    if (rc != BadMatch)
-                        ErrorF("[dix] %s: core conversion failed in CPGFW "
-                                "(%d, %d).\n", device->name, event->type, rc);
-                    continue;
-                }
-                xE = &core;
-                count = 1;
-                mask = grab->eventMask;
-            } else if (match & XI2_MATCH)
-            {
-                rc = EventToXI2((InternalEvent*)event, &xE);
-                if (rc != Success)
-                {
-                    if (rc != BadMatch)
-                        ErrorF("[dix] %s: XI2 conversion failed in CPGFW "
-                                "(%d, %d).\n", device->name, event->type, rc);
-                    continue;
-                }
-                count = 1;
-
-                /* FIXME: EventToXI2 returns NULL for enter events, so
-                 * dereferencing the event is bad. Internal event types are
-                 * aligned with core events, so the else clause is valid.
-                 * long-term we should use internal events for enter/focus
-                 * as well */
-                if (xE)
-                    mask = grab->xi2mask[device->id][((xGenericEvent*)xE)->evtype/8];
-                else if (event->type == XI_Enter || event->type == XI_FocusIn)
-                    mask = grab->xi2mask[device->id][event->type/8];
-            } else
-            {
-                rc = EventToXI((InternalEvent*)event, &xE, &count);
-                if (rc != Success)
-                {
-                    if (rc != BadMatch)
-                        ErrorF("[dix] %s: XI conversion failed in CPGFW "
-                                "(%d, %d).\n", device->name, event->type, rc);
-                    continue;
-                }
-                mask = grab->eventMask;
-            }
-
 	    (*grabinfo->ActivateGrab)(device, grab, currentTime, TRUE);
-
-            if (xE)
-            {
-                FixUpEventFromWindow(device, xE, grab->window, None, TRUE);
-
-                TryClientEvents(rClient(grab), device, xE, count, mask,
-                                       GetEventFilter(device, xE), grab);
-            }
+            DeliverGrabbedEvent((InternalEvent*)event, device, FALSE);
 
 	    if (grabinfo->sync.state == FROZEN_NO_EVENT)
 	    {
@@ -3630,8 +3571,6 @@ CheckPassiveGrabsOnWindow(
 		grabinfo->sync.state = FROZEN_WITH_EVENT;
             }
 
-            if (match & (XI_MATCH | XI2_MATCH))
-                xfree(xE); /* on core match xE == &core */
 	    return TRUE;
 	}
     }
commit 8f743f17ed0076d10d6c60fe8bdf3f54d3432ae5
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Mon Feb 15 17:42:11 2010 -0800

    Solaris xf86OSRingBell() off-by-one error in filling iov[] array
    
    When generating sound buffers for /dev/audio bells, insert waveform
    for beep *or* silence, but not both, so we don't write one entry past
    the end of the iov buffer when the final bit of soundwave ends up in
    the final entry allocated in the iov array.
    
    Fixes OpenSolaris bug 6894890:
     http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6894890
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Acked-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/os-support/solaris/sun_bell.c b/hw/xfree86/os-support/solaris/sun_bell.c
index 7f146ea..05d1749 100644
--- a/hw/xfree86/os-support/solaris/sun_bell.c
+++ b/hw/xfree86/os-support/solaris/sun_bell.c
@@ -126,14 +126,15 @@ xf86OSRingBell(int loudness, int pitch, int duration)
     iovcnt = 0;
 
     for (cnt = 0; cnt <= repeats; cnt++) {
-        iov[iovcnt].iov_base = (char *) samples;
-        iov[iovcnt++].iov_len = sizeof(samples);
         if (cnt == repeats) {
             /* Insert a bit of silence so that multiple beeps are distinct and
              * not compressed into a single tone.
              */
             iov[iovcnt].iov_base = (char *) silence;
             iov[iovcnt++].iov_len = sizeof(silence);
+        } else {
+            iov[iovcnt].iov_base = (char *) samples;
+            iov[iovcnt++].iov_len = sizeof(samples);
         }
         if ((iovcnt >= IOV_MAX) || (cnt == repeats)) {
             written = writev(audioFD, iov, iovcnt);
commit d35e08b6db911c404d7baf680dab30e8a6831bc4
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu Feb 18 16:00:15 2010 +1000

    dix: remove now-erroneous comment about frozen slave devices.
    
    A direct grab on a slave device through XI2 detaches it, regardless of
    whether the grab is sync or async. So this comment doesn't apply to XI2
    anyway.
    
    For XI1, aside from your life being miserable already, it doesn't matter as
    XI1 does not have a concept of attachment. You can freeze a device and if
    you don't freeze _all_ other devices at the same time, the master device can
    still happily send events to the client.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Acked-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit c0d941913199ed251fceab62fcf65437f6f9bd31)
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/events.c b/dix/events.c
index 4423c16..02079be 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1414,11 +1414,6 @@ CheckGrabForSyncs(DeviceIntPtr thisDev, Bool thisMode, Bool otherMode)
 	    thisDev->deviceGrab.sync.other = NullGrab;
     }
 
-    /*
-        XXX: Direct slave grab won't freeze the paired master device.
-        The correct thing to do would be to freeze all SDs attached to the
-        paired master device.
-     */
     if (IsMaster(thisDev))
     {
         dev = GetPairedDevice(thisDev);
commit 11c27f261efc5b7a8594ad2de7bed4339f2a62ce
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Feb 15 16:32:16 2010 +1000

    dix: try to ring the bell even if the current device doesn't have one. (#24503)
    
    Evdev devices do not have the bell proc set, but XTEST devices do. By
    exiting early, the bell only rings if the last keyboard used was the XTEST
    keyboard and hence the bell proc is still set on the master but not if an
    evdev keyboard was used last.
    
    The better approach here is to try to ring the bell on all devices attached
    to this master device in case one or more actually do produce an audible
    sound. That's also XKB's behaviour if XkbUseCoreKbd is specified as device
    identifier.
    
    X.Org Bug 24503 <http://bugs.freedesktop.org/show_bug.cgi?id=24503>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    (cherry picked from commit 758f6971750ed507e64eee817d720a77181439f2)
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/devices.c b/dix/devices.c
index ef199b7..87b6dc7 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -2019,14 +2019,6 @@ ProcBell(ClientPtr client)
 	return BadValue;
     }
 
-    /* Seems like no keyboard actually has the BellProc set. Returning
-     * BadDevice (previous code) will make apps crash badly. The man pages
-     * doesn't say anything about a BadDevice being returned either.
-     * So just quietly do nothing and pretend everything has worked.
-     */
-    if (!keybd->kbdfeed->BellProc)
-        return Success;
-
     newpercent = (base * stuff->percent) / 100;
     if (stuff->percent < 0)
         newpercent = base + newpercent;
commit 1f96c0371845d5904b7d4c8fe71ee545b649faca
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Wed Feb 3 15:40:47 2010 -0500

    xselinux: Bump extension minor version.
    
    Changes introduced in this version:
    	- 3 window-related requests now handle pixmaps also.
    
    Signed-off-by: Eamon Walsh <ewalsh at tycho.nsa.gov>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit db4f676f25c6d8e58263d5151942be730592d444)

diff --git a/Xext/xselinux.h b/Xext/xselinux.h
index 6fa66d3..69c2437 100644
--- a/Xext/xselinux.h
+++ b/Xext/xselinux.h
@@ -25,7 +25,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 /* Extension info */
 #define SELINUX_EXTENSION_NAME		"SELinux"
 #define SELINUX_MAJOR_VERSION		1
-#define SELINUX_MINOR_VERSION		0
+#define SELINUX_MINOR_VERSION		1
 #define SELinuxNumberEvents		0
 #define SELinuxNumberErrors		0
 
commit dd9573d4086ca24c59a99a0a2019bf20c61b0f64
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Wed Feb 3 15:38:57 2010 -0500

    xselinux: Rename window-related requests that now support pixmaps.
    
    Renamed requests:
    	SetWindowCreateContext -> SetDrawableCreateContext
    	GetWindowCreateContext -> GetDrawableCreateContext
    	GetWindowContext -> GetDrawableContext
    
    Signed-off-by: Eamon Walsh <ewalsh at tycho.nsa.gov>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/Xext/xselinux.c b/Xext/xselinux.c
index a1c1b83..b6bf67c 100644
--- a/Xext/xselinux.c
+++ b/Xext/xselinux.c
@@ -1355,7 +1355,7 @@ ProcSELinuxGetDeviceContext(ClientPtr client)
 }
 
 static int
-ProcSELinuxGetWindowContext(ClientPtr client)
+ProcSELinuxGetDrawableContext(ClientPtr client)
 {
     DrawablePtr pDraw;
     PrivateRec **privatePtr;
@@ -1620,12 +1620,12 @@ ProcSELinuxDispatch(ClientPtr client)
 	return ProcSELinuxSetDeviceContext(client);
     case X_SELinuxGetDeviceContext:
 	return ProcSELinuxGetDeviceContext(client);
-    case X_SELinuxSetWindowCreateContext:
+    case X_SELinuxSetDrawableCreateContext:
 	return ProcSELinuxSetCreateContext(client, CTX_WIN);
-    case X_SELinuxGetWindowCreateContext:
+    case X_SELinuxGetDrawableCreateContext:
 	return ProcSELinuxGetCreateContext(client, CTX_WIN);
-    case X_SELinuxGetWindowContext:
-	return ProcSELinuxGetWindowContext(client);
+    case X_SELinuxGetDrawableContext:
+	return ProcSELinuxGetDrawableContext(client);
     case X_SELinuxSetPropertyCreateContext:
 	return ProcSELinuxSetCreateContext(client, CTX_PRP);
     case X_SELinuxGetPropertyCreateContext:
@@ -1708,14 +1708,14 @@ SProcSELinuxGetDeviceContext(ClientPtr client)
 }
 
 static int
-SProcSELinuxGetWindowContext(ClientPtr client)
+SProcSELinuxGetDrawableContext(ClientPtr client)
 {
     REQUEST(SELinuxGetContextReq);
     int n;
 
     REQUEST_SIZE_MATCH(SELinuxGetContextReq);
     swapl(&stuff->id, n);
-    return ProcSELinuxGetWindowContext(client);
+    return ProcSELinuxGetDrawableContext(client);
 }
 
 static int
@@ -1782,12 +1782,12 @@ SProcSELinuxDispatch(ClientPtr client)
 	return SProcSELinuxSetDeviceContext(client);
     case X_SELinuxGetDeviceContext:
 	return SProcSELinuxGetDeviceContext(client);
-    case X_SELinuxSetWindowCreateContext:
+    case X_SELinuxSetDrawableCreateContext:
 	return SProcSELinuxSetCreateContext(client, CTX_WIN);
-    case X_SELinuxGetWindowCreateContext:
+    case X_SELinuxGetDrawableCreateContext:
 	return ProcSELinuxGetCreateContext(client, CTX_WIN);
-    case X_SELinuxGetWindowContext:
-	return SProcSELinuxGetWindowContext(client);
+    case X_SELinuxGetDrawableContext:
+	return SProcSELinuxGetDrawableContext(client);
     case X_SELinuxSetPropertyCreateContext:
 	return SProcSELinuxSetCreateContext(client, CTX_PRP);
     case X_SELinuxGetPropertyCreateContext:
diff --git a/Xext/xselinux.h b/Xext/xselinux.h
index fef207a..6fa66d3 100644
--- a/Xext/xselinux.h
+++ b/Xext/xselinux.h
@@ -35,9 +35,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #define X_SELinuxGetDeviceCreateContext		2
 #define X_SELinuxSetDeviceContext		3
 #define X_SELinuxGetDeviceContext		4
-#define X_SELinuxSetWindowCreateContext		5
-#define X_SELinuxGetWindowCreateContext		6
-#define X_SELinuxGetWindowContext		7
+#define X_SELinuxSetDrawableCreateContext	5
+#define X_SELinuxGetDrawableCreateContext	6
+#define X_SELinuxGetDrawableContext		7
 #define X_SELinuxSetPropertyCreateContext	8
 #define X_SELinuxGetPropertyCreateContext	9
 #define X_SELinuxSetPropertyUseContext		10
commit 7cec236a03917841131941ce97bd1dfd4a027327
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Wed Feb 3 15:08:40 2010 -0500

    xselinux: Allow GetWindowContext to be used for pixmaps as well.
    
    Signed-off-by: Eamon Walsh <ewalsh at tycho.nsa.gov>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/Xext/xselinux.c b/Xext/xselinux.c
index 4382c21..a1c1b83 100644
--- a/Xext/xselinux.c
+++ b/Xext/xselinux.c
@@ -1357,18 +1357,26 @@ ProcSELinuxGetDeviceContext(ClientPtr client)
 static int
 ProcSELinuxGetWindowContext(ClientPtr client)
 {
-    WindowPtr pWin;
+    DrawablePtr pDraw;
+    PrivateRec **privatePtr;
     SELinuxObjectRec *obj;
     int rc;
 
     REQUEST(SELinuxGetContextReq);
     REQUEST_SIZE_MATCH(SELinuxGetContextReq);
 
-    rc = dixLookupWindow(&pWin, stuff->id, client, DixGetAttrAccess);
+    rc = dixLookupDrawable(&pDraw, stuff->id, client,
+			   M_WINDOW | M_DRAWABLE_PIXMAP,
+			   DixGetAttrAccess);
     if (rc != Success)
 	return rc;
 
-    obj = dixLookupPrivate(&pWin->devPrivates, objectKey);
+    if (pDraw->type == M_DRAWABLE_PIXMAP)
+	privatePtr = &((PixmapPtr)pDraw)->devPrivates;
+    else
+	privatePtr = &((WindowPtr)pDraw)->devPrivates;
+
+    obj = dixLookupPrivate(privatePtr, objectKey);
     return SELinuxSendContextReply(client, obj->sid);
 }
 
commit 1b6f498b84de7f79de735b004b8e16b9a31d228c
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Wed Jan 6 12:52:51 2010 -0500

    xselinux: Remove reference counting calls for SID objects.
    
    Starting with libselinux 2.0.86, SID objects are no longer
    reference counted and the sidput() and sidget() calls are no-ops.
    
    Signed-off-by: Eamon Walsh <ewalsh at tycho.nsa.gov>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/Xext/xselinux.c b/Xext/xselinux.c
index 60a18d1..4382c21 100644
--- a/Xext/xselinux.c
+++ b/Xext/xselinux.c
@@ -112,9 +112,6 @@ typedef struct {
 /* labeling handle */
 static struct selabel_handle *label_hnd;
 
-/* whether AVC is active */
-static int avc_active;
-
 /* atoms for window label properties */
 static Atom atom_ctx;
 static Atom atom_client_ctx;
@@ -238,20 +235,17 @@ SELinuxSelectionToSID(Atom selection, SELinuxSubjectRec *subj,
 
     /* Check for an override context next */
     if (subj->sel_use_sid) {
-	sidget(tsid = subj->sel_use_sid);
+	tsid = subj->sel_use_sid;
 	goto out;
     }
 
-    sidget(tsid = obj->sid);
+    tsid = obj->sid;
 
     /* Polyinstantiate if necessary to obtain the final SID */
-    if (obj->poly) {
-	sidput(tsid);
-	if (avc_compute_member(subj->sid, obj->sid,
-			       SECCLASS_X_SELECTION, &tsid) < 0) {
-	    ErrorF("SELinux: a compute_member call failed!\n");
-	    return BadValue;
-	}
+    if (obj->poly && avc_compute_member(subj->sid, obj->sid,
+					SECCLASS_X_SELECTION, &tsid) < 0) {
+	ErrorF("SELinux: a compute_member call failed!\n");
+	return BadValue;
     }
 out:
     *sid_rtn = tsid;
@@ -278,7 +272,7 @@ SELinuxPropertyToSID(Atom property, SELinuxSubjectRec *subj,
 
     /* Check for an override context next */
     if (subj->prp_use_sid) {
-	sidget(tsid = subj->prp_use_sid);
+	tsid = subj->prp_use_sid;
 	goto out;
     }
 
@@ -295,10 +289,8 @@ SELinuxPropertyToSID(Atom property, SELinuxSubjectRec *subj,
 	if (avc_compute_member(subj->sid, tsid2,
 			       SECCLASS_X_PROPERTY, &tsid) < 0) {
 	    ErrorF("SELinux: a compute_member call failed!\n");
-	    sidput(tsid2);
 	    return BadValue;
 	}
-	sidput(tsid2);
     }
 out:
     *sid_rtn = tsid;
@@ -438,9 +430,7 @@ SELinuxLabelClient(ClientPtr client)
     security_context_t ctx;
 
     subj = dixLookupPrivate(&client->devPrivates, subjectKey);
-    sidput(subj->sid);
     obj = dixLookupPrivate(&client->devPrivates, objectKey);
-    sidput(obj->sid);
 
     /* Try to get a context from the socket */
     if (fd < 0 || getpeercon_raw(fd, &ctx) < 0) {
@@ -484,7 +474,7 @@ finish:
 	FatalError("SELinux: client %d: context_to_sid_raw(%s) failed\n",
 		   client->index, ctx);
 
-    sidget(obj->sid = subj->sid);
+    obj->sid = subj->sid;
     freecon(ctx);
 }
 
@@ -505,7 +495,6 @@ SELinuxLabelInitial(void)
     subj = dixLookupPrivate(&serverClient->devPrivates, subjectKey);
     obj = dixLookupPrivate(&serverClient->devPrivates, objectKey);
     subj->privileged = 1;
-    sidput(subj->sid);
 
     /* Use the context of the X server process for the serverClient */
     if (getcon_raw(&ctx) < 0)
@@ -515,7 +504,7 @@ SELinuxLabelInitial(void)
     if (avc_context_to_sid_raw(ctx, &subj->sid) < 0)
 	FatalError("SELinux: serverClient: context_to_sid(%s) failed\n", ctx);
 
-    sidget(obj->sid = subj->sid);
+    obj->sid = subj->sid;
     freecon(ctx);
 
     srec.client = serverClient;
@@ -545,7 +534,7 @@ SELinuxLabelResource(XaceResourceAccessRec *rec, SELinuxSubjectRec *subj,
 
     /* Check for a create context */
     if (rec->rtype & RC_DRAWABLE && subj->win_create_sid) {
-	sidget(obj->sid = subj->win_create_sid);
+	obj->sid = subj->win_create_sid;
 	return Success;
     }
 
@@ -673,17 +662,14 @@ SELinuxDevice(CallbackListPtr *pcbl, pointer unused, pointer calldata)
 	SELinuxSubjectRec *dsubj;
 	dsubj = dixLookupPrivate(&rec->dev->devPrivates, subjectKey);
 
-	sidput(dsubj->sid);
-	sidput(obj->sid);
-
 	if (subj->dev_create_sid) {
 	    /* Label the device with the create context */
-	    sidget(obj->sid = subj->dev_create_sid);
-	    sidget(dsubj->sid = subj->dev_create_sid);
+	    obj->sid = subj->dev_create_sid;
+	    dsubj->sid = subj->dev_create_sid;
 	} else {
 	    /* Label the device directly with the process SID */
-	    sidget(obj->sid = subj->sid);
-	    sidget(dsubj->sid = subj->sid);
+	    obj->sid = subj->sid;
+	    dsubj->sid = subj->sid;
 	}
     }
 
@@ -807,8 +793,6 @@ SELinuxExtension(CallbackListPtr *pcbl, pointer unused, pointer calldata)
 	    return;
 	}
 
-	sidput(obj->sid);
-
 	/* Perform a transition to obtain the final SID */
 	if (avc_compute_create(serv->sid, sid, SECCLASS_X_EXTENSION,
 			       &obj->sid) < 0) {
@@ -846,7 +830,6 @@ SELinuxSelection(CallbackListPtr *pcbl, pointer unused, pointer calldata)
 
     /* If this is a new object that needs labeling, do it now */
     if (access_mode & DixCreateAccess) {
-	sidput(obj->sid);
 	rc = SELinuxSelectionToSID(name, subj, &obj->sid, &obj->poly);
 	if (rc != Success)
 	    obj->sid = unlabeled_sid;
@@ -864,7 +847,6 @@ SELinuxSelection(CallbackListPtr *pcbl, pointer unused, pointer calldata)
 		break;
 	    obj = dixLookupPrivate(&pSel->devPrivates, objectKey);
 	}
-	sidput(tsid);
 	
 	if (pSel)
 	    *rec->ppSel = pSel;
@@ -883,11 +865,10 @@ SELinuxSelection(CallbackListPtr *pcbl, pointer unused, pointer calldata)
     /* Label the content (advisory only) */
     if (access_mode & DixSetAttrAccess) {
 	data = dixLookupPrivate(&pSel->devPrivates, dataKey);
-	sidput(data->sid);
 	if (subj->sel_create_sid)
-	    sidget(data->sid = subj->sel_create_sid);
+	    data->sid = subj->sel_create_sid;
 	else
-	    sidget(data->sid = obj->sid);
+	    data->sid = obj->sid;
     }
 }
 
@@ -912,7 +893,6 @@ SELinuxProperty(CallbackListPtr *pcbl, pointer unused, pointer calldata)
 
     /* If this is a new object that needs labeling, do it now */
     if (rec->access_mode & DixCreateAccess) {
-	sidput(obj->sid);
 	rc = SELinuxPropertyToSID(name, subj, &obj->sid, &obj->poly);
 	if (rc != Success) {
 	    rec->status = rc;
@@ -931,7 +911,6 @@ SELinuxProperty(CallbackListPtr *pcbl, pointer unused, pointer calldata)
 		break;
 	    obj = dixLookupPrivate(&pProp->devPrivates, objectKey);
 	}
-	sidput(tsid);
 
 	if (pProp)
 	    *rec->ppProp = pProp;
@@ -950,11 +929,10 @@ SELinuxProperty(CallbackListPtr *pcbl, pointer unused, pointer calldata)
     /* Label the content (advisory only) */
     if (rec->access_mode & DixWriteAccess) {
 	data = dixLookupPrivate(&pProp->devPrivates, dataKey);
-	sidput(data->sid);
 	if (subj->prp_create_sid)
-	    sidget(data->sid = subj->prp_create_sid);
+	    data->sid = subj->prp_create_sid;
 	else
-	    sidget(data->sid = obj->sid);
+	    data->sid = obj->sid;
     }
 }
 
@@ -1031,8 +1009,6 @@ SELinuxScreen(CallbackListPtr *pcbl, pointer is_saver, pointer calldata)
 
     /* If this is a new object that needs labeling, do it now */
     if (access_mode & DixCreateAccess) {
-	sidput(obj->sid);
-
 	/* Perform a transition to obtain the final SID */
 	if (avc_compute_create(subj->sid, subj->sid, SECCLASS_X_SCREEN,
 			       &obj->sid) < 0) {
@@ -1164,7 +1140,6 @@ SELinuxSubjectInit(CallbackListPtr *pcbl, pointer unused, pointer calldata)
     PrivateCallbackRec *rec = calldata;
     SELinuxSubjectRec *subj = *rec->value;
 
-    sidget(unlabeled_sid);
     subj->sid = unlabeled_sid;
 
     avc_entry_ref_init(&subj->aeref);
@@ -1177,14 +1152,6 @@ SELinuxSubjectFree(CallbackListPtr *pcbl, pointer unused, pointer calldata)
     SELinuxSubjectRec *subj = *rec->value;
 
     xfree(subj->command);
-
-    if (avc_active) {
-	sidput(subj->sid);
-	sidput(subj->dev_create_sid);
-	sidput(subj->win_create_sid);
-	sidput(subj->sel_create_sid);
-	sidput(subj->prp_create_sid);
-    }
 }
 
 static void
@@ -1193,20 +1160,9 @@ SELinuxObjectInit(CallbackListPtr *pcbl, pointer unused, pointer calldata)
     PrivateCallbackRec *rec = calldata;
     SELinuxObjectRec *obj = *rec->value;
 
-    sidget(unlabeled_sid);
     obj->sid = unlabeled_sid;
 }
 
-static void
-SELinuxObjectFree(CallbackListPtr *pcbl, pointer unused, pointer calldata)
-{
-    PrivateCallbackRec *rec = calldata;
-    SELinuxObjectRec *obj = *rec->value;
-
-    if (avc_active)
-	sidput(obj->sid);
-}
-
 
 /*
  * Extension Dispatch
@@ -1310,7 +1266,6 @@ ProcSELinuxSetCreateContext(ClientPtr client, unsigned offset)
 
     ptr = dixLookupPrivate(privPtr, subjectKey);
     pSid = (security_id_t *)(ptr + offset);
-    sidput(*pSid);
     *pSid = NULL;
 
     rc = Success;
@@ -1371,11 +1326,9 @@ ProcSELinuxSetDeviceContext(ClientPtr client)
     }
 
     subj = dixLookupPrivate(&dev->devPrivates, subjectKey);
-    sidput(subj->sid);
     subj->sid = sid;
     obj = dixLookupPrivate(&dev->devPrivates, objectKey);
-    sidput(obj->sid);
-    sidget(obj->sid = sid);
+    obj->sid = sid;
 
     rc = Success;
 out:
@@ -1912,7 +1865,6 @@ SELinuxResetProc(ExtensionEntry *extEntry)
     RemoveGeneralSocket(netlink_fd);
 
     avc_destroy();
-    avc_active = 0;
 
     /* Free local state */
     xfree(knownAtoms);
@@ -1981,7 +1933,6 @@ SELinuxExtensionInit(INITARGS)
 
     if (avc_open(&avc_option, 1) < 0)
 	FatalError("SELinux: Couldn't initialize SELinux userspace AVC\n");
-    avc_active = 1;
 
     label_hnd = selabel_open(SELABEL_CTX_X, &selabel_option, 1);
     if (!label_hnd)
@@ -2021,9 +1972,7 @@ SELinuxExtensionInit(INITARGS)
     ret &= dixRegisterPrivateInitFunc(subjectKey, SELinuxSubjectInit, NULL);
     ret &= dixRegisterPrivateDeleteFunc(subjectKey, SELinuxSubjectFree, NULL);
     ret &= dixRegisterPrivateInitFunc(objectKey, SELinuxObjectInit, NULL);
-    ret &= dixRegisterPrivateDeleteFunc(objectKey, SELinuxObjectFree, NULL);
     ret &= dixRegisterPrivateInitFunc(dataKey, SELinuxObjectInit, NULL);
-    ret &= dixRegisterPrivateDeleteFunc(dataKey, SELinuxObjectFree, NULL);
 
     ret &= AddCallback(&ClientStateCallback, SELinuxClientState, NULL);
     ret &= AddCallback(&ResourceStateCallback, SELinuxResourceState, NULL);
commit c030ec32b6418e6258b380c0e29971be882a84d4
Author: Eamon Walsh <ewalsh at tycho.nsa.gov>
Date:   Wed Oct 21 19:28:26 2009 -0400

    libselinux now has a pkgconfig file.  Use it.
    
    Also remove HAVE_NETLINK_AVC_ACQUIRE_FD tests, because we now
    require a version of libselinux that has it.
    
    Signed-off-by: Eamon Walsh <ewalsh at tycho.nsa.gov>
    Reviewed-by: Keith Packard <keithp at keithp.com>

diff --git a/Xext/xselinux.c b/Xext/xselinux.c
index a047a00..60a18d1 100644
--- a/Xext/xselinux.c
+++ b/Xext/xselinux.c
@@ -1862,7 +1862,6 @@ SProcSELinuxDispatch(ClientPtr client)
     }
 }
 
-#ifdef HAVE_AVC_NETLINK_ACQUIRE_FD
 static int netlink_fd;
 
 static void
@@ -1876,7 +1875,6 @@ SELinuxWakeupHandler(void *data, int err, void *read_mask)
     if (FD_ISSET(netlink_fd, (fd_set *)read_mask))
         avc_netlink_check_nb();
 }
-#endif
 
 
 /*
@@ -1908,12 +1906,10 @@ SELinuxResetProc(ExtensionEntry *extEntry)
     label_hnd = NULL;
 
     audit_close(audit_fd);
-#ifdef HAVE_AVC_NETLINK_ACQUIRE_FD
     avc_netlink_release_fd();
     RemoveBlockAndWakeupHandlers(SELinuxBlockHandler, SELinuxWakeupHandler,
                                  NULL);
     RemoveGeneralSocket(netlink_fd);
-#endif
 
     avc_destroy();
     avc_active = 0;
@@ -2016,12 +2012,10 @@ SELinuxExtensionInit(INITARGS)
     if (atom_client_ctx == BAD_RESOURCE)
 	FatalError("SELinux: Failed to create atom\n");
 
-#ifdef HAVE_AVC_NETLINK_ACQUIRE_FD
     netlink_fd = avc_netlink_acquire_fd();
     AddGeneralSocket(netlink_fd);
     RegisterBlockAndWakeupHandlers(SELinuxBlockHandler, SELinuxWakeupHandler,
                                    NULL);
-#endif
 
     /* Register callbacks */
     ret &= dixRegisterPrivateInitFunc(subjectKey, SELinuxSubjectInit, NULL);
diff --git a/configure.ac b/configure.ac
index 8cb9048..558de87 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1012,16 +1012,11 @@ if test "x$XSELINUX" = xyes; then
 	if test "x$XACE" != xyes; then
 		AC_MSG_ERROR([cannot build SELinux extension without X-ACE])
 	fi
-	AC_CHECK_HEADERS([selinux/selinux.h selinux/avc.h], [], AC_MSG_ERROR([SELinux include files not found]))
-	AC_CHECK_LIB(selinux, avc_init, [], AC_MSG_ERROR([SELinux library not found])) 
 	AC_CHECK_HEADERS([libaudit.h], [], AC_MSG_ERROR([SELinux extension requires audit system headers]))
 	AC_CHECK_LIB(audit, audit_open, [], AC_MSG_ERROR([SELinux extension requires audit system library]))
-        AC_CHECK_DECL(avc_netlink_acquire_fd,
-                      [AC_DEFINE(HAVE_AVC_NETLINK_ACQUIRE_FD, 1, "Have avc_netlink_acquire_fd")],
-                      [],
-                      [#include <selinux/avc.h>])
+	PKG_CHECK_MODULES([SELINUX], [libselinux >= 2.0.86])
+	SELINUX_LIBS="$SELINUX_LIBS -laudit"
 	AC_DEFINE(XSELINUX, 1, [Build SELinux extension])
-	SELINUX_LIB="-lselinux -laudit"
 fi
 
 AM_CONDITIONAL(XCSECURITY, [test "x$XCSECURITY" = xyes])
@@ -1483,7 +1478,7 @@ if test "x$XORG" = xyes; then
 	AC_CHECK_FUNCS([pci_device_vgaarb_init])
 	LIBS=$SAVE_LIBS
 	CFLAGS=$SAVE_CFLAGS
-	XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $DLOPEN_LIBS $GLX_SYS_LIBS $SELINUX_LIB"
+	XORG_SYS_LIBS="$XORG_SYS_LIBS $PCIACCESS_LIBS $DLOPEN_LIBS $GLX_SYS_LIBS $SELINUX_LIBS"
 	XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
 
 	case $host_os in
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 798d9e7..6e450b6 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -431,6 +431,4 @@
 #include "dix-config-apple-verbatim.h"
 #endif
 
-#undef HAVE_AVC_NETLINK_ACQUIRE_FD
-
 #endif /* _DIX_CONFIG_H_ */
commit c8dd981c7f67d26850fad8c8a01f5de9850aa454
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu Feb 18 15:49:09 2010 +1000

    Xi: assume BadMode for non-BadMatch errors returned from SetDeviceMode.
    
    The XI protocol spec only allows for two errors on the SetDeviceMode
    requests: BadMatch or BadMode. BadMode however is a dynamically assigned
    extension error and the driver doesn't have access to the actual error
    number. Hence, if a SetDeviceMode driver returns an error other than
    BadMatch, assume BadMode.
    
    The two exceptions are BadAlloc and BadImplementations, pass these on to the
    client (any request is allowed to return either of those).
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit e40ba5798c367bec584f6437b23d2c5f801fd013)
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/setmode.c b/Xi/setmode.c
index 51e5767..ce2ad47 100644
--- a/Xi/setmode.c
+++ b/Xi/setmode.c
@@ -112,7 +112,17 @@ ProcXSetDeviceMode(ClientPtr client)
     if (rep.status == Success)
 	dev->valuator->mode = stuff->mode;
     else if (rep.status != AlreadyGrabbed)
+    {
+	switch(rep.status) {
+	    case BadMatch:
+	    case BadImplementation:
+	    case BadAlloc:
+		break;
+	    default:
+		rep.status = BadMode;
+	}
 	return rep.status;
+    }
 
     WriteReplyToClient(client, sizeof(xSetDeviceModeReply), &rep);
     return Success;
commit 5ac8298469cd4d5e56ef7fc41af4878b88706b28
Author: Chris Dekter <cdekter at gmail.com>
Date:   Thu Feb 11 16:34:09 2010 +1000

    Re-enable RECORD extension.
    
    RECORD was disabled during the switch to internal events. This patch
    modifies the record callback to work with internal events instead of
    xEvents. The InternalEvents are converted to core/Xi events as needed.
    
    Since record is a loadable extension, the EventTo* calls must be externed.
    
    Signed-off-by: Chris Dekter <cdekter at gmail.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 122fc0e7a0712df4ec2bd9ca6773f90bcd2095cf)
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index ee32ba8..a63b65b 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1051,16 +1051,19 @@ ProcessOtherEvent(InternalEvent *ev, DeviceIntPtr device)
             break;
     }
 
-#if 0
-    /* FIXME: I'm broken. Please fix me. Thanks */
     if (DeviceEventCallback) {
 	DeviceEventInfoRec eventinfo;
+	SpritePtr pSprite = device->spriteInfo->sprite;
 
-	eventinfo.events = (xEventPtr) xE;
-	eventinfo.count = count;
+	/* see comment in EnqueueEvents regarding the next three lines */
+	if (ev->any.type == ET_Motion)
+	    ev->device_event.root = WindowTable[pSprite->hotPhys.pScreen->myNum]->drawable.id;
+
+	eventinfo.device = device;
+	eventinfo.event = ev;
 	CallCallbacks(&DeviceEventCallback, (pointer) & eventinfo);
     }
-#endif
+
     grab = device->deviceGrab.grab;
 
     switch(event->type)
diff --git a/dix/events.c b/dix/events.c
index e24e0c5..4423c16 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -1131,11 +1131,10 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device)
         event->type == ET_KeyRelease)
 	AccessXCancelRepeatKey(device->key->xkbInfo, event->detail.key);
 
-#if 0
-        /* FIXME: I'm broken now. Please fix me. */
     if (DeviceEventCallback)
     {
 	DeviceEventInfoRec eventinfo;
+
 	/*  The RECORD spec says that the root window field of motion events
 	 *  must be valid.  At this point, it hasn't been filled in yet, so
 	 *  we do it here.  The long expression below is necessary to get
@@ -1145,14 +1144,14 @@ EnqueueEvent(InternalEvent *ev, DeviceIntPtr device)
 	 *  the data that GetCurrentRootWindow relies on hasn't been
 	 *  updated yet.
 	 */
-	if (xE->u.u.type == DeviceMotionNotify)
-	    XE_KBPTR.root =
-		WindowTable[pSprite->hotPhys.pScreen->myNum]->drawable.id;
-	eventinfo.events = xE;
-	eventinfo.count = nevents;
+	if (ev->any.type == ET_Motion)
+	    ev->device_event.root = WindowTable[pSprite->hotPhys.pScreen->myNum]->drawable.id;
+
+	eventinfo.event = ev;
+	eventinfo.device = device;
 	CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo);
     }
-#endif
+
     if (event->type == ET_Motion)
     {
 #ifdef PANORAMIX
diff --git a/include/dix.h b/include/dix.h
index 9fd2ed8..8bd52b6 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -581,8 +581,8 @@ typedef struct {
 extern _X_EXPORT CallbackListPtr DeviceEventCallback;
 
 typedef struct {
-    xEventPtr events;
-    int count;
+    InternalEvent *event;
+    DeviceIntPtr device;
 } DeviceEventInfoRec;
 
 extern int XItoCoreType(int xi_type);
@@ -590,7 +590,7 @@ extern Bool DevHasCursor(DeviceIntPtr pDev);
 extern Bool _X_EXPORT IsPointerDevice( DeviceIntPtr dev);
 extern Bool _X_EXPORT IsKeyboardDevice(DeviceIntPtr dev);
 extern Bool IsPointerEvent(InternalEvent *event);
-extern Bool IsMaster(DeviceIntPtr dev);
+extern _X_EXPORT Bool IsMaster(DeviceIntPtr dev);
 
 extern _X_HIDDEN void CopyKeyClass(DeviceIntPtr device, DeviceIntPtr master);
 extern _X_HIDDEN int CorePointerProc(DeviceIntPtr dev, int what);
diff --git a/include/eventconvert.h b/include/eventconvert.h
index 277a6c4..b1196a0 100644
--- a/include/eventconvert.h
+++ b/include/eventconvert.h
@@ -30,9 +30,9 @@
 
 #define FP1616(integral, frac) ((integral) * (1 << 16) + (frac) * (1 << 16))
 
-_X_INTERNAL int EventToCore(InternalEvent *event, xEvent *core);
-_X_INTERNAL int EventToXI(InternalEvent *ev, xEvent **xi, int *count);
-_X_INTERNAL int EventToXI2(InternalEvent *ev, xEvent **xi);
+_X_EXPORT int EventToCore(InternalEvent *event, xEvent *core);
+_X_EXPORT int EventToXI(InternalEvent *ev, xEvent **xi, int *count);
+_X_EXPORT int EventToXI2(InternalEvent *ev, xEvent **xi);
 _X_INTERNAL int GetCoreType(InternalEvent* ev);
 _X_INTERNAL int GetXIType(InternalEvent* ev);
 _X_INTERNAL int GetXI2Type(InternalEvent* ev);
diff --git a/record/record.c b/record/record.c
index b94b4ae..f092e34 100644
--- a/record/record.c
+++ b/record/record.c
@@ -42,6 +42,8 @@ and Jim Haggerty of Metheus.
 #include "set.h"
 #include "swaprep.h"
 #include "inputstr.h"
+#include "eventconvert.h"
+
 
 #include <stdio.h>
 #include <assert.h>
@@ -139,7 +141,8 @@ static int RecordDeleteContext(
     XID /*id*/
 );
 
-
+void RecordExtensionInit(void);
+
 /***************************************************************************/
 
 /* client private stuff */
@@ -727,6 +730,59 @@ RecordADeliveredEventOrError(CallbackListPtr *pcbl, pointer nulldata, pointer ca
 } /* RecordADeliveredEventOrError */
 
 
+static void
+RecordSendProtocolEvents(RecordClientsAndProtocolPtr pRCAP,
+			RecordContextPtr pContext,
+			xEvent* pev, int count)
+{
+    int ev; /* event index */
+
+    for (ev = 0; ev < count; ev++, pev++)
+    {
+	if (RecordIsMemberOfSet(pRCAP->pDeviceEventSet,
+		    pev->u.u.type & 0177))
+	{
+	    xEvent swappedEvent;
+	    xEvent *pEvToRecord = pev;
+#ifdef PANORAMIX
+	    xEvent shiftedEvent;
+
+	    if (!noPanoramiXExtension &&
+		    (pev->u.u.type == MotionNotify ||
+		     pev->u.u.type == ButtonPress ||
+		     pev->u.u.type == ButtonRelease ||
+		     pev->u.u.type == KeyPress ||
+		     pev->u.u.type == KeyRelease)) {
+		int scr = XineramaGetCursorScreen(inputInfo.pointer);
+		memcpy(&shiftedEvent, pev, sizeof(xEvent));
+		shiftedEvent.u.keyButtonPointer.rootX +=
+		    panoramiXdataPtr[scr].x -
+		    panoramiXdataPtr[0].x;
+		shiftedEvent.u.keyButtonPointer.rootY +=
+		    panoramiXdataPtr[scr].y -
+		    panoramiXdataPtr[0].y;
+		pEvToRecord = &shiftedEvent;
+	    }
+#endif /* PANORAMIX */
+
+	    if (pContext->pRecordingClient->swapped)
+	    {
+		(*EventSwapVector[pEvToRecord->u.u.type & 0177])
+		    (pEvToRecord, &swappedEvent);
+		pEvToRecord = &swappedEvent;
+	    }
+
+	    RecordAProtocolElement(pContext, NULL,
+		    XRecordFromServer,  pEvToRecord, SIZEOF(xEvent), 0);
+	    /* make sure device events get flushed in the absence
+	     * of other client activity
+	     */
+	    SetCriticalOutputPending();
+	}
+    } /* end for each event */
+
+} /* RecordADeviceEvent */
+
 /* RecordADeviceEvent
  *
  * Arguments:
@@ -756,55 +812,24 @@ RecordADeviceEvent(CallbackListPtr *pcbl, pointer nulldata, pointer calldata)
 	{
 	    if (pRCAP->pDeviceEventSet)
 	    {
-		int ev; /* event index */
-		xEvent *pev = pei->events;
-		for (ev = 0; ev < pei->count; ev++, pev++)
-		{
-		    if (RecordIsMemberOfSet(pRCAP->pDeviceEventSet,
-					    pev->u.u.type & 0177))
-		    {
-		        xEvent swappedEvent;
-		        xEvent *pEvToRecord = pev;
-#ifdef PANORAMIX
-		        xEvent shiftedEvent;
-
-			if (!noPanoramiXExtension &&
-			    (pev->u.u.type == MotionNotify ||
-			     pev->u.u.type == ButtonPress ||
-			     pev->u.u.type == ButtonRelease ||
-			     pev->u.u.type == KeyPress ||
-			     pev->u.u.type == KeyRelease)) {
-				int scr = XineramaGetCursorScreen(inputInfo.pointer);
-				memcpy(&shiftedEvent, pev, sizeof(xEvent));
-				shiftedEvent.u.keyButtonPointer.rootX +=
-				    panoramiXdataPtr[scr].x - 
-					panoramiXdataPtr[0].x;
-				shiftedEvent.u.keyButtonPointer.rootY +=
-				    panoramiXdataPtr[scr].y -
-					panoramiXdataPtr[0].y;
-				pEvToRecord = &shiftedEvent;
-			}
-#endif /* PANORAMIX */
+		int count;
+		xEvent *xi_events = NULL;
 
-			if (pContext->pRecordingClient->swapped)
-			{
-			    (*EventSwapVector[pEvToRecord->u.u.type & 0177])
-				(pEvToRecord, &swappedEvent);
-			    pEvToRecord = &swappedEvent;
-			}
+		/* TODO check return values */
+		if (IsMaster(pei->device))
+		{
+		    xEvent xE;
+		    EventToCore(pei->event, &xE);
+		    RecordSendProtocolEvents(pRCAP, pContext, &xE, 1);
+		}
 
-			RecordAProtocolElement(pContext, NULL,
-			   XRecordFromServer,  pEvToRecord, SIZEOF(xEvent), 0);
-			/* make sure device events get flushed in the absence
-			 * of other client activity
-			 */
-			SetCriticalOutputPending();
-		    }
-		} /* end for each event */
+		EventToXI(pei->event, &xi_events, &count);
+		RecordSendProtocolEvents(pRCAP, pContext, xi_events, count);
+		xfree(xi_events);
 	    } /* end this RCAP selects device events */
 	} /* end for each RCAP on this context */
     } /* end for each enabled context */
-} /* RecordADeviceEvent */
+}
 
 
 /* RecordFlushAllContexts
@@ -2866,13 +2891,6 @@ RecordCloseDown(ExtensionEntry *extEntry)
 void 
 RecordExtensionInit(void)
 {
-    /* FIXME Record is currently broken. Dont initialize it so that clients
-     * that require it can bail out correctly rather than waiting for stuff
-     * that'll never happen */
-    ErrorF("record: RECORD extension enabled at configure time.\n");
-    ErrorF("record: This extension is known to be broken, disabling extension now..\n");
-    ErrorF("record: http://bugs.freedesktop.org/show_bug.cgi?id=20500\n");
-#if 0
     ExtensionEntry *extentry;
 
     RTContext = CreateNewResourceType(RecordDeleteContext);
@@ -2895,6 +2913,5 @@ RecordExtensionInit(void)
     }
     RecordErrorBase = extentry->errorBase;
 
-#endif
 } /* RecordExtensionInit */
 
commit d1732a637e479f20a0edd1426c99d1c6f2027049
Author: Tiago Vignatti <tiago.vignatti at nokia.com>
Date:   Mon Jan 18 14:31:12 2010 +0200

    xfree86: vgaarb: remove useless debug
    
    This is RAC's remnant. Any sane person would use a more wise method of
    debugging instead.
    
    X.Org Bug 26074 <http://bugs.freedesktop.org/show_bug.cgi?id=26074>
    
    Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 5e81078cf56aabbf6551d96d312c7840ba9370ae)
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/xfree86/common/xf86VGAarbiter.c b/hw/xfree86/common/xf86VGAarbiter.c
index b240998..cd45cd1 100644
--- a/hw/xfree86/common/xf86VGAarbiter.c
+++ b/hw/xfree86/common/xf86VGAarbiter.c
@@ -38,14 +38,6 @@
 #include "xf86Priv.h"
 #include "pciaccess.h"
 
-#ifdef DEBUG
-#error "no, really, you dont want to do this"
-#define DPRINT_S(x,y) ErrorF(x ": %i\n",y);
-#define DPRINT(x) ErrorF(x "\n");
-#else
-#define DPRINT_S(x,y)
-#define DPRINT(x)
-#endif
 
 static GCFuncs VGAarbiterGCFuncs = {
     VGAarbiterValidateGC, VGAarbiterChangeGC, VGAarbiterCopyGC,
@@ -187,8 +179,6 @@ xf86VGAarbiterWrapFunctions(void)
         pScrn = xf86Screens[pScreen->myNum];
         PointPriv = dixLookupPrivate(&pScreen->devPrivates, miPointerScreenKey);
 
-        DPRINT_S("VGAarbiterWrapFunctions",pScreen->myNum);
-
         if (!dixRequestPrivate(VGAarbiterGCKey, sizeof(VGAarbiterGCRec)))
             return FALSE;
 
@@ -244,7 +234,6 @@ VGAarbiterCloseScreen (int i, ScreenPtr pScreen)
     PictureScreenPtr    ps = GetPictureScreenIfSet(pScreen);
 #endif
 
-    DPRINT_S("VGAarbiterCloseScreen",pScreen->myNum);
     UNWRAP_SCREEN(CreateGC);
     UNWRAP_SCREEN(CloseScreen);
     UNWRAP_SCREEN(GetImage);
@@ -311,7 +300,6 @@ VGAarbiterGetImage (
     )
 {
     ScreenPtr pScreen = pDrawable->pScreen;
-    DPRINT_S("VGAarbiterGetImage",pScreen->myNum);
     SCREEN_PROLOG(GetImage);
 //    if (xf86Screens[pScreen->myNum]->vtSema) {
     VGAGet();
@@ -334,7 +322,6 @@ VGAarbiterGetSpans (
 {
     ScreenPtr       pScreen = pDrawable->pScreen;
 
-    DPRINT_S("VGAarbiterGetSpans",pScreen->myNum);
     SCREEN_PROLOG (GetSpans);
     VGAGet();
     (*pScreen->GetSpans) (pDrawable, wMax, ppt, pwidth, nspans, pdstStart);
@@ -348,7 +335,6 @@ VGAarbiterSourceValidate (
     int x, int y, int width, int height )
 {
     ScreenPtr   pScreen = pDrawable->pScreen;
-    DPRINT_S("VGAarbiterSourceValidate",pScreen->myNum);
     SCREEN_PROLOG (SourceValidate);
     VGAGet();
     if (pScreen->SourceValidate)
@@ -365,7 +351,6 @@ VGAarbiterCopyWindow(
 {
     ScreenPtr pScreen = pWin->drawable.pScreen;
 
-    DPRINT_S("VGAarbiterCopyWindow",pScreen->myNum);
     SCREEN_PROLOG (CopyWindow);
     VGAGet();
     (*pScreen->CopyWindow) (pWin, ptOldOrg, prgnSrc);
@@ -382,7 +367,6 @@ VGAarbiterClearToBackground (
 {
     ScreenPtr pScreen = pWin->drawable.pScreen;
 
-    DPRINT_S("VGAarbiterClearToBackground",pScreen->myNum);
     SCREEN_PROLOG ( ClearToBackground);
     VGAGet();
     (*pScreen->ClearToBackground) (pWin, x, y, w, h, generateExposures);
@@ -395,7 +379,6 @@ VGAarbiterCreatePixmap(ScreenPtr pScreen, int w, int h, int depth, unsigned usag
 {
     PixmapPtr pPix;
 
-    DPRINT_S("VGAarbiterCreatePixmap",pScreen->myNum);
     SCREEN_PROLOG ( CreatePixmap);
     VGAGet();
     pPix = (*pScreen->CreatePixmap) (pScreen, w, h, depth, usage_hint);
@@ -410,7 +393,6 @@ VGAarbiterSaveScreen(ScreenPtr pScreen, Bool unblank)
 {
     Bool val;
 
-    DPRINT_S("VGAarbiterSaveScreen",pScreen->myNum);
     SCREEN_PROLOG (SaveScreen);
     VGAGet();
     val = (*pScreen->SaveScreen) (pScreen, unblank);
@@ -428,7 +410,6 @@ VGAarbiterStoreColors (
 {
     ScreenPtr pScreen = pmap->pScreen;
 
-    DPRINT_S("VGAarbiterStoreColors",pScreen->myNum);
     SCREEN_PROLOG (StoreColors);
     VGAGet();
     (*pScreen->StoreColors) (pmap,ndef,pdefs);
@@ -444,7 +425,6 @@ VGAarbiterRecolorCursor (
     Bool displayed
     )
 {
-    DPRINT_S("VGAarbiterRecolorCursor",pScreen->myNum);
     SCREEN_PROLOG (RecolorCursor);
     VGAGet();
     (*pScreen->RecolorCursor) (pDev, pScreen, pCurs, displayed);
@@ -461,7 +441,6 @@ VGAarbiterRealizeCursor (
 {
     Bool val;
 
-    DPRINT_S("VGAarbiterRealizeCursor",pScreen->myNum);
     SCREEN_PROLOG (RealizeCursor);
     VGAGet();
     val = (*pScreen->RealizeCursor) (pDev, pScreen,pCursor);
@@ -479,7 +458,6 @@ VGAarbiterUnrealizeCursor (
 {
     Bool val;
 
-    DPRINT_S("VGAarbiterUnrealizeCursor",pScreen->myNum);
     SCREEN_PROLOG (UnrealizeCursor);
     VGAGet();
     val = (*pScreen->UnrealizeCursor) (pDev, pScreen, pCursor);
@@ -497,7 +475,6 @@ VGAarbiterDisplayCursor (
 {
     Bool val;
 
-    DPRINT_S("VGAarbiterDisplayCursor",pScreen->myNum);
     SCREEN_PROLOG (DisplayCursor);
     VGAGet();
     val = (*pScreen->DisplayCursor) (pDev, pScreen, pCursor);
@@ -515,7 +492,6 @@ VGAarbiterSetCursorPosition (
 {
     Bool val;
 
-    DPRINT_S("VGAarbiterSetCursorPosition",pScreen->myNum);
     SCREEN_PROLOG (SetCursorPosition);
     VGAGet();
     val = (*pScreen->SetCursorPosition) (pDev, pScreen, x, y, generateEvent);
@@ -531,7 +507,6 @@ VGAarbiterAdjustFrame(int index, int x, int y, int flags)
     VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
         &pScreen->devPrivates, VGAarbiterScreenKey);
 
-    DPRINT_S("VGAarbiterAdjustFrame",index);
     VGAGet();
     (*pScreenPriv->AdjustFrame)(index, x, y, flags);
     VGAPut();
@@ -545,7 +520,6 @@ VGAarbiterSwitchMode(int index, DisplayModePtr mode, int flags)
     VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
         &pScreen->devPrivates, VGAarbiterScreenKey);
 
-    DPRINT_S("VGAarbiterSwitchMode",index);
     VGAGet();
     val = (*pScreenPriv->SwitchMode)(index, mode, flags);
     VGAPut();
@@ -560,7 +534,6 @@ VGAarbiterEnterVT(int index, int flags)
     VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
         &pScreen->devPrivates, VGAarbiterScreenKey);
 
-    DPRINT_S("VGAarbiterEnterVT",index);
     VGAGet();
     val = (*pScreenPriv->EnterVT)(index, flags);
     VGAPut();
@@ -574,8 +547,6 @@ VGAarbiterLeaveVT(int index, int flags)
     VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
         &pScreen->devPrivates, VGAarbiterScreenKey);
 
-    DPRINT_S("VGAarbiterLeaveVT",index);
-
     VGAGet();
     (*pScreenPriv->LeaveVT)(index, flags);
     VGAPut();
@@ -588,8 +559,6 @@ VGAarbiterFreeScreen(int index, int flags)
     VGAarbiterScreenPtr pScreenPriv = (VGAarbiterScreenPtr)dixLookupPrivate(
         &pScreen->devPrivates, VGAarbiterScreenKey);
 
-    DPRINT_S("VGAarbiterFreeScreen",index);
-
     VGAGet();
     (*pScreenPriv->FreeScreen)(index, flags);
     VGAPut();
@@ -602,7 +571,6 @@ VGAarbiterCreateGC(GCPtr pGC)
     VGAarbiterGCPtr pGCPriv = (VGAarbiterGCPtr)dixLookupPrivate(&pGC->devPrivates, VGAarbiterGCKey);
     Bool         ret;
 
-    DPRINT_S("VGAarbiterCreateGC",pScreen->myNum);
     SCREEN_PROLOG(CreateGC);
     VGAGet();
     ret = (*pScreen->CreateGC)(pGC);
@@ -621,7 +589,6 @@ VGAarbiterValidateGC(
    DrawablePtr   pDraw )
 {
     GC_UNWRAP(pGC);
-    DPRINT("VGAarbiterValidateGC");
     (*pGC->funcs->ValidateGC)(pGC, changes, pDraw);
     GC_WRAP(pGC);
 }
@@ -631,7 +598,6 @@ static void
 VGAarbiterDestroyGC(GCPtr pGC)
 {
     GC_UNWRAP (pGC);
-    DPRINT("VGAarbiterDestroyGC");
     (*pGC->funcs->DestroyGC)(pGC);
     GC_WRAP (pGC);
 }
@@ -642,7 +608,6 @@ VGAarbiterChangeGC (
     unsigned long   mask)
 {
     GC_UNWRAP (pGC);
-    DPRINT("VGAarbiterChangeGC");
     (*pGC->funcs->ChangeGC) (pGC, mask);
     GC_WRAP (pGC);
 }
@@ -654,7 +619,6 @@ VGAarbiterCopyGC (
     GCPtr       pGCDst)
 {
     GC_UNWRAP (pGCDst);
-    DPRINT("VGAarbiterCopyGC");
     (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
     GC_WRAP (pGCDst);
 }
@@ -667,7 +631,6 @@ VGAarbiterChangeClip (
     int     nrects )
 {
     GC_UNWRAP (pGC);
-    DPRINT("VGAarbiterChangeClip");
     (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
     GC_WRAP (pGC);
 }
@@ -676,7 +639,6 @@ static void
 VGAarbiterCopyClip(GCPtr pgcDst, GCPtr pgcSrc)
 {
     GC_UNWRAP (pgcDst);
-    DPRINT("VGAarbiterCopyClip");
     (* pgcDst->funcs->CopyClip)(pgcDst, pgcSrc);
     GC_WRAP (pgcDst);
 }
@@ -685,7 +647,6 @@ static void
 VGAarbiterDestroyClip(GCPtr pGC)
 {
     GC_UNWRAP (pGC);
-    DPRINT("VGAarbiterDestroyClip");
     (* pGC->funcs->DestroyClip)(pGC);
     GC_WRAP (pGC);
 }
@@ -701,7 +662,6 @@ VGAarbiterFillSpans(
     int fSorted )
 {
     GC_UNWRAP(pGC);
-    DPRINT("VGAarbiterFillSpans");
     VGAGet_GC();
     (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
     VGAPut_GC();
@@ -719,7 +679,6 @@ VGAarbiterSetSpans(
     int         fSorted )
 {
     GC_UNWRAP(pGC);
-    DPRINT("VGAarbiterSetSpans");
     VGAGet_GC();
     (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
     VGAPut_GC();
@@ -737,7 +696,6 @@ VGAarbiterPutImage(
     char    *pImage )
 {
     GC_UNWRAP(pGC);
-    DPRINT("VGAarbiterPutImage");
     VGAGet_GC();
     (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h,
               leftPad, format, pImage);
@@ -757,7 +715,6 @@ VGAarbiterCopyArea(
     RegionPtr ret;
 
     GC_UNWRAP(pGC);
-    DPRINT("VGAarbiterCopyArea");
     VGAGet_GC();
     ret = (*pGC->ops->CopyArea)(pSrc, pDst,
                 pGC, srcx, srcy, width, height, dstx, dsty);
@@ -779,7 +736,6 @@ VGAarbiterCopyPlane(
     RegionPtr ret;
 
     GC_UNWRAP(pGC);
-    DPRINT("VGAarbiterCopyPlane");
     VGAGet_GC();
     ret = (*pGC->ops->CopyPlane)(pSrc, pDst, pGC, srcx, srcy,
                  width, height, dstx, dsty, bitPlane);
@@ -797,7 +753,6 @@ VGAarbiterPolyPoint(
     xPoint *pptInit )
 {
     GC_UNWRAP(pGC);
-    DPRINT("VGAarbiterPolyPoint");
     VGAGet_GC();
     (*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit);
     VGAPut_GC();
@@ -814,7 +769,6 @@ VGAarbiterPolylines(
     DDXPointPtr pptInit )
 {
     GC_UNWRAP(pGC);
-    DPRINT("VGAarbiterPolylines");
     VGAGet_GC();
     (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
     VGAPut_GC();
@@ -829,7 +783,6 @@ VGAarbiterPolySegment(
     xSegment    *pSeg )
 {
     GC_UNWRAP(pGC);
-    DPRINT("VGAarbiterPolySegment");
     VGAGet_GC();
     (*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg);
     VGAPut_GC();
@@ -844,7 +797,6 @@ VGAarbiterPolyRectangle(
     xRectangle  *pRectsInit )
 {
     GC_UNWRAP(pGC);
-    DPRINT("VGAarbiterPolyRectangle");
     VGAGet_GC();
     (*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
     VGAPut_GC();
@@ -859,7 +811,6 @@ VGAarbiterPolyArc(
     xArc    *parcs )
 {
     GC_UNWRAP(pGC);
-    DPRINT("VGAarbiterPolyArc");
     VGAGet_GC();
     (*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs);
     VGAPut_GC();
@@ -876,7 +827,6 @@ VGAarbiterFillPolygon(
     DDXPointPtr ptsIn )
 {
     GC_UNWRAP(pGC);
-    DPRINT("VGAarbiterFillPolygon");
     VGAGet_GC();
     (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
     VGAPut_GC();
@@ -891,7 +841,6 @@ VGAarbiterPolyFillRect(
     xRectangle  *prectInit)
 {
     GC_UNWRAP(pGC);
-    DPRINT("VGAarbiterPolyFillRect");
     VGAGet_GC();
     (*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
     VGAPut_GC();
@@ -906,7 +855,6 @@ VGAarbiterPolyFillArc(
     xArc    *parcs )
 {
     GC_UNWRAP(pGC);
-    DPRINT("VGAarbiterPolyFillArc");
     VGAGet_GC();
     (*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs);
     VGAPut_GC();
@@ -925,7 +873,6 @@ VGAarbiterPolyText8(
     int ret;
 
     GC_UNWRAP(pGC);
-    DPRINT("VGAarbiterPolyText8");
     VGAGet_GC();
     ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
     VGAPut_GC();
@@ -945,7 +892,6 @@ VGAarbiterPolyText16(
     int ret;
 
     GC_UNWRAP(pGC);
-    DPRINT("VGAarbiterPolyText16");
     VGAGet_GC();
     ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
     VGAPut_GC();
@@ -963,7 +909,6 @@ VGAarbiterImageText8(
     char    *chars )
 {
     GC_UNWRAP(pGC);
-    DPRINT("VGAarbiterImageText8");
     VGAGet_GC();
     (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
     VGAPut_GC();
@@ -980,7 +925,6 @@ VGAarbiterImageText16(
     unsigned short *chars )
 {
     GC_UNWRAP(pGC);
-    DPRINT("VGAarbiterImageText16");
     VGAGet_GC();
     (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
     VGAPut_GC();
@@ -998,7 +942,6 @@ VGAarbiterImageGlyphBlt(
     pointer pglyphBase )
 {
     GC_UNWRAP(pGC);
-    DPRINT("VGAarbiterImageGlyphBlt");
     VGAGet_GC();
     (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit,
                    nglyph, ppci, pglyphBase);
@@ -1016,7 +959,6 @@ VGAarbiterPolyGlyphBlt(
     pointer pglyphBase )
 {
     GC_UNWRAP(pGC);
-    DPRINT("VGAarbiterPolyGlyphBlt");
     VGAGet_GC();
     (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit,
                   nglyph, ppci, pglyphBase);
@@ -1032,7 +974,6 @@ VGAarbiterPushPixels(
     int dx, int dy, int xOrg, int yOrg )
 {
     GC_UNWRAP(pGC);
-    DPRINT("VGAarbiterPushPixels");
     VGAGet_GC();
     (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
     VGAPut_GC();
@@ -1046,7 +987,6 @@ VGAarbiterSpriteRealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pC
 {
     Bool val;
     SPRITE_PROLOG;
-    DPRINT_S("VGAarbiterSpriteRealizeCursor",pScreen->myNum);
     VGAGet();
     val = PointPriv->spriteFuncs->RealizeCursor(pDev, pScreen, pCur);
     VGAPut();
@@ -1059,7 +999,6 @@ VGAarbiterSpriteUnrealizeCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr
 {
     Bool val;
     SPRITE_PROLOG;
-    DPRINT_S("VGAarbiterSpriteUnrealizeCursor",pScreen->myNum);
     VGAGet();
     val = PointPriv->spriteFuncs->UnrealizeCursor(pDev, pScreen, pCur);
     VGAPut();
@@ -1071,7 +1010,6 @@ static void
 VGAarbiterSpriteSetCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCur, int x, int y)
 {
     SPRITE_PROLOG;
-    DPRINT_S("VGAarbiterSpriteSetCursor",pScreen->myNum);
     VGAGet();
     PointPriv->spriteFuncs->SetCursor(pDev, pScreen, pCur, x, y);
     VGAPut();
@@ -1082,7 +1020,6 @@ static void
 VGAarbiterSpriteMoveCursor(DeviceIntPtr pDev, ScreenPtr pScreen, int x, int y)
 {
     SPRITE_PROLOG;
-    DPRINT_S("VGAarbiterSpriteMoveCursor",pScreen->myNum);
     VGAGet();
     PointPriv->spriteFuncs->MoveCursor(pDev, pScreen, x, y);
     VGAPut();
@@ -1094,7 +1031,6 @@ VGAarbiterDeviceCursorInitialize(DeviceIntPtr pDev, ScreenPtr pScreen)
 {
     Bool val;
     SPRITE_PROLOG;
-    DPRINT_S("VGAarbiterDeviceCursorInitialize",pScreen->myNum);
     VGAGet();
     val = PointPriv->spriteFuncs->DeviceCursorInitialize(pDev, pScreen);
     VGAPut();
@@ -1106,7 +1042,6 @@ static void
 VGAarbiterDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
 {
     SPRITE_PROLOG;
-    DPRINT_S("VGAarbiterDeviceCursorCleanup",pScreen->myNum);
     VGAGet();
     PointPriv->spriteFuncs->DeviceCursorCleanup(pDev, pScreen);
     VGAPut();
commit dd0217fc93c1d374d7d51f1b0270e7575fd48320
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Jan 5 13:15:25 2010 +1000

    dix: don't update the slave coordinates from the VCK.
    
    A keyboard event from a device with both valuators and keys will be posted
    through the VCK. In this case, do not update the slave device coordinates
    from the VCK - they're always 0/0. Leave them as-is, for the next pointer
    event will continue where it left.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 6f265d55a61f9be323583b8acacae783be72bda9)
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/getevents.c b/dix/getevents.c
index 18c6302..82bb77b 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -630,9 +630,12 @@ updateFromMaster(EventListPtr events, DeviceIntPtr dev, int type, int *num_event
     if (master && master->last.slave != dev)
     {
         CreateClassesChangedEvent(events, master, dev, type);
-        updateSlaveDeviceCoords(master, dev);
+        if (IsPointerDevice(master))
+        {
+            updateSlaveDeviceCoords(master, dev);
+            master->last.numValuators = dev->last.numValuators;
+        }
         master->last.slave = dev;
-        master->last.numValuators = dev->last.numValuators;
         (*num_events)++;
         events++;
     }
commit 8dda9ba67ab530612cdc27c540a88a1465a82173
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Mon Feb 15 16:46:21 2010 -0800

    XQuartz: Fix a possible buffer overrun in quartzAudio
    
    Also dropped deprecated API while there
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    (cherry picked from commit 4e8bf12b13690afa6d9fee0e339d3819ef16fb3f)

diff --git a/hw/xquartz/quartzAudio.c b/hw/xquartz/quartzAudio.c
index e4b49fc..708202b 100644
--- a/hw/xquartz/quartzAudio.c
+++ b/hw/xquartz/quartzAudio.c
@@ -62,7 +62,6 @@ typedef struct QuartzAudioRec {
     UInt32 curFrame;
     UInt32 remainingFrames;
     UInt32 totalFrames;
-    UInt32 bytesPerFrame;
     double sampleRate;
     UInt32 fadeLength;
 
@@ -117,9 +116,9 @@ static void QuartzFillBuffer(
     unsigned int bufferFrameCount;
     float multiplier, v;
     int i;
-
+    
     buffer = (float *)audiobuffer->mData;
-    bufferFrameCount = audiobuffer->mDataByteSize / data->bytesPerFrame;
+    bufferFrameCount = audiobuffer->mDataByteSize / (sizeof(float) * audiobuffer->mNumberChannels);
 
     frameCount = min(bufferFrameCount, data->remainingFrames);
 
@@ -141,7 +140,7 @@ static void QuartzFillBuffer(
         data->prevFrame = 0;
 
         // adjust for space eaten by prev fade
-        buffer += audiobuffer->mNumberChannels*frame;
+        b += audiobuffer->mNumberChannels*frame;
         bufferFrameCount -= frame;
         frameCount = min(bufferFrameCount, data->remainingFrames);
     }
@@ -204,7 +203,8 @@ QuartzAudioIOProc(
     if (wasPlaying  &&  !data->playing) {
         OSStatus err;
         err = AudioDeviceStop(inDevice, QuartzAudioIOProc);
-        fprintf(stderr, "Error stopping audio device: %ld\n", (long int)err);
+        if(err != noErr)
+            fprintf(stderr, "Error stopping audio device: %ld\n", (long int)err);
     }
     pthread_mutex_unlock(&data->lock);
     return 0;
@@ -263,16 +263,17 @@ void QuartzAudioInit(void)
     UInt32 propertySize;
     OSStatus status;
     AudioDeviceID outputDevice;
-    AudioStreamBasicDescription outputStreamDescription;
     double sampleRate;
-
+    AudioObjectPropertyAddress devicePropertyAddress = { kAudioHardwarePropertyDefaultOutputDevice, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };
+    AudioObjectPropertyAddress sampleRatePropertyAddress = { kAudioDevicePropertyNominalSampleRate, kAudioDevicePropertyScopeOutput, kAudioObjectPropertyElementMaster };
+    
     // Get the default output device
     propertySize = sizeof(outputDevice);
-    status = AudioHardwareGetProperty(
-                    kAudioHardwarePropertyDefaultOutputDevice, 
-                    &propertySize, &outputDevice);
+    status = AudioObjectGetPropertyData(kAudioObjectSystemObject, &devicePropertyAddress,
+                                        0, NULL,
+                                        &propertySize, &outputDevice);
     if (status) {
-        ErrorF("QuartzAudioInit: AudioHardwareGetProperty returned %ld\n",
+        ErrorF("QuartzAudioInit: AudioObjectGetPropertyData(output device) returned %ld\n",
                (long)status);
         return;
     }
@@ -282,23 +283,22 @@ void QuartzAudioInit(void)
     }
 
     // Get the basic device description
-    propertySize = sizeof(outputStreamDescription);
-    status = AudioDeviceGetProperty(outputDevice, 0, FALSE, 
-                                    kAudioDevicePropertyStreamFormat, 
-                                    &propertySize, &outputStreamDescription);
+    sampleRate = 0.;
+    propertySize = sizeof(sampleRate);
+    status = AudioObjectGetPropertyData(outputDevice, &sampleRatePropertyAddress,
+                                        0, NULL,
+                                        &propertySize, &sampleRate);
     if (status) {
-        ErrorF("QuartzAudioInit: GetProperty(stream format) returned %ld\n",
+        ErrorF("QuartzAudioInit: AudioObjectGetPropertyData(sample rate) returned %ld\n",
                (long)status);
         return;
     }
-    sampleRate = outputStreamDescription.mSampleRate;
 
     // Fill in the playback data
     data.frequency = 0;
     data.amplitude = 0;
     data.curFrame = 0;
     data.remainingFrames = 0; 
-    data.bytesPerFrame = outputStreamDescription.mBytesPerFrame;
     data.sampleRate = sampleRate;
     // data.bufferByteCount = bufferByteCount;
     data.playing = FALSE;
commit 4d8ad88b5747789b0c35bccab1088114470984cd
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Wed Feb 10 17:56:30 2010 -0800

    XQuartz: clang static analysis fixes
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    (cherry picked from commit 4127e8e5be5c366eb752bbb8d7f0ff5b519e641b)

diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c
index 1762825..44380ff 100644
--- a/hw/xquartz/GL/indirect.c
+++ b/hw/xquartz/GL/indirect.c
@@ -548,7 +548,7 @@ static CGLPixelFormatObj makeFormat(__GLXconfig *conf) {
        attr[i++] = conf->samples;
     }
      
-    attr[i++] = 0;
+    attr[i + 1] = 0;
 
     error = CGLChoosePixelFormat(attr, &fobj, &formats);
     if(error) {
diff --git a/hw/xquartz/GL/visualConfigs.c b/hw/xquartz/GL/visualConfigs.c
index f926778..bef27f0 100644
--- a/hw/xquartz/GL/visualConfigs.c
+++ b/hw/xquartz/GL/visualConfigs.c
@@ -62,7 +62,7 @@ __GLXconfig *__glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber)
     int numConfigs = 0;
     __GLXconfig *visualConfigs, *c;
     struct glCapabilities caps;
-    struct glCapabilitiesConfig *conf = NULL;
+    struct glCapabilitiesConfig *conf;
     int stereo, depth, aux, buffers, stencil, accum, color, msample;
     
     if(getGlCapabilities(&caps)) {
@@ -94,7 +94,6 @@ __GLXconfig *__glXAquaCreateVisualConfigs(int *numConfigsPtr, int screenNumber)
      */
     
     assert(NULL != caps.configurations);
-    conf = caps.configurations;
     
     numConfigs = 0;
     
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index f3c8a30..3faa1cb 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -482,7 +482,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
 	return out;
 }
 
-- (CFPropertyListRef) prefs_get:(NSString *)key {
+- (CFPropertyListRef) prefs_get_copy:(NSString *)key {
     CFPropertyListRef value;
 	
     value = CFPreferencesCopyAppValue ((CFStringRef) key, app_prefs_domain_cfstr);
@@ -543,7 +543,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
   CFPropertyListRef value;
   int ret;
   
-  value = [self prefs_get:key];
+  value = [self prefs_get_copy:key];
   
   if (value != NULL && CFGetTypeID (value) == CFNumberGetTypeID ())
     CFNumberGetValue (value, kCFNumberIntType, &ret);
@@ -561,7 +561,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
   CFPropertyListRef value;
   const char *ret = NULL;
   
-  value = [self prefs_get:key];
+  value = [self prefs_get_copy:key];
   
   if (value != NULL && CFGetTypeID (value) == CFStringGetTypeID ()) {
     NSString *s = (NSString *) value;
@@ -578,12 +578,13 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
     CFPropertyListRef value;
     NSURL *ret = NULL;
     
-    value = [self prefs_get:key];
+    value = [self prefs_get_copy:key];
     
     if (value != NULL && CFGetTypeID (value) == CFStringGetTypeID ()) {
         NSString *s = (NSString *) value;
 
         ret = [NSURL URLWithString:s];
+        [ret retain];
     }
     
     if (value != NULL) CFRelease (value);
@@ -595,7 +596,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
   CFPropertyListRef value;
   float ret = def;
   
-  value = [self prefs_get:key];
+  value = [self prefs_get_copy:key];
   
   if (value != NULL
       && CFGetTypeID (value) == CFNumberGetTypeID ()
@@ -613,7 +614,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
   CFPropertyListRef value;
   int ret = def;
   
-  value = [self prefs_get:key];
+  value = [self prefs_get_copy:key];
   
   if (value != NULL) {
     if (CFGetTypeID (value) == CFNumberGetTypeID ())
@@ -637,7 +638,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
   NSArray *ret = nil;
   CFPropertyListRef value;
   
-  value = [self prefs_get:key];
+  value = [self prefs_get_copy:key];
   
   if (value != NULL) {
     if (CFGetTypeID (value) == CFArrayGetTypeID ())
@@ -757,7 +758,7 @@ static NSMutableArray * cfarray_to_nsarray (CFArrayRef in) {
     NSURL *url =  [self prefs_copy_url:@PREFS_UPDATE_FEED default:nil];
     if(url) {
         [[SUUpdater sharedUpdater] setFeedURL:url];
-        CFRelease(url);
+        [url release];
     }
 #endif
 }
@@ -970,6 +971,7 @@ void X11ApplicationMain (int argc, char **argv, char **envp) {
 //    [[SUUpdater sharedUpdater] checkForUpdates:X11App];
 #endif
 
+    [pool release];
     [NSApp run];
     /* not reached */
 }
diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c
index 0366f3b..4872ff5 100644
--- a/hw/xquartz/mach-startup/bundle-main.c
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -641,30 +641,46 @@ static int execute(const char *command) {
 static char *command_from_prefs(const char *key, const char *default_value) {
     char *command = NULL;
     
-    CFStringRef cfKey = CFStringCreateWithCString(NULL, key, kCFStringEncodingASCII);
-    CFPropertyListRef PlistRef = CFPreferencesCopyAppValue(cfKey, kCFPreferencesCurrentApplication);
+    CFStringRef cfKey;
+    CFPropertyListRef PlistRef;
+
+    if(!key)
+        return NULL;
+
+    cfKey = CFStringCreateWithCString(NULL, key, kCFStringEncodingASCII);
+
+    if(!cfKey)
+        return NULL;
+
+    PlistRef = CFPreferencesCopyAppValue(cfKey, kCFPreferencesCurrentApplication);
     
     if ((PlistRef == NULL) || (CFGetTypeID(PlistRef) != CFStringGetTypeID())) {
         CFStringRef cfDefaultValue = CFStringCreateWithCString(NULL, default_value, kCFStringEncodingASCII);
         int len = strlen(default_value) + 1;
 
+        if(!cfDefaultValue)
+            goto command_from_prefs_out;
+
         CFPreferencesSetAppValue(cfKey, cfDefaultValue, kCFPreferencesCurrentApplication);
         CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication);
+        CFRelease(cfDefaultValue);
         
         command = (char *)malloc(len * sizeof(char));
         if(!command)
-            return NULL;
+            goto command_from_prefs_out;
         strcpy(command, default_value);
     } else {
         int len = CFStringGetLength((CFStringRef)PlistRef) + 1;
         command = (char *)malloc(len * sizeof(char));
         if(!command)
-            return NULL;
+            goto command_from_prefs_out;
         CFStringGetCString((CFStringRef)PlistRef, command, len,  kCFStringEncodingASCII);
-	}
-    
+    }
+
+command_from_prefs_out:
     if (PlistRef)
         CFRelease(PlistRef);
-    
+    if(cfKey)
+        CFRelease(cfKey);
     return command;
 }
diff --git a/hw/xquartz/mach-startup/stub.c b/hw/xquartz/mach-startup/stub.c
index af1c59e..8b1c832 100644
--- a/hw/xquartz/mach-startup/stub.c
+++ b/hw/xquartz/mach-startup/stub.c
@@ -73,7 +73,6 @@ static void set_x11_path(void) {
 #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
 
     CFURLRef appURL = NULL;
-    CFBundleRef bundle = NULL;
     OSStatus osstatus = LSFindApplicationForInfo(kLSUnknownCreator, CFSTR(kX11AppBundleId), nil, nil, &appURL);
 
     switch (osstatus) {
@@ -84,12 +83,6 @@ static void set_x11_path(void) {
                 exit(1);
             }
 
-            bundle = CFBundleCreate(NULL, appURL);
-            if(!bundle) {
-                fprintf(stderr, "Xquartz: Null value returned from CFBundleCreate().\n");
-                exit(2);                
-            }
-
             if (!CFURLGetFileSystemRepresentation(appURL, true, (unsigned char *)x11_path, sizeof(x11_path))) {
                 fprintf(stderr, "Xquartz: Error resolving URL for %s\n", kX11AppBundleId);
                 exit(3);
diff --git a/hw/xquartz/pbproxy/x-selection.h b/hw/xquartz/pbproxy/x-selection.h
index fc903d0..614c8b0 100644
--- a/hw/xquartz/pbproxy/x-selection.h
+++ b/hw/xquartz/pbproxy/x-selection.h
@@ -58,15 +58,6 @@ struct atom_list {
     /* The unmapped window we use for fetching selections. */
     Window _selection_window;
 
-    /* Last time we declared anything on the pasteboard. */
-    int _my_last_change;
-
-    /* Name of the selection we're proxying onto the pasteboard. */
-    Atom _proxied_selection;
-
-    /* When true, we're expecting a SelectionNotify event. */
-    unsigned int _pending_notify :1;
- 
     Atom request_atom;
     
     struct {
diff --git a/hw/xquartz/quartzAudio.c b/hw/xquartz/quartzAudio.c
index af63d18..e4b49fc 100644
--- a/hw/xquartz/quartzAudio.c
+++ b/hw/xquartz/quartzAudio.c
@@ -204,6 +204,7 @@ QuartzAudioIOProc(
     if (wasPlaying  &&  !data->playing) {
         OSStatus err;
         err = AudioDeviceStop(inDevice, QuartzAudioIOProc);
+        fprintf(stderr, "Error stopping audio device: %ld\n", (long int)err);
     }
     pthread_mutex_unlock(&data->lock);
     return 0;
diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index 96b5fa5..3b4eac3 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -368,7 +368,7 @@ void DarwinKeyboardReloadHandler(void) {
     KeySymsRec keySyms;
     CFIndex initialKeyRepeatValue, keyRepeatValue;
     BOOL ok;
-    DeviceIntPtr pDev = darwinKeyboard;
+    DeviceIntPtr pDev;
     const char *xmodmap = PROJECTROOT "/bin/xmodmap";
     const char *sysmodmap = PROJECTROOT "/lib/X11/xinit/.Xmodmap";
     const char *homedir = getenv("HOME");
commit f0ec2e0d7d0533b3b3fcccd9d78b76e4c9002d1e
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Tue Feb 16 11:34:38 2010 +1000

    xserver 1.7.5
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/configure.ac b/configure.ac
index fc7ff05..8cb9048 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.7.4.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2010-02-05"
+AC_INIT([xorg-server], 1.7.5, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2010-02-16"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([dist-bzip2 foreign])
 AM_MAINTAINER_MODE
commit 15e9a3fc0c4776f3ff02a59375e61d9090e35a22
Author: Julien Cristau <jcristau at debian.org>
Date:   Fri Feb 12 23:34:57 2010 +0100

    dix: restore lastDeviceEventTime update in dixSaveScreens
    
    This was removed in 6b5978dcf1f7ac3ecc2f22df06f7000f360e2066 (Do not
    reset lastDeviceEventTime when we do dixSaveScreens), but caused a
    regression for XResetScreenSaver.  Add the lastDeviceEventTime update
    back, but restrict it to that case.
    
    X.Org bug#25855 <http://bugs.freedesktop.org/25855>
    
    Reported-by: Lubos Lunak <l.lunak at suse.cz>
    Tested-by: Lubos Lunak <l.lunak at suse.cz>
    Signed-off-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 001ce71dc11287dc94cc2fbc5d35677c046e6c04)
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/window.c b/dix/window.c
index caff1cb..2676a54 100644
--- a/dix/window.c
+++ b/dix/window.c
@@ -3233,8 +3233,13 @@ dixSaveScreens(ClientPtr client, int on, int mode)
 	}
     }
     screenIsSaved = what;
-    if (mode == ScreenSaverReset)
-       SetScreenSaverTimer();
+    if (mode == ScreenSaverReset) {
+	if (on == SCREEN_SAVER_FORCER) {
+	    UpdateCurrentTimeIf();
+	    lastDeviceEventTime = currentTime;
+	}
+	SetScreenSaverTimer();
+    }
     return Success;
 }
 
commit 38a83dce236da44856c075b5589d38ef0a662d4b
Author: Peter Harris <pharris at opentext.com>
Date:   Fri Feb 12 15:36:30 2010 -0500

    Don't double-swap the RandR PropertyNotify event
    
    The event is already swapped in randr.c/SRROutputPropertyNotifyEvent, so
    it should not be swapped here.
    
    X.Org Bugzilla #26511: http://bugs.freedesktop.org/show_bug.cgi?id=26511
    
    Tested-by: Leonardo Chiquitto <leonardo at ngdn.org>
    Acked-by: Adam Jackson <ajax at redhat.com>
    Reviewed-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Peter Harris <pharris at opentext.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 97b03037f4d99fcebc7603011f41c3aff9871ce2)
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/randr/rrproperty.c b/randr/rrproperty.c
index 146facb..12e30e4 100644
--- a/randr/rrproperty.c
+++ b/randr/rrproperty.c
@@ -47,11 +47,6 @@ DeliverPropertyEvent(WindowPtr pWin, void *value)
 
 	event->sequenceNumber = client->sequence;
 	event->window = pRREvent->window->drawable.id;
-	if (client->swapped) {
-	    int n;
-	    swaps(&event->sequenceNumber, n);
-	    swapl(&event->window, n);
-	}
 	WriteEventsToClient(pRREvent->client, 1, (xEvent *)event);
     }
 
commit 829980a4ff36b46745cf958824338b6341302c7b
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Jan 13 15:03:45 2010 +1000

    Xi: reset the sli pointers after copying device classes. (#25640)
    
    If the indicator flags have the XkbSLI_IsDefault bit set, the indicator map
    and names aren't their own bit of memory but rather point into the
    device->key->xkbInfo->desc structure. XkbCopySrvLedInfo knows about this and
    leaves the pointers alone.
    
    When copying the classes from the slave to the master, these pointers are
    copied and still point to the dev->key class of the slave device. If the
    slave device is removed, the memory becomes invalid and a call to modify
    this data (e.g. XkbSetIndicators) may cause a deadlock.
    
    The copying of dev->key relies on dev->kbdfeed to be already set up. Hence
    the pointers need to be reset once _both_ kbdfeed and key have been copied
    into the master device.
    
    X.Org Bug 25640 <http://bugs.freedesktop.org/show_bug.cgi?id=25640>
    Fedora Bug 540584 <https://bugzilla.redhat.com/show_bug.cgi?id=540584>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 48f7298657f91843db36566b8d66d6c4c18dbd4c)
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index cb2452b..ee32ba8 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -444,6 +444,26 @@ DeepCopyKeyboardClasses(DeviceIntPtr from, DeviceIntPtr to)
         to->key      = NULL;
     }
 
+    /* If a SrvLedInfoPtr's flags are XkbSLI_IsDefault, the names and maps
+     * pointer point into the xkbInfo->desc struct.  XkbCopySrvLedInfo
+     * didn't update the pointers so we need to do it manually here.
+     */
+    if (to->kbdfeed)
+    {
+        KbdFeedbackPtr k;
+
+        for (k = to->kbdfeed; k; k = k->next)
+        {
+            if (!k->xkb_sli)
+                continue;
+            if (k->xkb_sli->flags & XkbSLI_IsDefault)
+            {
+                k->xkb_sli->names = to->key->xkbInfo->desc->names->indicators;
+                k->xkb_sli->maps = to->key->xkbInfo->desc->indicators->maps;
+            }
+        }
+    }
+
     /* We can't just copy over the focus class. When an app sets the focus,
      * it'll do so on the master device. Copying the SDs focus means losing
      * the focus.
commit 34cedd1e3d80cc84277662a94de797738bdb5fce
Author: Robert Morell <rmorell at nvidia.com>
Date:   Fri Jan 29 19:07:03 2010 -0800

    RENDER: Fix gradient and solid fill pictures with Xinerama, and misc cleanup
    
    If these aren't wrapped, then procs that are wrapped (such as
    RenderChangePicture) will fail in Xinerama when they see the resource
    type of a picture created through one of these interfaces is PictureType
    and not XRT_PICTURE like those allocated via RenderCreatePicture.
    
    Signed-off-by: Robert Morell <rmorell at nvidia.com>
    Reviewed-by: Aaron Plattner <aplattner at nvidia.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 4d575b0559817258f7a0ce6c4d2d0f9e7e5bba63)

diff --git a/render/render.c b/render/render.c
index 10554ad..3f7edf7 100644
--- a/render/render.c
+++ b/render/render.c
@@ -3235,6 +3235,138 @@ PanoramiXRenderAddTraps (ClientPtr client)
     return result;
 }
 
+static int
+PanoramiXRenderCreateSolidFill (ClientPtr client)
+{
+    REQUEST(xRenderCreateSolidFillReq);
+    PanoramiXRes    *newPict;
+    int		    result = Success, j;
+
+    REQUEST_AT_LEAST_SIZE(xRenderCreateSolidFillReq);
+
+    if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+	return BadAlloc;
+
+    newPict->type = XRT_PICTURE;
+    newPict->info[0].id = stuff->pid;
+    newPict->u.pict.root = FALSE;
+
+    for(j = 1; j < PanoramiXNumScreens; j++)
+	newPict->info[j].id = FakeClientID(client->index);
+	
+    FOR_NSCREENS_BACKWARD(j) {
+	stuff->pid = newPict->info[j].id;
+	result = (*PanoramiXSaveRenderVector[X_RenderCreateSolidFill]) (client);
+	if(result != Success) break;
+    }
+
+    if (result == Success)
+	AddResource(newPict->info[0].id, XRT_PICTURE, newPict);
+    else
+	xfree(newPict);
+
+    return result;
+}
+
+static int
+PanoramiXRenderCreateLinearGradient (ClientPtr client)
+{
+    REQUEST(xRenderCreateLinearGradientReq);
+    PanoramiXRes    *newPict;
+    int		    result = Success, j;
+
+    REQUEST_AT_LEAST_SIZE(xRenderCreateLinearGradientReq);
+
+    if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+	return BadAlloc;
+
+    newPict->type = XRT_PICTURE;
+    newPict->info[0].id = stuff->pid;
+    newPict->u.pict.root = FALSE;
+
+    for(j = 1; j < PanoramiXNumScreens; j++)
+	newPict->info[j].id = FakeClientID(client->index);
+
+    FOR_NSCREENS_BACKWARD(j) {
+	stuff->pid = newPict->info[j].id;
+	result = (*PanoramiXSaveRenderVector[X_RenderCreateLinearGradient]) (client);
+	if(result != Success) break;
+    }
+
+    if (result == Success)
+	AddResource(newPict->info[0].id, XRT_PICTURE, newPict);
+    else
+	xfree(newPict);
+
+    return result;
+}
+
+static int
+PanoramiXRenderCreateRadialGradient (ClientPtr client)
+{
+    REQUEST(xRenderCreateRadialGradientReq);
+    PanoramiXRes    *newPict;
+    int		    result = Success, j;
+
+    REQUEST_AT_LEAST_SIZE(xRenderCreateRadialGradientReq);
+
+    if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+	return BadAlloc;
+
+    newPict->type = XRT_PICTURE;
+    newPict->info[0].id = stuff->pid;
+    newPict->u.pict.root = FALSE;
+
+    for(j = 1; j < PanoramiXNumScreens; j++)
+	newPict->info[j].id = FakeClientID(client->index);
+
+    FOR_NSCREENS_BACKWARD(j) {
+	stuff->pid = newPict->info[j].id;
+	result = (*PanoramiXSaveRenderVector[X_RenderCreateRadialGradient]) (client);
+	if(result != Success) break;
+    }
+
+    if (result == Success)
+	AddResource(newPict->info[0].id, XRT_PICTURE, newPict);
+    else
+	xfree(newPict);
+
+    return result;
+}
+
+static int
+PanoramiXRenderCreateConicalGradient (ClientPtr client)
+{
+    REQUEST(xRenderCreateConicalGradientReq);
+    PanoramiXRes    *newPict;
+    int		    result = Success, j;
+
+    REQUEST_AT_LEAST_SIZE(xRenderCreateConicalGradientReq);
+
+    if(!(newPict = (PanoramiXRes *) xalloc(sizeof(PanoramiXRes))))
+	return BadAlloc;
+
+    newPict->type = XRT_PICTURE;
+    newPict->info[0].id = stuff->pid;
+    newPict->u.pict.root = FALSE;
+
+    for(j = 1; j < PanoramiXNumScreens; j++)
+	newPict->info[j].id = FakeClientID(client->index);
+
+    FOR_NSCREENS_BACKWARD(j) {
+	stuff->pid = newPict->info[j].id;
+	result = (*PanoramiXSaveRenderVector[X_RenderCreateConicalGradient]) (client);
+	if(result != Success) break;
+    }
+
+    if (result == Success)
+	AddResource(newPict->info[0].id, XRT_PICTURE, newPict);
+    else
+	xfree(newPict);
+
+    return result;
+}
+
 void
 PanoramiXRenderInit (void)
 {
@@ -3263,6 +3395,11 @@ PanoramiXRenderInit (void)
     ProcRenderVector[X_RenderTriStrip] = PanoramiXRenderTriStrip;
     ProcRenderVector[X_RenderTriFan] = PanoramiXRenderTriFan;
     ProcRenderVector[X_RenderAddTraps] = PanoramiXRenderAddTraps;
+
+    ProcRenderVector[X_RenderCreateSolidFill] = PanoramiXRenderCreateSolidFill;
+    ProcRenderVector[X_RenderCreateLinearGradient] = PanoramiXRenderCreateLinearGradient;
+    ProcRenderVector[X_RenderCreateRadialGradient] = PanoramiXRenderCreateRadialGradient;
+    ProcRenderVector[X_RenderCreateConicalGradient] = PanoramiXRenderCreateConicalGradient;
 }
 
 void
commit 85b04bb0ebaf7a6f1b1a34f7b1704a3e6cbdab8a
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Feb 5 18:08:37 2010 +1000

    xserver 1.7.4.902
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/configure.ac b/configure.ac
index 2b6ec6b..fc7ff05 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.7.4.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2010-01-23"
+AC_INIT([xorg-server], 1.7.4.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2010-02-05"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([dist-bzip2 foreign])
 AM_MAINTAINER_MODE
commit 219a0d8fb54f179c7ac8d5953585849ab65a778b
Author: Oldřich Jedlička <oldium.pro at seznam.cz>
Date:   Sun Jan 17 17:59:03 2010 +0100

    Allow driver to call DeleteInputDeviceRequest during UnInit
    
    When the input driver (like xf86-input-wacom) removes it's devices
    during a call to UnInit, the CloseDownDevices() cannot handle it. The
    "next" variable can become a pointer to freed memory.
    
    The patch introduces order-independent device freeing mechanism by
    remembering the already freed device ids. The devices can reorder any
    time during freeing. No device will be double-freed - if the removing
    failed for any reason; some implementations of DeleteInputDeviceRequest
    don't free the devices already.
    
    Signed-off-by: Oldřich Jedlička <oldium.pro at seznam.cz>
    Reviewed-by: Simon Thum <simon.thum at gmx.de>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 08b22c7faf97217ea4d497eec6624fc3dd916d9b)

diff --git a/dix/devices.c b/dix/devices.c
index 245a95b..ef199b7 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -878,13 +878,43 @@ CloseDevice(DeviceIntPtr dev)
 }
 
 /**
+ * Shut down all devices of one list and free all resources.
+ */
+static
+void
+CloseDeviceList(DeviceIntPtr *listHead)
+{
+    /* Used to mark devices that we tried to free */
+    Bool freedIds[MAXDEVICES];
+    DeviceIntPtr dev;
+    int i;
+
+    if (listHead == NULL)
+        return;
+
+    for (i = 0; i < MAXDEVICES; i++)
+        freedIds[i] = FALSE;
+
+    dev = *listHead;
+    while (dev != NULL)
+    {
+        freedIds[dev->id] = TRUE;
+        DeleteInputDeviceRequest(dev);
+
+        dev = *listHead;
+        while (dev != NULL && freedIds[dev->id])
+            dev = dev->next;
+    }
+}
+
+/**
  * Shut down all devices, free all resources, etc.
  * Only useful if you're shutting down the server!
  */
 void
 CloseDownDevices(void)
 {
-    DeviceIntPtr dev, next;
+    DeviceIntPtr dev;
 
     /* Float all SDs before closing them. Note that at this point resources
      * (e.g. cursors) have been freed already, so we can't just call
@@ -897,16 +927,8 @@ CloseDownDevices(void)
             dev->u.master = NULL;
     }
 
-    for (dev = inputInfo.devices; dev; dev = next)
-    {
-	next = dev->next;
-        DeleteInputDeviceRequest(dev);
-    }
-    for (dev = inputInfo.off_devices; dev; dev = next)
-    {
-	next = dev->next;
-        DeleteInputDeviceRequest(dev);
-    }
+    CloseDeviceList(&inputInfo.devices);
+    CloseDeviceList(&inputInfo.off_devices);
 
     CloseDevice(inputInfo.pointer);
     CloseDevice(inputInfo.keyboard);
commit a6a4c20121301905399c4e1c23980993bcbf2152
Author: Horst Wente <horst.wente at acm.org>
Date:   Wed Dec 30 19:35:20 2009 +0100

    xkb: make ctrl+alt+keypad + / ctrl+alt+keypad - work again (#25743)
    
    Video mode switching via keypad keys did not work
    
    Signed-off-by: Horst Wente <horst.wente at acm.org>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit b91cec26de367f75388e620772747b08eee34294)

diff --git a/xkb/xkmread.c b/xkb/xkmread.c
index 6623d1b..3c2df03 100644
--- a/xkb/xkmread.c
+++ b/xkb/xkmread.c
@@ -531,7 +531,13 @@ XkbAction               *act;
             act->devval.v2_ndx = wire.actionData[5];
             act->devval.v2_what = wire.actionData[6];
             break;
+
         case XkbSA_XFree86Private:
+            /* copy the kind of action */
+            strncpy((char*)act->any.data, (char*)wire.actionData,
+                    XkbAnyActionDataSize);
+            break ;
+
         case XkbSA_Terminate:
             /* no args, kinda (note: untrue for xfree86). */
             break;
commit a5b558d065e24880ff14b3781f27d1a9ea6094ab
Author: Oldřich Jedlička <oldium.pro at seznam.cz>
Date:   Tue Jan 12 19:15:06 2010 +0100

    Fix typo in updateSlaveDeviceCoords
    
    The index [0] for the second valuator looks bogus; fix it.
    
    Signed-off-by: Oldřich Jedlička <oldium.pro at seznam.cz>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 993e78d6c433f65bd8a87890a6bb6da480b2cdc4)

diff --git a/dix/getevents.c b/dix/getevents.c
index 2df32e8..18c6302 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -296,7 +296,7 @@ updateSlaveDeviceCoords(DeviceIntPtr master, DeviceIntPtr pDev)
                         &pDev->last.remainder[0], NULL, pDev->valuator->axes + 0, scr->width);
     if(pDev->valuator->numAxes > 1)
         pDev->last.valuators[1] = rescaleValuatorAxis(pDev->last.valuators[1], pDev->last.remainder[1],
-                        &pDev->last.remainder[0], NULL, pDev->valuator->axes + 1, scr->height);
+                        &pDev->last.remainder[1], NULL, pDev->valuator->axes + 1, scr->height);
 
     /* calculate the other axis as well based on info from the old
      * slave-device. If the old slave had less axes than this one,
commit 5d34e78c81bfba3d14146ddfd8e714cdfd9a1692
Author: Robert Morell <rmorell at nvidia.com>
Date:   Thu Jan 21 12:38:47 2010 -0800

    Render: Fix request size verification
    
    RenderSetPictureClipRectangles and the Xinerama version of
    RenderChangePicture were using the wrong structure types for request
    size verification.
    
    Signed-off-by: Robert Morell <rmorell at nvidia.com>
    Reviewed-by: Aaron Plattner <aplattner at nvidia.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 8d6b1838330625b758ebc55bb0df1b425c5cefaf)

diff --git a/render/render.c b/render/render.c
index a32d797..10554ad 100644
--- a/render/render.c
+++ b/render/render.c
@@ -656,7 +656,7 @@ ProcRenderSetPictureClipRectangles (ClientPtr client)
     if (!pPicture->pDrawable)
         return BadDrawable;
 
-    nr = (client->req_len << 2) - sizeof(xRenderChangePictureReq);
+    nr = (client->req_len << 2) - sizeof(xRenderSetPictureClipRectanglesReq);
     if (nr & 4)
 	return BadLength;
     nr >>= 3;
@@ -2728,7 +2728,7 @@ PanoramiXRenderChangePicture (ClientPtr client)
     int		    result = Success, j;
     REQUEST(xRenderChangePictureReq);
 
-    REQUEST_AT_LEAST_SIZE(xChangeWindowAttributesReq);
+    REQUEST_AT_LEAST_SIZE(xRenderChangePictureReq);
     
     VERIFY_XIN_PICTURE(pict, stuff->picture, client, DixWriteAccess,
 		       RenderErrBase + BadPicture);
commit 6f533994921725653306753f474c343fbb3b88a4
Author: Simon Thum <simon.thum at gmx.de>
Date:   Sat Jan 23 13:36:22 2010 +0100

    xfree86: remove man page reference inexistent acceleration profile
    
    not implemented in the X.org server 1.7
    
    Signed-off-by: Simon Thum <simon.thum at gmx.de>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
index 687ec76..f0a7373 100644
--- a/hw/xfree86/doc/man/xorg.conf.man.pre
+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
@@ -904,7 +904,6 @@ is constructed. This is mainly a matter of personal preference.
 .B  " 4      simple (normal when slow, otherwise accelerated)"
 .B  " 5      power (power function)"
 .B  " 6      linear (more speed, more acceleration)"
-.B  " 7      limited (like linear, but maxes out at threshold)"
 .fi
 .RE
 .TP 7
commit 1c126ba53161933fa1a756e696e98f1395dfa61a
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sat Jan 30 14:49:02 2010 -0800

    XQuartz: Attatch a stub display when CoreGraphics reports no displays.
    
    This is half of the required changes to address the "stuck mouse pointer"
    bug that occurs when X11 launches while the displays are asleep.  The
    remainder of the fix is part of libXplugin which needs to be updated to
    send XP_EVENT_DISPLAY_CHANGED when the display wakes up.  If you don't
    have a recent enough libXplugin (expected in 2.5.0_beta2 or later), you
    can cause this event to be sent by changing your display resolution (or
    you could just start X11.app with your screens awake).
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>
    (cherry picked from commit 52456c602c3cdd7d5eac677889a18fad37dfb7ae)

diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index 22a727e..735b2ba 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -184,7 +184,20 @@ xprAddPseudoramiXScreens(int *x, int *y, int *width, int *height)
 
     // Find all the CoreGraphics displays
     CGGetActiveDisplayList(0, NULL, &displayCount);
+    DEBUG_LOG("displayCount: %d\n", (int)displayCount);
+
+    if(!displayCount) {
+        ErrorF("CoreGraphics has reported no connected displays.  Creating a stub 800x600 display.\n");
+        *x = *y = 0;
+        *width = 800;
+        *height = 600;
+        PseudoramiXAddScreen(*x, *y, *width, *height);
+        return;
+    }
+
     displayList = xalloc(displayCount * sizeof(CGDirectDisplayID));
+    if(!displayList)
+        FatalError("Unable to allocate memory for list of displays.\n");
     CGGetActiveDisplayList(displayCount, displayList, &displayCount);
 
     /* Get the union of all screens */
commit 734a6b9c2150ce38cf120e179cdac9d3c625434e
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Tue Jan 26 22:25:04 2010 -0800

    Avoid segfaults in XF86VidMode GammaRamp functions if randr_crtc is NULL
    
    Fixes crash when xscreensaver tries to use GammaRamp calls to fade out
    http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6915712
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/common/xf86cmap.c b/hw/xfree86/common/xf86cmap.c
index 08f557c..edd5ae9 100644
--- a/hw/xfree86/common/xf86cmap.c
+++ b/hw/xfree86/common/xf86cmap.c
@@ -1004,12 +1004,14 @@ xf86ChangeGammaRamp(
 	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
 	RRCrtcPtr crtc = config->output[config->compat_output]->crtc->randr_crtc;
 
-	if (crtc->gammaSize != size)
-	    return BadValue;
+	if (crtc) {
+	    if (crtc->gammaSize != size)
+		return BadValue;
 
-	RRCrtcGammaSet(crtc, red, green, blue);
+	    RRCrtcGammaSet(crtc, red, green, blue);
 
-	return Success;
+	    return Success;
+	}
     }
 
     if(CMapScreenKey == NULL)
@@ -1077,7 +1079,8 @@ xf86GetGammaRampSize(ScreenPtr pScreen)
 	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
 	RRCrtcPtr crtc = config->output[config->compat_output]->crtc->randr_crtc;
 
-	return crtc->gammaSize;
+	if (crtc)
+	    return crtc->gammaSize;
     }
 
     if(CMapScreenKey == NULL) return 0;
@@ -1106,17 +1109,19 @@ xf86GetGammaRamp(
 	xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
 	RRCrtcPtr crtc = config->output[config->compat_output]->crtc->randr_crtc;
 
-	if (crtc->gammaSize < size)
-	    return BadValue;
+	if (crtc) {
+	    if (crtc->gammaSize < size)
+		return BadValue;
 
-	if (!RRCrtcGammaGet(crtc))
-	    return BadImplementation;
+	    if (!RRCrtcGammaGet(crtc))
+		return BadImplementation;
 
-	memcpy(red, crtc->gammaRed, size * sizeof(*red));
-	memcpy(green, crtc->gammaGreen, size * sizeof(*green));
-	memcpy(blue, crtc->gammaBlue, size * sizeof(*blue));
+	    memcpy(red, crtc->gammaRed, size * sizeof(*red));
+	    memcpy(green, crtc->gammaGreen, size * sizeof(*green));
+	    memcpy(blue, crtc->gammaBlue, size * sizeof(*blue));
 
-	return Success;
+	    return Success;
+	}
     }
 
     if(CMapScreenKey == NULL) 
commit b47231b2fd4e403403945d6da6119398b16f385d
Author: Aaron Zang <Aaron.Zang at Sun.COM>
Date:   Mon Dec 14 17:55:46 2009 -0800

    Solaris: Avoid switching to inactive VT's
    
    Fix for OpenSolaris bug 6876992: "[vconsole] Ctrl+Alt+F12 switchs to blank
    console screen with hotkeys property turned-off"
    http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6876992
    
    Xorg needs to do sanity test for the VT it is commanded to switch to.
    If the VT is not opened by any process, discard the switching request.
    
    The changes also contain the fix for some flaws discovered when
    getting the new gdm to run.
    
    Signed-off-by: Aaron Zang <Aaron.Zang at Sun.COM>
    Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>

diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index 8cd765a..8e6a15b 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -202,8 +202,16 @@ xf86ProcessActionEvent(ActionEvent action, void *arg)
 	    vtno--;
 #endif
 #if defined(sun)
-	    if (vtno == xf86Info.vtno)
+	    if (vtno == xf86Info.vtno) {
 		break;
+	    } else {
+		struct vt_stat state;
+		if (ioctl(xf86Info.consoleFd, VT_GETSTATE, &state) < 0)
+			break;
+
+		if ((state.v_state & (1 << vtno)) == 0)
+			break;
+	    }
 
 	    xf86Info.vtRequestsPending = TRUE;
 	    xf86Info.vtPendingNum = vtno;
diff --git a/hw/xfree86/os-support/solaris/sun_VTsw.c b/hw/xfree86/os-support/solaris/sun_VTsw.c
index ded2f27..7f4e08e 100644
--- a/hw/xfree86/os-support/solaris/sun_VTsw.c
+++ b/hw/xfree86/os-support/solaris/sun_VTsw.c
@@ -38,17 +38,27 @@
  * Handle the VT-switching interface for Solaris/OpenSolaris
  */
 
+static int xf86VTPruneDoor = 0;
+
 void
-xf86VTRequest(int sig)
+xf86VTRelease(int sig)
 {
-	if (xf86Info.vtPendingNum != -1)
+	if (xf86Info.vtPendingNum == -1)
 	{
-		ioctl(xf86Info.consoleFd, VT_RELDISP, 1);
-		xf86Info.vtPendingNum = -1;
-
+		xf86VTPruneDoor = 1;
+		xf86Info.vtRequestsPending = TRUE;
 		return;
 	}
 
+	ioctl(xf86Info.consoleFd, VT_RELDISP, 1);
+	xf86Info.vtPendingNum = -1;
+
+	return;
+}
+
+void
+xf86VTAcquire(int sig)
+{
 	xf86Info.vtRequestsPending = TRUE;
 	return;
 }
@@ -68,6 +78,12 @@ xf86VTSwitchAway(void)
 
 	xf86Info.vtRequestsPending = FALSE;
 
+	if (xf86VTPruneDoor) {
+		xf86VTPruneDoor = 0;
+		ioctl(xf86Info.consoleFd, VT_RELDISP, 1);
+		return (TRUE);
+	}
+
 	vt_door_arg.vt_ev = VT_EV_HOTKEYS;
 	vt_door_arg.vt_num = xf86Info.vtPendingNum;
 	door_arg.data_ptr = (char *)&vt_door_arg;
diff --git a/hw/xfree86/os-support/solaris/sun_init.c b/hw/xfree86/os-support/solaris/sun_init.c
index 2c569f0..5846866 100644
--- a/hw/xfree86/os-support/solaris/sun_init.c
+++ b/hw/xfree86/os-support/solaris/sun_init.c
@@ -39,6 +39,8 @@ static Bool Protect0 = FALSE;
 static int VTnum = -1;
 static int xf86StartVT = -1;
 static int vtEnabled = 0;
+extern void xf86VTAcquire(int);
+extern void xf86VTRelease(int);
 #endif
 
 /* Device to open as xf86Info.consoleFd */
@@ -137,7 +139,8 @@ xf86OpenConsole(void)
 	    else
 	    {
 		if ((ioctl(fd, VT_OPENQRY, &xf86Info.vtno) < 0) ||
-		    (xf86Info.vtno == -1)) {
+		    (xf86Info.vtno == -1))
+		{
 		    FatalError("xf86OpenConsole: Cannot find a free VT\n");
 		}
 	    }
@@ -146,7 +149,8 @@ xf86OpenConsole(void)
 	    snprintf(consoleDev, PATH_MAX, "/dev/vt/%d", xf86Info.vtno);
 	}
 
-	if (fd != -1) {
+	if (fd != -1)
+	{
 	    close(fd);
 	}
 
@@ -178,11 +182,12 @@ xf86OpenConsole(void)
 	    if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0)
 		FatalError("xf86OpenConsole: VT_GETMODE failed\n");
 
-	    OsSignal(SIGUSR1, xf86VTRequest);
+	    OsSignal(SIGUSR1, xf86VTAcquire);
+	    OsSignal(SIGUSR2, xf86VTRelease);
 
 	    VT.mode = VT_PROCESS;
-	    VT.relsig = SIGUSR1;
 	    VT.acqsig = SIGUSR1;
+	    VT.relsig = SIGUSR2;
 
 	    if (ioctl(xf86Info.consoleFd, VT_SETMODE, &VT) < 0)
 		FatalError("xf86OpenConsole: VT_SETMODE VT_PROCESS failed\n");
@@ -204,7 +209,8 @@ xf86OpenConsole(void)
     else /* serverGeneration != 1 */
     {
 #ifdef HAS_USL_VTS
-	if (vtEnabled) {
+	if (vtEnabled)
+	{
 	    /*
 	     * Now re-get the VT
 	     */
@@ -285,7 +291,8 @@ xf86CloseConsole(void)
 #endif
 
 #ifdef HAS_USL_VTS
-    if (vtEnabled == 1) {
+    if (vtEnabled)
+    {
 	if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) != -1)
 	{
 	    VT.mode = VT_AUTO;		/* Set default vt handling */
commit 66b6e2fd49fdc650703e56aa176a902e4921251c
Author: Pierre-Loup A. Griffais <pgriffais at nvidia.com>
Date:   Wed Jan 27 14:03:03 2010 -0800

    Fix source pictures getting random transforms after 2d6a8f668342a5190cdf43b5.
    
    *xoff and *yoff were uninitialized for source-only pictures.x
    
    Signed-off-by: Pierre-Loup A. Griffais <pgriffais at nvidia.com>
    Reviewed-by: Aaron Plattner <aplattner at nvidia.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit a6bd5d2e482a5aa84acb3d4932e2a166d8670ef1)

diff --git a/fb/fbpict.c b/fb/fbpict.c
index f9f4343..c046bae 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -453,6 +453,7 @@ image_from_pict_18 (PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
 	    else if (sp->type == SourcePictTypeConical)
 		image = create_conical_gradient_image (gradient);
 	}
+	*xoff = *yoff = 0;
     }
     
     if (image)
commit a191318f8dde2a4ff47c051244e8c88e8f92883a
Author: Christian Zander <chzander at nvidia.com>
Date:   Mon Jan 11 12:29:07 2010 -0800

    x86emu: Respect the LEA 67h address size prefix.
    
    Signed-off-by: Christian Zander <chzander at nvidia.com>
    Signed-off-by: Aaron Plattner <aplattner at nvidia.com>
    Tested-by: Tiago Vignatti <tiago.vignatti at nokia.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit f57bc0ede8e018c7e264b917927c42a018cd1d5a)

diff --git a/hw/xfree86/x86emu/ops.c b/hw/xfree86/x86emu/ops.c
index 37ae2c9..21a0347 100644
--- a/hw/xfree86/x86emu/ops.c
+++ b/hw/xfree86/x86emu/ops.c
@@ -6567,42 +6567,62 @@ Handles opcode 0x8d
 static void x86emuOp_lea_word_R_M(u8 X86EMU_UNUSED(op1))
 {
     int mod, rl, rh;
-    u16 *srcreg;
     uint destoffset;
 
-/*
- * TODO: Need to handle address size prefix!
- *
- * lea  eax,[eax+ebx*2] ??
- */
-    
     START_OF_INSTR();
     DECODE_PRINTF("LEA\t");
     FETCH_DECODE_MODRM(mod, rh, rl);
     switch (mod) {
     case 0:
-        srcreg = DECODE_RM_WORD_REGISTER(rh);
-        DECODE_PRINTF(",");
-        destoffset = decode_rm00_address(rl);
-        DECODE_PRINTF("\n");
-        TRACE_AND_STEP();
-        *srcreg = (u16)destoffset;
+        if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
+            u32 *srcreg = DECODE_RM_LONG_REGISTER(rh);
+            DECODE_PRINTF(",");
+            destoffset = decode_rm00_address(rl);
+            DECODE_PRINTF("\n");
+            TRACE_AND_STEP();
+            *srcreg = (u32)destoffset;
+        } else {
+            u16 *srcreg = DECODE_RM_WORD_REGISTER(rh);
+            DECODE_PRINTF(",");
+            destoffset = decode_rm00_address(rl);
+            DECODE_PRINTF("\n");
+            TRACE_AND_STEP();
+            *srcreg = (u16)destoffset;
+        }
         break;
     case 1:
-        srcreg = DECODE_RM_WORD_REGISTER(rh);
-        DECODE_PRINTF(",");
-        destoffset = decode_rm01_address(rl);
-        DECODE_PRINTF("\n");
-        TRACE_AND_STEP();
-        *srcreg = (u16)destoffset;
+        if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
+            u32 *srcreg = DECODE_RM_LONG_REGISTER(rh);
+            DECODE_PRINTF(",");
+            destoffset = decode_rm01_address(rl);
+            DECODE_PRINTF("\n");
+            TRACE_AND_STEP();
+            *srcreg = (u32)destoffset;
+        } else {
+            u16 *srcreg = DECODE_RM_WORD_REGISTER(rh);
+            DECODE_PRINTF(",");
+            destoffset = decode_rm01_address(rl);
+            DECODE_PRINTF("\n");
+            TRACE_AND_STEP();
+            *srcreg = (u16)destoffset;
+        }
         break;
     case 2:
-        srcreg = DECODE_RM_WORD_REGISTER(rh);
-        DECODE_PRINTF(",");
-        destoffset = decode_rm10_address(rl);
-        DECODE_PRINTF("\n");
-        TRACE_AND_STEP();
-        *srcreg = (u16)destoffset;
+        if (M.x86.mode & SYSMODE_PREFIX_ADDR) {
+            u32 *srcreg = DECODE_RM_LONG_REGISTER(rh);
+            DECODE_PRINTF(",");
+            destoffset = decode_rm10_address(rl);
+            DECODE_PRINTF("\n");
+            TRACE_AND_STEP();
+            *srcreg = (u32)destoffset;
+        } else {
+            u16 *srcreg = DECODE_RM_WORD_REGISTER(rh);
+            DECODE_PRINTF(",");
+            destoffset = decode_rm10_address(rl);
+            DECODE_PRINTF("\n");
+            TRACE_AND_STEP();
+            *srcreg = (u16)destoffset;
+        }
         break;
     case 3:                     /* register to register */
         /* undefined.  Do nothing. */
commit d3e54304578cbeb948a13654614b75bea4c55449
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Sat Jan 23 12:55:38 2010 +1300

    xserver 1.7.4.901
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/configure.ac b/configure.ac
index e16eb90..2b6ec6b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.7.4, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2010-01-08"
+AC_INIT([xorg-server], 1.7.4.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2010-01-23"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([dist-bzip2 foreign])
 AM_MAINTAINER_MODE
commit 43412c6b8bc7af7df0c07590002c2f96d57ba861
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Wed Jan 13 11:20:29 2010 -0800

    XQuartz: Update copyright in bundle for 2010
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>
    (cherry picked from commit 6bde306f7f6b9bbabeaa8bb910ea549be906cd8b)

diff --git a/hw/xquartz/bundle/Info.plist.cpp b/hw/xquartz/bundle/Info.plist.cpp
index 87214f4..e89d985 100644
--- a/hw/xquartz/bundle/Info.plist.cpp
+++ b/hw/xquartz/bundle/Info.plist.cpp
@@ -35,9 +35,9 @@
                 <string>http://xquartz.macosforge.org/downloads/sparkle/release.xml</string>
 #endif
 	<key>NSHumanReadableCopyright</key>
-		<string>© 2003-2009 Apple Inc.
+		<string>© 2003-2010 Apple Inc.
 © 2003 XFree86 Project, Inc.
-© 2003-2009 X.org Foundation, Inc.
+© 2003-2010 X.org Foundation, Inc.
 </string>
 	<key>NSMainNibFile</key>
 		<string>main</string>
commit 268c00d24b1938aaa75ad23892fba6ef241fbe9d
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Mon Jan 11 18:02:55 2010 -0800

    XQuartz: Setup the modifier map in the quartz thread
    
    This avoids possible doing it twice which could result in incorrect
    keycodes for alt due to our loss of information about its side.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>
    (cherry picked from commit 6008cc116493cb2825ad0bda0b407b7aefabb3f4)

diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index 62b2ebb..96b5fa5 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -260,6 +260,7 @@ static void DarwinBuildModifierMaps(darwinKeyboardInfo *info) {
                 break;
 
             case XK_Mode_switch:
+                ErrorF("DarwinBuildModifierMaps: XK_Mode_switch encountered, unable to determine side.\n");
                 info->modifierKeycodes[NX_MODIFIERKEY_ALTERNATE][0] = i;
 #ifdef NX_MODIFIERKEY_RALTERNATE
                 info->modifierKeycodes[NX_MODIFIERKEY_RALTERNATE][0] = i;
@@ -388,7 +389,6 @@ void DarwinKeyboardReloadHandler(void) {
     
     pthread_mutex_lock(&keyInfo_mutex); {
         /* Initialize our keySyms */
-        DarwinBuildModifierMaps(&keyInfo);
         keySyms.map = keyInfo.keyMap;
         keySyms.mapWidth   = GLYPHS_PER_KEY;
         keySyms.minKeyCode = MIN_KEYCODE;
@@ -808,5 +808,7 @@ Bool QuartzReadSystemKeymap(darwinKeyboardInfo *info) {
         }
     }
 
+    DarwinBuildModifierMaps(info);
+
     return TRUE;
 }
commit b852834bb1974a2c149869b6e19aff000a2b4187
Author: Simon Thum <simon.thum at gmx.de>
Date:   Wed Jan 6 18:13:27 2010 +0100

    os: state effect of -a and -t options more precisely
    
    Signed-off-by: Simon Thum <simon.thum at gmx.de>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 14e4e4a294e648e0bdcb70c34748e1b81c5bb64f)

diff --git a/os/utils.c b/os/utils.c
index 3718b17..d7c8388 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -472,7 +472,7 @@ AdjustWaitForDelay (pointer waitTime, unsigned long newdelay)
 void UseMsg(void)
 {
     ErrorF("use: X [:<display>] [option]\n");
-    ErrorF("-a #                   mouse acceleration (pixels)\n");
+    ErrorF("-a #                   default pointer acceleration (factor)\n");
     ErrorF("-ac                    disable access control restrictions\n");
     ErrorF("-audit int             set audit trail level\n");	
     ErrorF("-auth file             select authorization file\n");	
@@ -524,7 +524,7 @@ void UseMsg(void)
 #endif
     ErrorF("-retro                 start with classic stipple and cursor\n");
     ErrorF("-s #                   screen-saver timeout (minutes)\n");
-    ErrorF("-t #                   mouse threshold (pixels)\n");
+    ErrorF("-t #                   default pointer threshold (pixels/t)\n");
     ErrorF("-terminate             terminate at server reset\n");
     ErrorF("-to #                  connection time out\n");
     ErrorF("-tst                   disable testing extensions\n");
commit d76f09406d07fd04a03d9cb3965419b1e95bdd03
Author: Gaetan Nadon <memsize at videotron.ca>
Date:   Thu Jan 7 15:23:34 2010 -0500

    macros: use PKG_CONFIG variable rather than executable name
    
    User can defined alternate location for pkg-config.
    Once option in place, all instances of pkg-config must be converted.
    
    Acked-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>
    Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 6a2a57832709798d99d19ff4c587e22f3b3c150d)

diff --git a/xorg-server.m4 b/xorg-server.m4
index 2d16438..bdecf62 100644
--- a/xorg-server.m4
+++ b/xorg-server.m4
@@ -29,8 +29,9 @@ dnl
 # is defined, then add $1 to $REQUIRED_MODULES.
 
 AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
+	AC_REQUIRE([PKG_PROG_PKG_CONFIG])
 	SAVE_CFLAGS="$CFLAGS"
-	CFLAGS="$CFLAGS -I`pkg-config --variable=sdkdir xorg-server`"
+	CFLAGS="$CFLAGS -I`$PKG_CONFIG --variable=sdkdir xorg-server`"
 	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 #include "xorg-server.h"
 #if !defined $1
commit 08c2df881d61fccfd488b5ca4482686a7f3b47c0
Author: Gaetan Nadon <memsize at videotron.ca>
Date:   Fri Jan 8 19:04:25 2010 -0500

    configure: use backticks rather than $() for commands
    
    This patch to xserver configure.ac is to increase code portability to
    non POSIX system by using backticks rather than $() for command
    substitution for BUILD_DATE and BUILD_TIME.
    
    Reviewed-by: Rémi Cardona <remi at gentoo.org>
    Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 6313d2da6c6910827d68cf31fe00b46a34c5bfc7)

diff --git a/configure.ac b/configure.ac
index c564cf9..e16eb90 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2020,9 +2020,9 @@ AC_TRY_COMPILE([
 
 AC_DEFINE_DIR(PROJECTROOT, prefix, [Overall prefix])
 
-BUILD_DATE="$(date +'%Y%m%d')"
+BUILD_DATE="`date +'%Y%m%d'`"
 AC_SUBST([BUILD_DATE])
-BUILD_TIME="$(date +'1%H%M%S')"
+BUILD_TIME="`date +'1%H%M%S'`"
 AC_SUBST([BUILD_TIME])
 
 DIX_CFLAGS="-DHAVE_DIX_CONFIG_H $XSERVER_CFLAGS"
commit b7e903526c28eb4d5368d916708ff30486e94319
Author: Simon Thum <simon.thum at gmx.de>
Date:   Tue Jan 19 17:34:49 2010 +1300

    xfree86: document pointer acceleration in xorg.conf.man
    
    Signed-off-by: Simon Thum <simon.thum at gmx.de>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Fernando Carrijo <fcarrijo at yahoo.com.br>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 0722c287a4c8a6cdedca9756192547bfcf77ade5)
    
    Conflicts:
    
    	hw/xfree86/doc/man/xorg.conf.man.pre

diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
index 44608ab..687ec76 100644
--- a/hw/xfree86/doc/man/xorg.conf.man.pre
+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
@@ -882,6 +882,50 @@ may be reattached or set floating at runtime.
 .TP 7
 .BI "Option \*qSendDragEvents\*q  \*q" boolean \*q
 Send core events while dragging. Enabled by default.
+.PP
+For pointing devices, the following options control how the pointer
+is accelerated or decelerated with respect to physical device motion. Most of
+these can be adjusted at runtime, see the xinput(1) man page for details. Only
+the most important acceleration options are discussed here.
+.TP 7
+.BI "Option \*qAccelerationProfile\*q  \*q" integer \*q
+Select the profile. In layman's terms, the profile constitutes the "feeling" of
+the acceleration. More formally, it defines how the transfer function (actual
+acceleration as a function of current device velocity and acceleration controls)
+is constructed. This is mainly a matter of personal preference.
+.PP
+.RS 6
+.nf
+.B  " 0      classic (mostly compatible)"
+.B  "-1      none (only constant deceleration is applied)"
+.B  " 1      device-dependent"
+.B  " 2      polynomial (polynomial function)"
+.B  " 3      smooth linear (soft knee, then linear)"
+.B  " 4      simple (normal when slow, otherwise accelerated)"
+.B  " 5      power (power function)"
+.B  " 6      linear (more speed, more acceleration)"
+.B  " 7      limited (like linear, but maxes out at threshold)"
+.fi
+.RE
+.TP 7
+.BI "Option \*qConstantDeceleration\*q  \*q" real \*q
+Makes the pointer go
+.B deceleration
+times slower than normal. Most useful for high-resolution devices.
+.TP 7
+.BI "Option \*qAdaptiveDeceleration\*q  \*q" real \*q
+Allows to actually decelerate the pointer when going slow. At most, it will be
+.B adaptive deceleration
+times slower. Enables precise pointer placement without sacrificing speed.
+.TP 7
+.BI "Option \*qAccelerationScheme\*q  \*q" string \*q
+Selects the scheme, which is the underlying algorithm.
+.PP
+.RS 7
+.nf
+.B  "predictable   default algorithm (behaving more predictable)"
+.B  "lightweight   old acceleration code (as specified in the X protocol spec)"
+.B  "none          no acceleration or deceleration"
 .SH "DEVICE SECTION"
 The config file may have multiple
 .B Device
commit c5e5a7adf0ed378b6f3b28f04af5ad8d967b31bc
Author: Simon Thum <simon.thum at gmx.de>
Date:   Tue Jan 19 17:33:09 2010 +1300

    doc: actually document SendDragEvents
    
    Signed-off-by: Simon Thum <simon.thum at gmx.de>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 14039b5a7982fbf8130501bb00766176a4e9bccb)
    
    Conflicts:
    
    	hw/xfree86/doc/man/xorg.conf.man.pre

diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
index 942c397..44608ab 100644
--- a/hw/xfree86/doc/man/xorg.conf.man.pre
+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
@@ -881,7 +881,7 @@ X Input extension. This option controls the startup behavior only, a device
 may be reattached or set floating at runtime.
 .TP 7
 .BI "Option \*qSendDragEvents\*q  \*q" boolean \*q
-???
+Send core events while dragging. Enabled by default.
 .SH "DEVICE SECTION"
 The config file may have multiple
 .B Device
commit 88582f3d41315abf548a52622e52b7652d2c5281
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Jan 8 09:38:58 2010 +1000

    xserver 1.7.4
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/configure.ac b/configure.ac
index 10cf26f..c564cf9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.7.3.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2009-12-26"
+AC_INIT([xorg-server], 1.7.4, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2010-01-08"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([dist-bzip2 foreign])
 AM_MAINTAINER_MODE
commit e54309e2ec1d16eb5570fad60af9be31f710c852
Author: Adam Tkac <atkac at redhat.com>
Date:   Thu Jan 7 15:34:52 2010 +0100

    Do not define members of include/eventstr.h:EventType enum conditionally.
    
    Main problem is that EventType enumeration members can be different in
    module and in server, which obviously causes problems.
    
    Signed-off-by: Adam Tkac <atkac at redhat.com>
    Reviewed-by: Adam Jackson <ajax at redhat.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 8d53d84485fdce8ea9686e6f300a69f7ddebd467)

diff --git a/include/eventstr.h b/include/eventstr.h
index 0d5b1c6..79685c1 100644
--- a/include/eventstr.h
+++ b/include/eventstr.h
@@ -58,17 +58,13 @@ enum EventType {
     ET_ProximityOut,
     ET_DeviceChanged,
     ET_Hierarchy,
-#if XFreeXDGA
     ET_DGAEvent,
-#endif
     ET_RawKeyPress,
     ET_RawKeyRelease,
     ET_RawButtonPress,
     ET_RawButtonRelease,
     ET_RawMotion,
-#ifdef XQUARTZ
     ET_XQuartz,
-#endif
     ET_Internal = 0xFF /* First byte */
 };
 
commit 8661189c2c443e2d3e5d98e6b04d1852a98bac41
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Mon Jan 4 18:21:54 2010 -0800

    CloseDevice: call XkbRemoveResourceClient before freeing key class struct
    
    XkbRemoveResourceClient() returns immediately if dev->key is NULL.
    CloseDevice calls XkbRemoveResourceClient until it removes all resources.
    
    If we free dev->key and NULL it before XkbRemoveResourceClient, then
    infinite loop ensues, and the server appears to hang on exit or crash.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Daniel Stone <daniel at fooishbar.org>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 13c8bd3fde3b0831921e59f84936022a16379d63)

diff --git a/dix/devices.c b/dix/devices.c
index e3fd456..245a95b 100644
--- a/dix/devices.c
+++ b/dix/devices.c
@@ -843,6 +843,9 @@ CloseDevice(DeviceIntPtr dev)
     if(dev->valuator && dev->valuator->accelScheme.AccelCleanupProc)
 	dev->valuator->accelScheme.AccelCleanupProc(dev);
 
+    while (dev->xkb_interest)
+	XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource);
+
     xfree(dev->name);
 
     classes = (ClassesPtr)&dev->key;
@@ -854,9 +857,6 @@ CloseDevice(DeviceIntPtr dev)
         FreeAllDeviceClasses(classes);
     }
 
-    while (dev->xkb_interest)
-	XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource);
-
     if (DevHasCursor(dev) && dev->spriteInfo->sprite) {
         xfree(dev->spriteInfo->sprite->spriteTrace);
         xfree(dev->spriteInfo->sprite);
commit d1320f4f2908fd3a248a79314bd78f76b03c71c5
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Sat Dec 26 10:13:46 2009 +1000

    xserver 1.7.3.902
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/configure.ac b/configure.ac
index 833a092..10cf26f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.7.3.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2009-12-11"
+AC_INIT([xorg-server], 1.7.3.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2009-12-26"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([dist-bzip2 foreign])
 AM_MAINTAINER_MODE
commit c18dd3fd9b2e4bf3862666671042b7c933f64100
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Dec 7 12:58:57 2009 +1000

    xkb: don't assign garbage value to led_return.
    
    As the comment for the function states, led_return is undefined if map is
    NULL. We might as well skip writing to it then.
    
    Found by clang.
    
    Reported-by: Tomas Carnecky <tom at dbservice.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Jamey Sharp <jamey at minilop.net>
    (cherry picked from commit 12fb31815db9de9c01f2d4155a2b74531777c0bf)

diff --git a/xkb/xkb.c b/xkb/xkb.c
index 98e879d..1cd4558 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -3273,20 +3273,21 @@ _XkbFindNamedIndicatorMap(XkbSrvLedInfoPtr sli, Atom indicator,
                           int *led_return)
 {
     XkbIndicatorMapPtr  map;
-    int                 led;
 
     /* search for the right indicator */
     map = NULL;
     if (sli->names && sli->maps) {
+	int led;
+
 	for (led = 0; (led < XkbNumIndicators) && (map == NULL); led++) {
 	    if (sli->names[led] == indicator) {
 		map= &sli->maps[led];
+		*led_return = led;
 		break;
 	    }
 	}
     }
 
-    *led_return = led;
     return map;
 }
 
commit 0f71be87b9174c587ccacd6aa61a9a66d3507ef4
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Dec 14 11:05:20 2009 +1000

    xfree86: belately init RandR12 if xinerama fails. (#24627)
    
    On Fri, Dec 11, 2009 at 10:19:01AM -0800, Keith Packard wrote:
    > On Wed, 9 Dec 2009 11:55:14 +1000, Peter Hutterer <peter.hutterer at who-t.net> wrote:
    > > On Tue, Dec 08, 2009 at 05:24:06PM -0800, Aaron Plattner wrote:
    > > > On Tue, Dec 08, 2009 at 03:52:27PM -0800, Peter Hutterer wrote:
    > > > > Xorg +xinerama crashes immediately due to whacky dependency between Xinerama
    > > > > and RandR12. The latter doesn't initialize if Xinerama is enabled, but if
    > > > > only one screen is found, Xinerama is disabled again and RandR12 tries to
    > > > > access data it never initialized.
    >
    > I'd sure like to have RandR get enabled when xinerama doesn't; is there
    > an easy way of making that happen here? Perhaps having the RandR12 code
    > disable Xinerama when only one screen is found? Or some other kludge?
    
    you know the dependency better than I do so any hints are apreciated.
    afaict, the screenInfo.numScreens (the check used by Xinerama) isn't
    necessarily initialized at this point so we can't use the same check.
    The following seems to work though:
    
    From 670b3ebdb7312a6433a8f093d0820785db2aea20 Mon Sep 17 00:00:00 2001
    From: Peter Hutterer <peter.hutterer at who-t.net>
    Date: Mon, 14 Dec 2009 11:00:58 +1000
    Subject: [PATCH] xfree86: if only one screen was found, disable Xinerama (#24627)
    
    Xorg +xinerama crashes immediately due to whacky dependency between Xinerama
    and RandR12. The latter doesn't initialize if Xinerama is enabled, but if
    only one screen is found, Xinerama is disabled again and RandR12 tries to
    access data it never initialized.
    
    Dependency chain is:
    - ProcessCommandLine sets noPanoramiXExtension to FALSE
    - xf86RandR12Init() is a noop
    - PanoramiXExtensionInit sets noPanoramiXExtension to TRUE
    - xf86RandR12CreateScreenResources tries to use the devPrivates key it never
      initialized.
    
    This hack checks if there's only one screen at the time RandR12 is
    initialized. If so, we expect Xinerama to fail anyhow so we disable it
    ourselves and proceed as planned.
    
    X.Org Bug 24627 <http://bugs.freedesktop.org/show_bug.cgi?id=24627>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit faca1bc582e374d32ee9d63d10e072fbef4940a3)

diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 6ea9d26..1fc63c4 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -871,7 +871,12 @@ xf86RandR12Init (ScreenPtr pScreen)
 #ifdef PANORAMIX
     /* XXX disable RandR when using Xinerama */
     if (!noPanoramiXExtension)
-	return TRUE;
+    {
+        if (xf86NumScreens == 1)
+            noPanoramiXExtension = TRUE;
+        else
+            return TRUE;
+    }
 #endif
 
     if (xf86RandR12Generation != serverGeneration)
commit b98a07d86dab5b6c5d524d36814fda8e9549120c
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Dec 21 11:08:26 2009 +1000

    xfree86: remove HistorySize from the xorg.conf man page.
    
    This option isn't parsed by anything anymore.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 190610e0c62170a27ab3e40c6c6210a583ae1ad4)

diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
index ea4a641..942c397 100644
--- a/hw/xfree86/doc/man/xorg.conf.man.pre
+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
@@ -879,10 +879,6 @@ default. Devices with
 disabled will be \*qfloating\*q and only accessible by clients employing the
 X Input extension. This option controls the startup behavior only, a device
 may be reattached or set floating at runtime.
-.TP 4
-.BI "Option \*qHistorySize\*q  \*q" number \*q
-Sets the motion history size.
-Default: 0.
 .TP 7
 .BI "Option \*qSendDragEvents\*q  \*q" boolean \*q
 ???
commit 7812d760e9b3fe3fc4de710fdddab504c1335fd5
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Dec 21 10:42:32 2009 +1000

    xfree86: reword InputDevice man sections, deprecate CorePointer/CoreKeyboard
    
    Reshuffle and reword - InputDevice sections are only necessary if
    hotplugging is disabled. Put more emphasis on hotplugging and less on HAL
    since we'll switch backends eventually.
    
    CorePointer, CoreKeyboard, and AlwaysCore should be listed as deprecated
    since they don't do what they used to since 1.4. These days, only
    SendCoreEvents matters and it's enabled for any driver calling
    xf86ProcessCommonOptions (== every driver).
    It only controls the startup behavior too, so document this.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Acked-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at sun.com>
    (cherry picked from commit 094c6b9f97a9f92e5a0ef3cf5be24c09ed4d6063)

diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
index e3cbcf5..ea4a641 100644
--- a/hw/xfree86/doc/man/xorg.conf.man.pre
+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
@@ -769,11 +769,28 @@ Example: the MIT-SHM extension can be disabled with the following entry:
 The config file may have multiple
 .B InputDevice
 sections.
-If HAL is not being used for input device configuration, there will normally
-be at least two: one for the core (primary) keyboard,
-and one of the core pointer.
+Recent X servers employ input hotplugging to add input devices, with the HAL
+backend being the default backend for X servers since 1.4. It is usually not
+necessary to provide
+.B InputDevice
+sections in the xorg.conf if hotplugging is enabled.
+.PP
+If hotplugging is disabled, there will normally
+be at least two: one for the core (primary) keyboard
+and one for the core pointer.
 If either of these two is missing, a default configuration for the missing
-ones will be used.
+ones will be used. In the absence of an explicitly specified core input
+device, the first
+.B InputDevice
+marked as
+.B CorePointer
+(or
+.BR CoreKeyboard )
+is used.
+If there is no match there, the first
+.B InputDevice
+that uses the \(lqmouse\(rq (or \(lqkbd\(rq) driver is used.
+The final fallback is to use built\-in default configurations.
 Currently the default configuration may not work as expected on all platforms.
 .PP
 .B InputDevice
@@ -828,17 +845,6 @@ and
 .BR mousedrv (__drivermansuffix__)
 on other platforms.
 .PP
-In the absence of an explicitly specified core input device, the first
-.B InputDevice
-marked as
-.B CorePointer
-(or
-.BR CoreKeyboard )
-is used.
-If there is no match there, the first
-.B InputDevice
-that uses the \(lqmouse\(rq (or \(lqkbd\(rq) driver is used.
-The final fallback is to use built\-in default configurations.
 .PP
 .B InputDevice
 sections recognise some driver\-independent
@@ -848,40 +854,31 @@ See the individual input driver manual pages for a description of the
 device\-specific options.
 .TP 7
 .BI "Option \*qCorePointer\*q"
-When this is set, the input device is installed as the core (primary)
-pointer device.
-There must be exactly one core pointer.
-If this option is not set here, or in the
-.B ServerLayout
-section, or from the
-.B \-pointer
-command line option, then the first input device that is capable of
-being used as a core pointer will be selected as the core pointer.
-This option is implicitly set when the obsolete
-.B Pointer
-section is used.
+Deprecated, use
+.B SendCoreEvents
+instead.
 .TP 7
 .BI "Option \*qCoreKeyboard\*q"
-When this is set, the input device is to be installed as the core
-(primary) keyboard device.
-There must be exactly one core keyboard.
-If this option is not set here, in the
-.B ServerLayout
-section, or from the
-.B \-keyboard
-command line option, then the first input device that is capable of
-being used as a core keyboard will be selected as the core keyboard.
-This option is implicitly set when the obsolete
-.B Keyboard
-section is used.
+Deprecated, use
+.B SendCoreEvents
+instead.
 .TP 7
 .BI "Option \*qAlwaysCore\*q  \*q" boolean \*q
+.B
+Deprecated, use
+.B SendCoreEvents
+instead.
 .TP 7
 .BI "Option \*qSendCoreEvents\*q  \*q" boolean \*q
 Both of these options are equivalent, and when enabled cause the
-input device to always report core events.
-This can be used, for example, to allow an additional pointer device to
-generate core pointer events (like moving the cursor, etc).
+input device to report core events through the master device. They are
+enabled by default.  Any device configured to send core events will be
+attached to the virtual core pointer or keyboard and control the cursor by
+default. Devices with
+.B SendCoreEvents
+disabled will be \*qfloating\*q and only accessible by clients employing the
+X Input extension. This option controls the startup behavior only, a device
+may be reattached or set floating at runtime.
 .TP 4
 .BI "Option \*qHistorySize\*q  \*q" number \*q
 Sets the motion history size.
commit 93294355a0429e1f009386632a5fb19d8722c61f
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Dec 14 08:43:19 2009 +1000

    xfree86: update man page for special keys handling.
    
    SpecialKeyHandling was removed from the kbd driver with version 1.4.0. Since
    this is the only version that will build against server 1.7+ it's not
    reasonable to mention it in the man page. Reword, point to XKB instead and
    make clear that some key combinations _may_ not be available in any given
    config.
    
    Reported-by: Derek Fawcus
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at sun.com>
    (cherry picked from commit 801bc8075aee664bd4c6b6ff842ab737c143a1de)

diff --git a/hw/xfree86/doc/man/Xorg.man.pre b/hw/xfree86/doc/man/Xorg.man.pre
index 80b1225..8e86a37 100644
--- a/hw/xfree86/doc/man/Xorg.man.pre
+++ b/hw/xfree86/doc/man/Xorg.man.pre
@@ -421,18 +421,12 @@ The
 .B __xservername__
 server is normally configured to recognize various special combinations
 of key presses that instruct the server to perform some action, rather
-than just sending the key press event to a client application.  The
-default XKEYBOARD keymap defines the key combinations listed below.
-The kbd (__drivermansuffix__) driver also has these key combinations
-builtin to its event handler
-for cases where the XKEYBOARD extension is not being used.  When using
-the XKEYBOARD extension, which key combinations perform which actions
-is completely configurable.
+than just sending the key press event to a client application. These actions
+depend on the XKB keymap loaded by a particular keyboard device and may or
+may not be available on a given configuration.
 .PP
-The special combinations of key presses recognized directly
-by
-.B __xservername__
-are:
+The following key combinations are commonly part of the default XKEYBOARD
+keymap.
 .TP 8
 .B Ctrl+Alt+Backspace
 Immediately kills the server -- no questions asked. It can be disabled by
commit 9941075acbeb2d069f78072cf710131b8cacc5ab
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Dec 14 08:41:18 2009 +1000

    xfree86: DontZap has been disabled for a while now, say so in the man page.
    
    1.7 always shipped with DontZap disabled, it's just the default keymaps that
    may not include the symbol to trigger it.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at sun.com>
    (cherry picked from commit 753310837cd3812882d8de67f063bb61813db675)

diff --git a/hw/xfree86/doc/man/Xorg.man.pre b/hw/xfree86/doc/man/Xorg.man.pre
index 2f9ff98..80b1225 100644
--- a/hw/xfree86/doc/man/Xorg.man.pre
+++ b/hw/xfree86/doc/man/Xorg.man.pre
@@ -435,11 +435,10 @@ by
 are:
 .TP 8
 .B Ctrl+Alt+Backspace
-Immediately kills the server -- no questions asked.  This is disabled by
-default.  It can be enabled with the -retro command line flag or by setting
-the
+Immediately kills the server -- no questions asked. It can be disabled by
+setting the
 .B DontZap
-__xconfigfile__(__filemansuffix__) file option to a FALSE value.
+__xconfigfile__(__filemansuffix__) file option to a TRUE value.
 .TP 8
 .B Ctrl+Alt+Keypad-Plus
 Change video mode to next one specified in the configuration file.
commit 7f6fc40bedb31a2c1f6723f0e7b9a7654560d69f
Author: Julien Cristau <jcristau at debian.org>
Date:   Tue Dec 22 17:14:09 2009 +0100

    test/xi2: fix maximum max_keycode (bug#25492)
    
    The number of keycodes needs to be lower than 0xFFFD so that the length
    field of xXIKeyInfo doesn't overflow.
    
    Signed-off-by: Julien Cristau <jcristau at debian.org>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit b44c9be244cee286835855483a69c69e80b095c0)

diff --git a/test/xi2/protocol-eventconvert.c b/test/xi2/protocol-eventconvert.c
index 65ddec5..66686cb 100644
--- a/test/xi2/protocol-eventconvert.c
+++ b/test/xi2/protocol-eventconvert.c
@@ -834,7 +834,7 @@ static void test_convert_XIDeviceChangedEvent(void)
     in.keys.max_keycode = 1 << 8;
     test_XIDeviceChangedEvent(&in);
 
-    in.keys.max_keycode = 0xFFFD; /* highest range, above that the length
+    in.keys.max_keycode = 0xFFFC; /* highest range, above that the length
                                      field gives up */
     test_XIDeviceChangedEvent(&in);
 
commit 7cdc00cac817843c913ad442261a43646eb4240e
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri Dec 11 16:42:43 2009 -0800

    Xfake: Nuke -Wl,-undefined=InitExtensions from LDFLAGS
    
    This is not portable, and accodring to Paulo should not be required any more.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>
    (cherry picked from commit d50319550458f8127298cf8672b47f914b74ab1f)

diff --git a/hw/kdrive/fake/Makefile.am b/hw/kdrive/fake/Makefile.am
index 71b24b7..be0fa42 100644
--- a/hw/kdrive/fake/Makefile.am
+++ b/hw/kdrive/fake/Makefile.am
@@ -20,7 +20,7 @@ Xfake_LDADD = 						\
 	libfake.la					\
 	@KDRIVE_LIBS@
 
-Xfake_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) -Wl,-undefined=InitExtensions
+Xfake_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG)
 
 Xfake_DEPENDENCIES =	\
 	libfake.la					\
commit 6cdb0afc9884a13a3fd2da0835fef4724ba94507
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Fri Dec 11 11:53:28 2009 -0800

    dtrace: Add Xserver-dtrace.h to CLEANFILES
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at sun.com>
    (cherry picked from commit ed7d2527190ec56aed38db19d9e958abe88441b9)

diff --git a/dix/Makefile.am b/dix/Makefile.am
index 1caa5d0..8917aea 100644
--- a/dix/Makefile.am
+++ b/dix/Makefile.am
@@ -70,4 +70,4 @@ endif
 dix.c:
 	touch $@
 
-CLEANFILES = dix.c
+CLEANFILES = dix.c Xserver-dtrace.h
commit 01921a2b82da627b223fb2690b4ccd5511437419
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Wed Dec 9 18:27:31 2009 -0800

    XQuartz: pbproxy: Fix building of standalone xpbproxy executable
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at freedesktop.org>
    (cherry picked from commit 97a6454ea57587db490873fee8ff0f899882972d)

diff --git a/hw/xquartz/pbproxy/Makefile.am b/hw/xquartz/pbproxy/Makefile.am
index e1c537f..02da6b2 100644
--- a/hw/xquartz/pbproxy/Makefile.am
+++ b/hw/xquartz/pbproxy/Makefile.am
@@ -15,6 +15,9 @@ if STANDALONE_XPBPROXY
 bin_PROGRAMS = xpbproxy
 xpbproxy_SOURCES = app-main.m
 xpbproxy_LDADD = libxpbproxy.la
+xpbproxy_LDFLAGS = -Wl,-framework,Cocoa
+
+AM_CPPFLAGS += -DSTANDALONE_XPBPROXY
 
 endif
 
commit 2b8ba62f006ac56c98b1b91a4215581905223255
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Thu Dec 17 18:24:40 2009 -0800

    Change default xkb model from pc104 to pc105
    
    PC105 is a more useful default for non-American keyboard users,
    not harmful for American PC101/PC104 keyboard users.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 1df4bd6011e110dcf0649b15bfffd4ab9e6961d6)

diff --git a/configure.ac b/configure.ac
index 6353216..833a092 100644
--- a/configure.ac
+++ b/configure.ac
@@ -510,9 +510,9 @@ AC_ARG_WITH(default-xkb-rules, AS_HELP_STRING([--with-default-xkb-rules=RULES],
                                 [ XKB_DFLT_RULES="$withval" ],
                                 [ XKB_DFLT_RULES="" ])
 AC_ARG_WITH(default-xkb-model, AS_HELP_STRING([--with-default-xkb-model=MODEL],
-                                   [Keyboard model (default: pc104)]),
+                                   [Keyboard model (default: pc105)]),
                                 [ XKB_DFLT_MODEL="$withval" ],
-                                [ XKB_DFLT_MODEL="pc104" ])
+                                [ XKB_DFLT_MODEL="pc105" ])
 AC_ARG_WITH(default-xkb-layout, AS_HELP_STRING([--with-default-xkb-layout=LAYOUT],
                                    [Keyboard layout (default: us)]),
                                 [ XKB_DFLT_LAYOUT="$withval" ],
commit 0240ad48884476ad5e43a08d35c371f0dd9a0e44
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Thu Dec 17 18:24:38 2009 -0800

    Add platform compatibility defines for Sun Studio compilers
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 48749cc21b074ee8e68c3854bd3977ec7c408225)

diff --git a/hw/xfree86/common/compiler.h b/hw/xfree86/common/compiler.h
index a450bd6..ebb7f64 100644
--- a/hw/xfree86/common/compiler.h
+++ b/hw/xfree86/common/compiler.h
@@ -55,6 +55,20 @@
 # define DO_PROTOTYPES
 #endif
 
+/* Map Sun compiler platform defines to gcc-style used in the code */
+#if defined(__amd64) && !defined(__amd64__)
+# define __amd64__
+#endif
+#if defined(__i386) && !defined(__i386__)
+# define __i386__
+#endif
+#if defined(__sparc) && !defined(__sparc__)
+# define __sparc__
+#endif
+#if defined(__sparcv9) && !defined(__sparc64__)
+# define __sparc64__
+#endif
+
 #ifndef _X_EXPORT
 # include <X11/Xfuncproto.h>
 #endif
commit 17a1587d1606351d3f0b9b148e9c3cbfb6026193
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Thu Dec 17 18:24:37 2009 -0800

    Convert checks for PC98 support from platform #ifdefs to configure flag
    
    Default remains the same - on for most OS'es on i386 (except Solaris),
    off for everyone else.   Can be manually toggled via --enable-pc98 or
    --disable-pc98.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit b63912ed4c69fedd1bea92274d6cae0429a79677)

diff --git a/configure.ac b/configure.ac
index e501a37..6353216 100644
--- a/configure.ac
+++ b/configure.ac
@@ -560,6 +560,9 @@ AC_ARG_ENABLE(null-root-cursor, AS_HELP_STRING([--enable-null-root-cursor], [Use
 AC_ARG_ENABLE(visibility,     AC_HELP_STRING([--enable-visibility], [Enable symbol visibility (default: auto)]),
 				[SYMBOL_VISIBILITY=$enableval],
 				[SYMBOL_VISIBILITY=auto])
+AC_ARG_ENABLE(pc98,     	AC_HELP_STRING([--enable-pc98], [Enable PC98 support in Xorg (default: auto)]),
+				[SUPPORT_PC98=$enableval],
+				[SUPPORT_PC98=auto])
 
 dnl GLX build options
 AC_ARG_WITH(dri-driver-path,  AS_HELP_STRING([--with-dri-driver-path=PATH], [Path to DRI drivers (default: ${libdir}/dri)]),
@@ -1575,6 +1578,9 @@ if test "x$XORG" = xyes; then
 			XORG_CFLAGS="${XORG_CFLAGS} "'$(SOLARIS_ASM_CFLAGS)'
 		fi
 		AC_SUBST([SOLARIS_ASM_CFLAGS])
+		if test "x$SUPPORT_PC98" = xauto; then
+			SUPPORT_PC98="no"
+		fi
 		;;
 	  gnu*)
 	  	XORG_OS="gnu"
@@ -1596,8 +1602,19 @@ if test "x$XORG" = xyes; then
 	  sparc*)
 		xorg_bus_sparc="yes"
 		;;
+	  i*86)
+		if test "x$SUPPORT_PC98" = xauto; then
+			SUPPORT_PC98="yes"
+		fi
+		;;
 	esac
 
+	if test "x$SUPPORT_PC98" = xauto; then
+		SUPPORT_PC98="no"
+	fi
+	if test "x$SUPPORT_PC98" = xyes; then
+		AC_DEFINE(SUPPORT_PC98, 1, [Support PC98])
+	fi
 	if test "x$XORG_OS_PCI" = x ; then
 		XORG_OS_PCI=$XORG_OS
 	fi
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index a6d66f3..6fbf613 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -71,13 +71,6 @@ extern DeviceAssocRec mouse_assoc;
 #include "picture.h"
 #endif
 
-#if (defined(__i386__)) && \
-    (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
-     defined(__NetBSD__) || defined(linux) || \
-     (defined(SVR4) && !defined(sun)) || defined(__GNU__))
-#define SUPPORT_PC98
-#endif
-
 /*
  * These paths define the way the config file search is done.  The escape
  * sequences are documented in parser/scan.c.
@@ -778,11 +771,10 @@ static OptionInfoRec FlagOptions[] = {
 	{0}, FALSE },
 };
 
-#ifdef __i386__
+#ifdef SUPPORT_PC98
 static Bool
 detectPC98(void)
 {
-#ifdef SUPPORT_PC98
     unsigned char buf[2];
 
     if (xf86ReadBIOS(0xf8000, 0xe80, buf, 2) != 2)
@@ -791,11 +783,8 @@ detectPC98(void)
 	return TRUE;
     else
 	return FALSE;
-#else
-    return FALSE;
-#endif
 }
-#endif /* __i386__ */
+#endif
 
 static Bool
 configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
@@ -1054,7 +1043,7 @@ configServerFlags(XF86ConfFlagsPtr flagsconf, XF86OptionPtr layoutopts)
 	xf86Info.pixmap24 = Pix24DontCare;
 	xf86Info.pix24From = X_DEFAULT;
     }
-#ifdef __i386__
+#ifdef SUPPORT_PC98
     if (xf86GetOptValBool(FlagOptions, FLAG_PC98, &value)) {
 	xf86Info.pc98 = value;
 	if (value) {
diff --git a/hw/xfree86/common/xf86Globals.c b/hw/xfree86/common/xf86Globals.c
index d8f7f7f..98f8284 100644
--- a/hw/xfree86/common/xf86Globals.c
+++ b/hw/xfree86/common/xf86Globals.c
@@ -124,7 +124,7 @@ xf86InfoRec xf86Info = {
     .miscModInDevAllowNonLocal  = FALSE,
     .pixmap24                   = Pix24DontCare,
     .pix24From                  = X_DEFAULT,
-#ifdef __i386__
+#ifdef SUPPORT_PC98
     .pc98                       = FALSE,
 #endif
     .pmFlag                     = TRUE,
diff --git a/hw/xfree86/common/xf86Helper.c b/hw/xfree86/common/xf86Helper.c
index 56ab266..1cc1526 100644
--- a/hw/xfree86/common/xf86Helper.c
+++ b/hw/xfree86/common/xf86Helper.c
@@ -2140,7 +2140,7 @@ xf86GetAllowMouseOpenFail(void)
 Bool
 xf86IsPc98(void)
 {
-#ifdef __i386__
+#if SUPPORT_PC98
     return xf86Info.pc98;
 #else
     return FALSE;
diff --git a/hw/xfree86/common/xf86Privstr.h b/hw/xfree86/common/xf86Privstr.h
index 9982601..b2095aa 100644
--- a/hw/xfree86/common/xf86Privstr.h
+++ b/hw/xfree86/common/xf86Privstr.h
@@ -91,7 +91,7 @@ typedef struct {
 						   input device events */
     Pix24Flags		pixmap24;
     MessageType		pix24From;
-#ifdef __i386__
+#ifdef SUPPORT_PC98
     Bool		pc98;
 #endif
     Bool		pmFlag;
diff --git a/include/xorg-config.h.in b/include/xorg-config.h.in
index 794de7a..9fe7cde 100644
--- a/include/xorg-config.h.in
+++ b/include/xorg-config.h.in
@@ -133,4 +133,7 @@
 /* Use SIGIO handlers for input device events by default */
 #undef USE_SIGIO_BY_DEFAULT
 
+/* Support PC98 */
+#undef SUPPORT_PC98
+
 #endif /* _XORG_CONFIG_H_ */
commit 2d6a8f668342a5190cdf43b5d385f592d10f5900
Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Dec 21 12:26:26 2009 +1000

    fb: backport fb changes from master for src window operations.
    
    This rolls up the following commits and also keeps the image_from_pict
    API compatiblity. It introduces a new image_from_pict_18 API that is
    used by the server leaving the old API alone.
    
    I've rolled this up as I don't want to introduce ABI breaks in bisection.
    
    a72c65e9176c51de95db2fdbf4c5d946a4911695 fb: Adjust transform or composite coordinates for pixman operations
    bd567061c8b84b268d9bbb01bc4d8981feefb862 Split fbGetDrawable into fbGetDrawablePixmap and fbGetPixmapBitsData
    61335052972a78d67c0ba74f902273b34c63a198 Revert "Fix clipping when windows are used as sources"
    071b3c1810d9f2602173acc8578caac20e0b771e Revert "Use IncludeInferiors when copying windows before compositing."
    8e640d6b131d2865a9725d8997023865b0ef3d69 Revert "Reserve space for two GC values in copy_drawable()."
    
    Signed-off-by: Dave Airlie <airlied at redhat.com>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/fb/fb.h b/fb/fb.h
index 37de71e..8b2839a 100644
--- a/fb/fb.h
+++ b/fb/fb.h
@@ -700,38 +700,41 @@ typedef struct {
 #define __fbPixOffXPix(pPix)	(__fbPixDrawableX(pPix))
 #define __fbPixOffYPix(pPix)	(__fbPixDrawableY(pPix))
 
-#define fbGetDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
-    PixmapPtr   _pPix; \
-    if ((pDrawable)->type != DRAWABLE_PIXMAP) { \
-	_pPix = fbGetWindowPixmap(pDrawable); \
-	(xoff) = __fbPixOffXWin(_pPix); \
-	(yoff) = __fbPixOffYWin(_pPix); \
-    } else { \
-	_pPix = (PixmapPtr) (pDrawable); \
-	(xoff) = __fbPixOffXPix(_pPix); \
-	(yoff) = __fbPixOffYPix(_pPix); \
-    } \
-    fbPrepareAccess(pDrawable); \
-    (pointer) = (FbBits *) _pPix->devPrivate.ptr; \
-    (stride) = ((int) _pPix->devKind) / sizeof (FbBits); (void)(stride); \
-    (bpp) = _pPix->drawable.bitsPerPixel;  (void)(bpp); \
+#define fbGetDrawablePixmap(pDrawable, pixmap, xoff, yoff) {			\
+    if ((pDrawable)->type != DRAWABLE_PIXMAP) { 				\
+	(pixmap) = fbGetWindowPixmap(pDrawable);				\
+	(xoff) = __fbPixOffXWin(pixmap); 					\
+	(yoff) = __fbPixOffYWin(pixmap); 					\
+    } else { 									\
+	(pixmap) = (PixmapPtr) (pDrawable);					\
+	(xoff) = __fbPixOffXPix(pixmap); 					\
+	(yoff) = __fbPixOffYPix(pixmap); 					\
+    } 										\
+    fbPrepareAccess(pDrawable); 						\
 }
 
-#define fbGetStipDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { \
-    PixmapPtr   _pPix; \
-    if ((pDrawable)->type != DRAWABLE_PIXMAP) { \
-	_pPix = fbGetWindowPixmap(pDrawable); \
-	(xoff) = __fbPixOffXWin(_pPix); \
-	(yoff) = __fbPixOffYWin(_pPix); \
-    } else { \
-	_pPix = (PixmapPtr) (pDrawable); \
-	(xoff) = __fbPixOffXPix(_pPix); \
-	(yoff) = __fbPixOffYPix(_pPix); \
-    } \
-    fbPrepareAccess(pDrawable); \
-    (pointer) = (FbStip *) _pPix->devPrivate.ptr; \
-    (stride) = ((int) _pPix->devKind) / sizeof (FbStip); (void)(stride); \
-    (bpp) = _pPix->drawable.bitsPerPixel; (void)(bpp); \
+#define fbGetPixmapBitsData(pixmap, pointer, stride, bpp) {			\
+    (pointer) = (FbBits *) (pixmap)->devPrivate.ptr; 			       	\
+    (stride) = ((int) (pixmap)->devKind) / sizeof (FbBits); (void)(stride);	\
+    (bpp) = (pixmap)->drawable.bitsPerPixel;  (void)(bpp); 			\
+}
+
+#define fbGetPixmapStipData(pixmap, pointer, stride, bpp) {			\
+    (pointer) = (FbStip *) (pixmap)->devPrivate.ptr; 			       	\
+    (stride) = ((int) (pixmap)->devKind) / sizeof (FbStip); (void)(stride);	\
+    (bpp) = (pixmap)->drawable.bitsPerPixel;  (void)(bpp); 			\
+}
+
+#define fbGetDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { 		\
+    PixmapPtr   _pPix; 								\
+    fbGetDrawablePixmap(pDrawable, _pPix, xoff, yoff); 				\
+    fbGetPixmapBitsData(_pPix, pointer, stride, bpp);				\
+}
+
+#define fbGetStipDrawable(pDrawable, pointer, stride, bpp, xoff, yoff) { 	\
+    PixmapPtr   _pPix; 								\
+    fbGetDrawablePixmap(pDrawable, _pPix, xoff, yoff);				\
+    fbGetPixmapStipData(_pPix, pointer, stride, bpp);				\
 }
 
 /*
@@ -2079,9 +2082,16 @@ fbFillRegionSolid (DrawablePtr	pDrawable,
 		   FbBits	xor);
 
 extern _X_EXPORT pixman_image_t *
-image_from_pict (PicturePtr pict,
-		 Bool       has_clip,
-		 Bool       is_src);
+image_from_pict (PicturePtr	pict,
+		 Bool		has_clip,
+		 Bool		is_src);
+
+extern _X_EXPORT pixman_image_t *
+image_from_pict_18 (PicturePtr	pict,
+		 Bool		has_clip,
+		 int		*xoff,
+		 int		*yoff);
+
 extern _X_EXPORT void free_pixman_pict (PicturePtr, pixman_image_t *);
 
 #endif /* _FB_H_ */
diff --git a/fb/fbpict.c b/fb/fbpict.c
index 8fdaa58..f9f4343 100644
--- a/fb/fbpict.c
+++ b/fb/fbpict.c
@@ -158,19 +158,24 @@ fbComposite (CARD8      op,
 	     CARD16     height)
 {
     pixman_image_t *src, *mask, *dest;
+    int src_xoff, src_yoff;
+    int msk_xoff, msk_yoff;
+    int dst_xoff, dst_yoff;
     
-    miCompositeSourceValidate (pSrc, xSrc, ySrc, width, height);
+    miCompositeSourceValidate (pSrc, xSrc - xDst, ySrc - yDst, width, height);
     if (pMask)
-	miCompositeSourceValidate (pMask, xMask, yMask, width, height);
+	miCompositeSourceValidate (pMask, xMask - xDst, yMask - yDst, width, height);
     
-    src = image_from_pict (pSrc, TRUE, TRUE);
-    mask = image_from_pict (pMask, TRUE, TRUE);
-    dest = image_from_pict (pDst, TRUE, FALSE);
+    src = image_from_pict_18 (pSrc, FALSE, &src_xoff, &src_yoff);
+    mask = image_from_pict_18 (pMask, FALSE, &msk_xoff, &msk_yoff);
+    dest = image_from_pict_18 (pDst, TRUE, &dst_xoff, &dst_yoff);
 
     if (src && dest && !(pMask && !mask))
     {
 	pixman_image_composite (op, src, mask, dest,
-				xSrc, ySrc, xMask, yMask, xDst, yDst,
+				xSrc + src_xoff, ySrc + src_yoff,
+				xMask + msk_xoff, yMask + msk_yoff,
+				xDst + dst_xoff, yDst + dst_yoff,
 				width, height);
     }
 
@@ -270,22 +275,22 @@ create_conical_gradient_image (PictGradient *gradient)
 
 static pixman_image_t *
 create_bits_picture (PicturePtr pict,
-		     Bool       has_clip)
+		     Bool       has_clip,
+		     int	*xoff,
+		     int	*yoff)
 {
+    PixmapPtr pixmap;
     FbBits *bits;
     FbStride stride;
-    int bpp, xoff, yoff;
+    int bpp;
     pixman_image_t *image;
     
-    fbGetDrawable (pict->pDrawable, bits, stride, bpp, xoff, yoff);
-
-    bits = (FbBits*)((CARD8*)bits +
-		     (pict->pDrawable->y + yoff) * stride * sizeof(FbBits) +
-		     (pict->pDrawable->x + xoff) * (bpp / 8));
+    fbGetDrawablePixmap (pict->pDrawable, pixmap, *xoff, *yoff);
+    fbGetPixmapBitsData(pixmap, bits, stride, bpp);
 
     image = pixman_image_create_bits (
 	pict->format,
-	pict->pDrawable->width, pict->pDrawable->height,
+	pixmap->drawable.width, pixmap->drawable.height,
 	(uint32_t *)bits, stride * sizeof (FbStride));
     
     
@@ -311,30 +316,52 @@ create_bits_picture (PicturePtr pict,
 	if (pict->clientClipType != CT_NONE)
 	    pixman_image_set_has_client_clip (image, TRUE);
 
-	pixman_region_translate (pict->pCompositeClip, - pict->pDrawable->x, - pict->pDrawable->y);
+	if (*xoff || *yoff)
+	    pixman_region_translate (pict->pCompositeClip, *xoff, *yoff);
 
 	pixman_image_set_clip_region (image, pict->pCompositeClip);
 
-	pixman_region_translate (pict->pCompositeClip, pict->pDrawable->x, pict->pDrawable->y);
+	if (*xoff || *yoff)
+	    pixman_region_translate (pict->pCompositeClip, -*xoff, -*yoff);
     }
     
     /* Indexed table */
     if (pict->pFormat->index.devPrivate)
 	pixman_image_set_indexed (image, pict->pFormat->index.devPrivate);
 
+    /* Add in drawable origin to position within the image */
+    *xoff += pict->pDrawable->x;
+    *yoff += pict->pDrawable->y;
+
     return image;
 }
 
 static void
-set_image_properties (pixman_image_t *image, PicturePtr pict)
+set_image_properties (pixman_image_t *image, PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
 {
     pixman_repeat_t repeat;
     pixman_filter_t filter;
     
     if (pict->transform)
     {
-	pixman_image_set_transform (
-	    image, (pixman_transform_t *)pict->transform);
+	/* For source images, adjust the transform to account
+	 * for the drawable offset within the pixman image,
+	 * then set the offset to 0 as it will be used
+	 * to compute positions within the transformed image.
+	 */
+	if (!has_clip) {
+	    struct pixman_transform	adjusted;
+
+	    adjusted = *pict->transform;
+	    pixman_transform_translate(&adjusted,
+				       NULL,
+				       pixman_int_to_fixed(*xoff),
+				       pixman_int_to_fixed(*yoff));
+	    pixman_image_set_transform (image, &adjusted);
+	    *xoff = 0;
+	    *yoff = 0;
+	} else
+	    pixman_image_set_transform (image, pict->transform);
     }
     
     switch (pict->repeatType)
@@ -361,7 +388,8 @@ set_image_properties (pixman_image_t *image, PicturePtr pict)
     
     if (pict->alphaMap)
     {
-	pixman_image_t *alpha_map = image_from_pict (pict->alphaMap, TRUE, TRUE);
+	int alpha_xoff, alpha_yoff;
+	pixman_image_t *alpha_map = image_from_pict_18 (pict->alphaMap, FALSE, &alpha_xoff, &alpha_yoff);
 	
 	pixman_image_set_alpha_map (
 	    image, alpha_map, pict->alphaOrigin.x, pict->alphaOrigin.y);
@@ -393,10 +421,9 @@ set_image_properties (pixman_image_t *image, PicturePtr pict)
     pixman_image_set_source_clipping (image, TRUE);
 }
 
+
 pixman_image_t *
-image_from_pict (PicturePtr pict,
-		 Bool has_clip,
-		 Bool is_src)
+image_from_pict_18 (PicturePtr pict, Bool has_clip, int *xoff, int *yoff)
 {
     pixman_image_t *image = NULL;
 
@@ -405,7 +432,7 @@ image_from_pict (PicturePtr pict,
 
     if (pict->pDrawable)
     {
-	image = create_bits_picture (pict, has_clip);
+	image = create_bits_picture (pict, has_clip, xoff, yoff);
     }
     else if (pict->pSourcePict)
     {
@@ -429,11 +456,18 @@ image_from_pict (PicturePtr pict,
     }
     
     if (image)
-	set_image_properties (image, pict);
+	set_image_properties (image, pict, has_clip, xoff, yoff);
     
     return image;
 }
 
+pixman_image_t *
+image_from_pict (PicturePtr pict, Bool has_clip, Bool is_src)
+{
+    int xoff = 0, yoff = 0;
+    return image_from_pict_18(pict, has_clip, &xoff, &yoff);
+}
+
 void
 free_pixman_pict (PicturePtr pict, pixman_image_t *image)
 {
@@ -463,3 +497,4 @@ fbPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
 
     return TRUE;
 }
+
diff --git a/fb/fbtrap.c b/fb/fbtrap.c
index b1e1eff..5b5aeae 100644
--- a/fb/fbtrap.c
+++ b/fb/fbtrap.c
@@ -40,7 +40,8 @@ fbAddTraps (PicturePtr	pPicture,
 	    int		ntrap,
 	    xTrap	*traps)
 {
-    pixman_image_t *image = image_from_pict (pPicture, FALSE, FALSE);
+    int image_xoff, image_yoff;
+    pixman_image_t *image = image_from_pict_18 (pPicture, FALSE, &image_xoff, &image_yoff);
 
     if (!image)
 	return;
@@ -56,7 +57,8 @@ fbRasterizeTrapezoid (PicturePtr    pPicture,
 		      int	    x_off,
 		      int	    y_off)
 {
-    pixman_image_t *image = image_from_pict (pPicture, FALSE, FALSE);
+    int	mask_xoff, mask_yoff;
+    pixman_image_t *image = image_from_pict_18 (pPicture, FALSE, &mask_xoff, &mask_yoff);
 
     if (!image)
 	return;
diff --git a/fb/wfbrename.h b/fb/wfbrename.h
index 73ee510..e9cdca8 100644
--- a/fb/wfbrename.h
+++ b/fb/wfbrename.h
@@ -187,4 +187,5 @@
 #define fbZeroSegment wfbZeroSegment
 #define free_pixman_pict wfb_free_pixman_pict
 #define image_from_pict wfb_image_from_pict
+#define image_from_pict_18 wfb_image_from_pict_18
 #define composeFunctions wfbComposeFunctions
commit a2daadf914fda5177832c2d673b155083ec219ff
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Mon Dec 14 18:46:00 2009 -0800

    Add freetype & type1 to the LoadModules ignore list
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>
    Acked-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index e1283f9..a6d66f3 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -249,7 +249,9 @@ xf86ModulelistFromConfig(pointer **optlist)
 {
     int count = 0, i = 0;
     char **modulearray;
-    char *ignore[] = { "GLcore", "speedo", "bitmap", "drm", NULL };
+    char *ignore[] = { "GLcore", "speedo", "bitmap", "drm",
+		       "freetype", "type1",
+		       NULL };
     pointer *optarray;
     XF86LoadPtr modp;
     Bool found;
commit 4548366c222e57515b8add199109dc428157dd66
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Tue Dec 15 15:54:22 2009 -0800

    Update Sun license notices to current X.Org standard form
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>
    Acked-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/COPYING b/COPYING
index 74a3dd1..6bc9b4d 100644
--- a/COPYING
+++ b/COPYING
@@ -19,6 +19,7 @@ Copyright © 1999 Keith Packard
 Copyright © 2007-2009 Red Hat, Inc.
 Copyright © 2005-2008 Daniel Stone
 Copyright © 2006-2009 Simon Thum
+Copyright © 1987, 2003-2006, 2008-2009 Sun Microsystems, Inc.
 Copyright © 2006 Luc Verhaegen
 
 Permission is hereby granted, free of charge, to any person obtaining a
@@ -164,32 +165,6 @@ OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
 
-Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
-All Rights Reserved
-
-Permission  to  use,  copy,  modify,  and  distribute   this
-software  and  its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright no-
-tice  appear  in all copies and that both that copyright no-
-tice and this permission notice appear in  supporting  docu-
-mentation,  and  that the names of Sun or X Consortium
-not be used in advertising or publicity pertaining to
-distribution  of  the software  without specific prior
-written permission. Sun and X Consortium make no
-representations about the suitability of this software for
-any purpose. It is provided "as is" without any express or
-implied warranty.
-
-SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO  THIS  SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
-NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE  LI-
-ABLE  FOR  ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,  DATA  OR
-PROFITS,  WHETHER  IN  AN  ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-
 Copyright 1987-1991, 1993 by Digital Equipment Corporation, Maynard, Massachusetts.
 Copyright 1991 Massachusetts Institute of Technology, Cambridge, Massachusetts.
 Copyright 1991, 1993 Olivetti Research Limited, Cambridge, England.
@@ -1406,7 +1381,6 @@ Copyright 1987, 1998  The Open Group
 Copyright © 1998-1999, 2001 The XFree86 Project, Inc.
 Copyright © 2000 VA Linux Systems, Inc.
 Copyright (c) 2000, 2001 Nokia Home Communications
-Copyright 2003-2006, 2008 Sun Microsystems, Inc.
 Copyright © 2007, 2008 Red Hat, Inc.
 All rights reserved.
 
diff --git a/composite/compalloc.c b/composite/compalloc.c
index 3f427db..73adc72 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -2,29 +2,23 @@
  * Copyright © 2006 Sun Microsystems, Inc.  All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
  *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
  *
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  *
  * Copyright © 2003 Keith Packard
  *
diff --git a/composite/compext.c b/composite/compext.c
index 976d002..b5afdd3 100644
--- a/composite/compext.c
+++ b/composite/compext.c
@@ -2,29 +2,23 @@
  * Copyright © 2006 Sun Microsystems, Inc.  All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
  *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
  *
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  *
  * Copyright © 2003 Keith Packard
  *
diff --git a/composite/compinit.c b/composite/compinit.c
index 9b033c8..e8b563d 100644
--- a/composite/compinit.c
+++ b/composite/compinit.c
@@ -2,29 +2,23 @@
  * Copyright © 2006 Sun Microsystems, Inc.  All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
  *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
  *
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  *
  * Copyright © 2003 Keith Packard
  *
diff --git a/composite/compint.h b/composite/compint.h
index 852c277..845a196 100644
--- a/composite/compint.h
+++ b/composite/compint.h
@@ -2,29 +2,23 @@
  * Copyright © 2006 Sun Microsystems, Inc.  All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
  *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
  *
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  *
  * Copyright © 2003 Keith Packard
  *
diff --git a/composite/compoverlay.c b/composite/compoverlay.c
index e213ce7..6d73f00 100644
--- a/composite/compoverlay.c
+++ b/composite/compoverlay.c
@@ -2,29 +2,23 @@
  * Copyright © 2006 Sun Microsystems, Inc.  All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
  *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
  *
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  *
  * Copyright © 2003 Keith Packard
  *
diff --git a/composite/compwindow.c b/composite/compwindow.c
index 4267a51..2f5a717 100644
--- a/composite/compwindow.c
+++ b/composite/compwindow.c
@@ -2,29 +2,23 @@
  * Copyright © 2006 Sun Microsystems, Inc.  All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
  *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
  *
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  *
  * Copyright © 2003 Keith Packard
  *
diff --git a/dix/Xserver-dtrace.h.in b/dix/Xserver-dtrace.h.in
index 26a8b40..fce2836 100644
--- a/dix/Xserver-dtrace.h.in
+++ b/dix/Xserver-dtrace.h.in
@@ -1,29 +1,23 @@
 /* Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
  *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
  *
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  */ 
 
 /*
diff --git a/dix/Xserver.d b/dix/Xserver.d
index cea97e9..4bc0b9a 100644
--- a/dix/Xserver.d
+++ b/dix/Xserver.d
@@ -1,29 +1,23 @@
 /* Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- * 
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  */
 
 /*
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 414bd04..982c808 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -78,29 +78,23 @@ Equipment Corporation.
  * Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- * 
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  */
 
 
diff --git a/dix/events.c b/dix/events.c
index 1d7ceef..e24e0c5 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -74,38 +74,28 @@ Equipment Corporation.
 
 ******************************************************************/
 
-/*****************************************************************
-
-Copyright 2003-2005 Sun Microsystems, Inc.
-
-All rights reserved.
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, and/or sell copies of the Software, and to permit persons
-to whom the Software is furnished to do so, provided that the above
-copyright notice(s) and this permission notice appear in all copies of
-the Software and that both the above copyright notice(s) and this
-permission notice appear in supporting documentation.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
-HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
-INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
-FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
-WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-Except as contained in this notice, the name of a copyright holder
-shall not be used in advertising or otherwise to promote the sale, use
-or other dealings in this Software without prior written authorization
-of the copyright holder.
-
-******************************************************************/
+/*
+ * Copyright © 2003-2005 Sun Microsystems, Inc.  All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
 
 /** @file events.c
  * This file handles event delivery and a big part of the server-side protocol
diff --git a/dix/resource.c b/dix/resource.c
index d3641df..e1fdad4 100644
--- a/dix/resource.c
+++ b/dix/resource.c
@@ -76,29 +76,23 @@ Equipment Corporation.
  * Copyright 2005-2006 Sun Microsystems, Inc.  All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- * 
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  */
 
 /*	Routines to manage various kinds of resources:
diff --git a/fb/fbcmap.c b/fb/fbcmap.c
index 207c6ae..2ff3234 100644
--- a/fb/fbcmap.c
+++ b/fb/fbcmap.c
@@ -1,32 +1,25 @@
-/************************************************************
-Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
-
-                    All Rights Reserved
-
-Permission  to  use,  copy,  modify,  and  distribute   this
-software  and  its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright no-
-tice  appear  in all copies and that both that copyright no-
-tice and this permission notice appear in  supporting  docu-
-mentation,  and  that the names of Sun or X Consortium
-not be used in advertising or publicity pertaining to 
-distribution  of  the software  without specific prior 
-written permission. Sun and X Consortium make no 
-representations about the suitability of this software for 
-any purpose. It is provided "as is" without any express or 
-implied warranty.
-
-SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO  THIS  SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
-NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE  LI-
-ABLE  FOR  ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,  DATA  OR
-PROFITS,  WHETHER  IN  AN  ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
+/*
+ * Copyright © 1987 Sun Microsystems, Inc.  All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
 
 #ifdef HAVE_DIX_CONFIG_H
 #include <dix-config.h>
diff --git a/fb/fbcmap_mi.c b/fb/fbcmap_mi.c
index 188decd..d75a38f 100644
--- a/fb/fbcmap_mi.c
+++ b/fb/fbcmap_mi.c
@@ -1,32 +1,25 @@
-/************************************************************
-Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
-
-                    All Rights Reserved
-
-Permission  to  use,  copy,  modify,  and  distribute   this
-software  and  its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright no-
-tice  appear  in all copies and that both that copyright no-
-tice and this permission notice appear in  supporting  docu-
-mentation,  and  that the names of Sun or X Consortium
-not be used in advertising or publicity pertaining to 
-distribution  of  the software  without specific prior 
-written permission. Sun and X Consortium make no 
-representations about the suitability of this software for 
-any purpose. It is provided "as is" without any express or 
-implied warranty.
-
-SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO  THIS  SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
-NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE  LI-
-ABLE  FOR  ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,  DATA  OR
-PROFITS,  WHETHER  IN  AN  ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
-
+/*
+ * Copyright © 1987 Sun Microsystems, Inc.  All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
 
 /**
  * This version of fbcmap.c is implemented in terms of mi functions.
diff --git a/hw/xfree86/os-support/solaris/solaris-amd64.S b/hw/xfree86/os-support/solaris/solaris-amd64.S
index 4a0e0f4..94ffa40 100644
--- a/hw/xfree86/os-support/solaris/solaris-amd64.S
+++ b/hw/xfree86/os-support/solaris/solaris-amd64.S
@@ -1,29 +1,23 @@
 / Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 / 
 / Permission is hereby granted, free of charge, to any person obtaining a
-/ copy of this software and associated documentation files (the
-/ "Software"), to deal in the Software without restriction, including
-/ without limitation the rights to use, copy, modify, merge, publish,
-/ distribute, and/or sell copies of the Software, and to permit persons
-/ to whom the Software is furnished to do so, provided that the above
-/ copyright notice(s) and this permission notice appear in all copies of
-/ the Software and that both the above copyright notice(s) and this
-/ permission notice appear in supporting documentation.
-/ 
-/ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-/ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-/ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-/ OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
-/ HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
-/ INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
-/ FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-/ NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
-/ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-/ 
-/ Except as contained in this notice, the name of a copyright holder
-/ shall not be used in advertising or otherwise to promote the sale, use
-/ or other dealings in this Software without prior written authorization
-/ of the copyright holder.
+/ copy of this software and associated documentation files (the "Software"),
+/ to deal in the Software without restriction, including without limitation
+/ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+/ and/or sell copies of the Software, and to permit persons to whom the
+/ Software is furnished to do so, subject to the following conditions:
+/
+/ The above copyright notice and this permission notice (including the next
+/ paragraph) shall be included in all copies or substantial portions of the
+/ Software.
+/
+/ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+/ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+/ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+/ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+/ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+/ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+/ DEALINGS IN THE SOFTWARE.
 
 #ifdef INLINE_ASM
 #define FUNCTION_START(f,n)	.inline f,n
diff --git a/hw/xfree86/os-support/solaris/solaris-ia32.S b/hw/xfree86/os-support/solaris/solaris-ia32.S
index 280154b..4dadf7f 100644
--- a/hw/xfree86/os-support/solaris/solaris-ia32.S
+++ b/hw/xfree86/os-support/solaris/solaris-ia32.S
@@ -1,29 +1,23 @@
 / Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
 / 
 / Permission is hereby granted, free of charge, to any person obtaining a
-/ copy of this software and associated documentation files (the
-/ "Software"), to deal in the Software without restriction, including
-/ without limitation the rights to use, copy, modify, merge, publish,
-/ distribute, and/or sell copies of the Software, and to permit persons
-/ to whom the Software is furnished to do so, provided that the above
-/ copyright notice(s) and this permission notice appear in all copies of
-/ the Software and that both the above copyright notice(s) and this
-/ permission notice appear in supporting documentation.
-/ 
-/ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-/ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-/ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-/ OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
-/ HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
-/ INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
-/ FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-/ NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
-/ WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-/ 
-/ Except as contained in this notice, the name of a copyright holder
-/ shall not be used in advertising or otherwise to promote the sale, use
-/ or other dealings in this Software without prior written authorization
-/ of the copyright holder.
+/ copy of this software and associated documentation files (the "Software"),
+/ to deal in the Software without restriction, including without limitation
+/ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+/ and/or sell copies of the Software, and to permit persons to whom the
+/ Software is furnished to do so, subject to the following conditions:
+/
+/ The above copyright notice and this permission notice (including the next
+/ paragraph) shall be included in all copies or substantial portions of the
+/ Software.
+/
+/ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+/ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+/ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+/ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+/ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+/ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+/ DEALINGS IN THE SOFTWARE.
 
 #ifdef INLINE_ASM
 #define FUNCTION_START(f,n)	.inline f,n
diff --git a/hw/xfree86/os-support/solaris/solaris-sparcv8plus.S b/hw/xfree86/os-support/solaris/solaris-sparcv8plus.S
index dbaa030..0f6d694 100644
--- a/hw/xfree86/os-support/solaris/solaris-sparcv8plus.S
+++ b/hw/xfree86/os-support/solaris/solaris-sparcv8plus.S
@@ -1,29 +1,23 @@
 /* Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- * 
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  */
 
 #ifdef INLINE_ASM
diff --git a/hw/xfree86/os-support/solaris/sun_VTsw.c b/hw/xfree86/os-support/solaris/sun_VTsw.c
index 0dc76b8..ded2f27 100644
--- a/hw/xfree86/os-support/solaris/sun_VTsw.c
+++ b/hw/xfree86/os-support/solaris/sun_VTsw.c
@@ -2,29 +2,23 @@
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
  *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
  *
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  */
 
 #ifdef HAVE_XORG_CONFIG_H
diff --git a/hw/xfree86/os-support/solaris/sun_agp.c b/hw/xfree86/os-support/solaris/sun_agp.c
index 376f98e..e6a55a4 100644
--- a/hw/xfree86/os-support/solaris/sun_agp.c
+++ b/hw/xfree86/os-support/solaris/sun_agp.c
@@ -9,29 +9,23 @@
 /* Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
  *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
  *
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  */
 
 #ifdef HAVE_XORG_CONFIG_H
diff --git a/hw/xfree86/os-support/solaris/sun_apm.c b/hw/xfree86/os-support/solaris/sun_apm.c
index e128c13..23e14f1 100644
--- a/hw/xfree86/os-support/solaris/sun_apm.c
+++ b/hw/xfree86/os-support/solaris/sun_apm.c
@@ -30,29 +30,23 @@
 /* Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
  *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
  *
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  */
 
 #ifdef HAVE_XORG_CONFIG_H
diff --git a/hw/xfree86/os-support/solaris/sun_bell.c b/hw/xfree86/os-support/solaris/sun_bell.c
index b25f40d..7f146ea 100644
--- a/hw/xfree86/os-support/solaris/sun_bell.c
+++ b/hw/xfree86/os-support/solaris/sun_bell.c
@@ -1,29 +1,23 @@
 /* Copyright 2004-2005 Sun Microsystems, Inc.  All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
- * 
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- * 
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  */
 
 #ifdef HAVE_XORG_CONFIG_H
diff --git a/hw/xfree86/os-support/solaris/sun_vid.c b/hw/xfree86/os-support/solaris/sun_vid.c
index 2078646..5089ae7 100644
--- a/hw/xfree86/os-support/solaris/sun_vid.c
+++ b/hw/xfree86/os-support/solaris/sun_vid.c
@@ -25,29 +25,23 @@
 /* Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
  *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
  *
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  */
 
 #ifdef HAVE_XORG_CONFIG_H
diff --git a/hw/xfree86/utils/cvt/Makefile.am b/hw/xfree86/utils/cvt/Makefile.am
index 5db1d7c..6b99cbd 100644
--- a/hw/xfree86/utils/cvt/Makefile.am
+++ b/hw/xfree86/utils/cvt/Makefile.am
@@ -1,29 +1,23 @@
 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
-# 
+#
 # Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, and/or sell copies of the Software, and to permit persons
-# to whom the Software is furnished to do so, provided that the above
-# copyright notice(s) and this permission notice appear in all copies of
-# the Software and that both the above copyright notice(s) and this
-# permission notice appear in supporting documentation.
-# 
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
-# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
-# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
-# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
-# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-# 
-# Except as contained in this notice, the name of a copyright holder
-# shall not be used in advertising or otherwise to promote the sale, use
-# or other dealings in this Software without prior written authorization
-# of the copyright holder.
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
 # 
 
 bin_PROGRAMS = cvt
diff --git a/hw/xfree86/utils/gtf/Makefile.am b/hw/xfree86/utils/gtf/Makefile.am
index b14d0c1..3ca568d 100644
--- a/hw/xfree86/utils/gtf/Makefile.am
+++ b/hw/xfree86/utils/gtf/Makefile.am
@@ -1,29 +1,23 @@
 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
-# 
+#
 # Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, and/or sell copies of the Software, and to permit persons
-# to whom the Software is furnished to do so, provided that the above
-# copyright notice(s) and this permission notice appear in all copies of
-# the Software and that both the above copyright notice(s) and this
-# permission notice appear in supporting documentation.
-# 
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
-# OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
-# HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
-# INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
-# FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
-# NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
-# WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-# 
-# Except as contained in this notice, the name of a copyright holder
-# shall not be used in advertising or otherwise to promote the sale, use
-# or other dealings in this Software without prior written authorization
-# of the copyright holder.
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
 # 
 
 bin_PROGRAMS = gtf
diff --git a/mi/micmap.c b/mi/micmap.c
index 1d26a52..e832be7 100644
--- a/mi/micmap.c
+++ b/mi/micmap.c
@@ -1,31 +1,25 @@
-/************************************************************
-Copyright 1987 by Sun Microsystems, Inc. Mountain View, CA.
-
-                    All Rights Reserved
-
-Permission  to  use,  copy,  modify,  and  distribute   this
-software  and  its documentation for any purpose and without
-fee is hereby granted, provided that the above copyright no-
-tice  appear  in all copies and that both that copyright no-
-tice and this permission notice appear in  supporting  docu-
-mentation,  and  that the names of Sun or X Consortium
-not be used in advertising or publicity pertaining to 
-distribution  of  the software  without specific prior 
-written permission. Sun and X Consortium make no 
-representations about the suitability of this software for 
-any purpose. It is provided "as is" without any express or 
-implied warranty.
-
-SUN DISCLAIMS ALL WARRANTIES WITH REGARD TO  THIS  SOFTWARE,
-INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FIT-
-NESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SUN BE  LI-
-ABLE  FOR  ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
-ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,  DATA  OR
-PROFITS,  WHETHER  IN  AN  ACTION OF CONTRACT, NEGLIGENCE OR
-OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION  WITH
-THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-********************************************************/
+/*
+ * Copyright © 1987 Sun Microsystems, Inc.  All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
 
 /*
  * This is based on cfbcmap.c.  The functions here are useful independently
diff --git a/os/access.c b/os/access.c
index 2a171fa..74c340a 100644
--- a/os/access.c
+++ b/os/access.c
@@ -1,7 +1,6 @@
 /***********************************************************
 
 Copyright 1987, 1998  The Open Group
-Copyright 2004 Sun Microsystems, Inc.
 
 All rights reserved.
 
@@ -54,6 +53,29 @@ SOFTWARE.
 
 ******************************************************************/
 
+/*
+ * Copyright © 2004 Sun Microsystems, Inc.  All rights reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
 #ifdef HAVE_DIX_CONFIG_H
 #include <dix-config.h>
 #endif
diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index aac90e3..60d4222 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -2,29 +2,23 @@
  * Copyright © 2006 Sun Microsystems, Inc.  All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
  *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
  *
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  *
  * Copyright © 2002 Keith Packard
  *
diff --git a/xfixes/xfixes.c b/xfixes/xfixes.c
index fa360b8..5163dc1 100644
--- a/xfixes/xfixes.c
+++ b/xfixes/xfixes.c
@@ -2,29 +2,23 @@
  * Copyright © 2006 Sun Microsystems, Inc.  All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
  *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
  *
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  *
  * Copyright © 2002 Keith Packard
  *
diff --git a/xfixes/xfixesint.h b/xfixes/xfixesint.h
index d7c53ee..f3d5361 100644
--- a/xfixes/xfixesint.h
+++ b/xfixes/xfixesint.h
@@ -2,29 +2,23 @@
  * Copyright © 2006 Sun Microsystems, Inc.  All rights reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, and/or sell copies of the Software, and to permit persons
- * to whom the Software is furnished to do so, provided that the above
- * copyright notice(s) and this permission notice appear in all copies of
- * the Software and that both the above copyright notice(s) and this
- * permission notice appear in supporting documentation.
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
  *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
- * OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
- * HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
- * INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
- * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
- * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
- * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
  *
- * Except as contained in this notice, the name of a copyright holder
- * shall not be used in advertising or otherwise to promote the sale, use
- * or other dealings in this Software without prior written authorization
- * of the copyright holder.
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
  *
  * Copyright © 2002 Keith Packard
  *
commit 02abf3dab6a4c331e1f64ef9a3c55d6dd64a2787
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Mon Nov 23 22:24:44 2009 -0800

    COPYING: Update license preamble
    
    Update the comment about "a modification is currently under discussion"
    since there hasn't been any such discussion for some time and this is
    the consensus agreed upon preferred format.
    
    Also throw in a pointer to the OSI discussion page about the MIT license.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>
    Signed-off-by: Daniel Stone <daniel at fooishbar.org>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/COPYING b/COPYING
index 5dc8c1d..74a3dd1 100644
--- a/COPYING
+++ b/COPYING
@@ -1,10 +1,12 @@
 The following is the 'standard copyright' agreed upon by most contributors,
-and is currently the canonical license, though a modification is currently
-under discussion.  Copyright holders of new code should use this license
-statement where possible, and append their name to this list.  Please sort
-by surname for people, and by the full name for other entities (e.g.
-Juliusz Chroboczek sorts before Intel Corporation sorts before Daniel
-Stone).
+and is currently the canonical license preferred by the X.Org Foundation.
+This is a slight variant of the common MIT license form published by the
+Open Source Initiative at http://www.opensource.org/licenses/mit-license.php
+
+Copyright holders of new code should use this license statement where
+possible, and insert their name to this list.  Please sort by surname
+for people, and by the full name for other entities (e.g.  Juliusz
+Chroboczek sorts before Intel Corporation sorts before Daniel Stone).
 
 Copyright © 2000-2001 Juliusz Chroboczek
 Copyright © 1998 Egbert Eich
commit 044b374c06db73ddb26275498ccb0c4fdf93d0f0
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Wed Nov 11 14:42:20 2009 -0800

    Fix builds with --with-int10=stub
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>
    Acked-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/xfree86/int10/Makefile.am b/hw/xfree86/int10/Makefile.am
index 78bef25..36d2ad0 100644
--- a/hw/xfree86/int10/Makefile.am
+++ b/hw/xfree86/int10/Makefile.am
@@ -38,6 +38,7 @@ endif
 
 if INT10_STUB
 AM_CFLAGS = $(I386_VIDEO_CFLAGS) -D_VM86_LINUX $(DIX_CFLAGS) $(XORG_CFLAGS) $(EXTRA_CFLAGS)
+INCLUDES = $(XORG_INCS)
 libint10_la_SOURCES = stub.c xf86int10module.c
 endif
 
diff --git a/hw/xfree86/x86emu/Makefile.am b/hw/xfree86/x86emu/Makefile.am
index 987ea8b..df96977 100644
--- a/hw/xfree86/x86emu/Makefile.am
+++ b/hw/xfree86/x86emu/Makefile.am
@@ -1,4 +1,6 @@
+if INT10_X86EMU
 noinst_LTLIBRARIES = libx86emu.la
+endif
 
 libx86emu_la_SOURCES = debug.c \
                       decode.c \
commit 1df3321a4002a00f56a05f86503123bcf9aa8db9
Merge: df84200... 601db11...
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Mon Dec 14 13:52:08 2009 +1000

    Merge branch 'server-1.7-branch' into server-1.7-nominations

commit df842009a99100d81c645fa2877a3a67a42b2563
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Thu Dec 3 11:21:31 2009 +1000

    Xi: reset device properties to NULL after deleting them. (#25374)
    
    Commit 0e6cee853d8e5bef3274e632ef034d37f14674a9 introduced cleanup code to
    remove the accel properties when switching schemes. The same code is
    triggered by the default closedown code but only after unconditionally
    removing all device properties (as part of the cleanup). The properties,
    although deleted never got reset to NULL.
    
    X.Org Bug 25374 <http://bugs.freedesktop.org/show_bug.cgi?id=25374>
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    Tested-by: Andy Furniss <lists at andyfurniss.entadsl.com>
    Reviewed-by: Dave Airlie <airlied at redhat.com>
    (cherry picked from commit ea14a418214ba4c58910f5650d8b25b3fc3a7099)

diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
index ecb326e..ea66c54 100644
--- a/Xi/xiproperty.c
+++ b/Xi/xiproperty.c
@@ -622,6 +622,8 @@ XIDeleteAllDeviceProperties (DeviceIntPtr device)
         XIDestroyDeviceProperty(prop);
     }
 
+    device->properties.properties = NULL;
+
     /* Now free all handlers */
     curr_handler = device->properties.handlers;
     while(curr_handler)
commit d55009f87fca7e2e160901af4755311cc6b0431f
Author: Tomas Carnecky <tom at dbservice.com>
Date:   Mon Dec 7 05:54:57 2009 +0100

    Fix possible NULL dereference in XkbFlushLedEvents()
    
    Through some code paths it is possible that NULL is being passed in the
    'ed' parameter to XkbFlushLedEvents(). Make sure we don't pass it along
    to bzero().
    
    Signed-off-by: Tomas Carnecky <tom at dbservice.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 886140787852c660978a9bb3abc7cc2702cbaed1)

diff --git a/xkb/xkbLEDs.c b/xkb/xkbLEDs.c
index 59cdba4..6ca80d7 100644
--- a/xkb/xkbLEDs.c
+++ b/xkb/xkbLEDs.c
@@ -745,12 +745,14 @@ XkbFlushLedEvents(	DeviceIntPtr			dev,
 			XkbDDXAccessXBeep(dev, _BEEP_LED_OFF, XkbAccessXFeedbackMask);
 	}
     }
-    if (ed && (ed->reason)) {
-	if ((dev!=kbd)&&(ed->reason&XkbXI_IndicatorStateMask))
-	    XkbDDXUpdateDeviceIndicators(dev,sli,sli->effectiveState);
-	XkbSendExtensionDeviceNotify(dev,cause->client,ed);
+    if (ed) {
+	if (ed->reason) {
+	    if ((dev!=kbd)&&(ed->reason&XkbXI_IndicatorStateMask))
+		XkbDDXUpdateDeviceIndicators(dev,sli,sli->effectiveState);
+	    XkbSendExtensionDeviceNotify(dev,cause->client,ed);
+	}
+	bzero((char *)ed,sizeof(XkbExtensionDeviceNotify));
     }
-    bzero((char *)ed,sizeof(XkbExtensionDeviceNotify));
     return;
 }
 
commit 601db11ffc49343807cf562175c2fe51eb6ec056
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Fri Dec 11 15:34:05 2009 +1000

    xserver 1.7.3.901
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/configure.ac b/configure.ac
index 0c98bf2..e501a37 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,8 +26,8 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.7.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2009-12-3"
+AC_INIT([xorg-server], 1.7.3.901, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2009-12-11"
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([dist-bzip2 foreign])
 AM_MAINTAINER_MODE


More information about the Xquartz-changes mailing list