xserver: Branch 'xorg-server-1.6-apple' - 16 commits

Jeremy Huddleston jeremyhu at kemper.freedesktop.org
Sat Feb 28 00:49:26 PST 2009


 config/hal.c                         |  111 ++++++++++++++-
 configure.ac                         |    8 -
 exa/exa_accel.c                      |  135 ------------------
 glx/glxscreens.c                     |    2 
 hw/xfree86/doc/man/xorg.conf.man.pre |   29 +++
 hw/xfree86/dri/dri.c                 |    2 
 hw/xfree86/loader/loaderProcs.h      |    1 
 hw/xfree86/modes/xf86RandR12.c       |  254 ++++++++++++++++++++++++++++++++---
 hw/xfree86/modes/xf86Rotate.c        |   31 ----
 hw/xfree86/parser/Files.c            |    6 
 hw/xfree86/parser/xf86tokens.h       |    1 
 randr/rrtransform.c                  |   28 +--
 12 files changed, 393 insertions(+), 215 deletions(-)

New commits:
commit 3b36a8688b8ccc1c8aa91eb8f1a61a2b9781917f
Merge: ccf5f7b... 60c1615...
Author: Jeremy Huddleston <jeremyhu at freedesktop.org>
Date:   Sat Feb 28 00:48:52 2009 -0800

    Merge commit 'origin/server-1.6-branch' into xorg-server-1.6-apple

commit 60c161545af80eb78eb790a05bde79409dfdf16e
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Feb 25 12:05:44 2009 -0800

    X server version 1.6.0
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index b4d18dd..f2718b8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,12 +26,12 @@ dnl
 dnl Process this file with autoconf to create configure.
 
 AC_PREREQ(2.57)
-AC_INIT([xorg-server], 1.5.99.903, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+AC_INIT([xorg-server], 1.6.0, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
 AC_CONFIG_SRCDIR([Makefile.am])
 AM_INIT_AUTOMAKE([dist-bzip2 foreign])
 AM_MAINTAINER_MODE
 
-RELEASE_DATE="2009-2-17"
+RELEASE_DATE="2009-2-25"
 
 dnl this gets generated by autoheader, and thus contains all the defines.  we
 dnl don't ever actually use it, internally.
commit e9a9f807971b8fb62b957c9d54b4aea7fb0f96ca
Author: Maarten Maathuis <madman2003 at gmail.com>
Date:   Fri Jan 30 19:32:33 2009 +0100

    exa: kill of exaImageGlyphBlt
    
    - It serves no obvious purpose, yet it directly accesses many fb
    symbols.
    (cherry picked from commit 5cc67ae94c066dcac78072ad8a819c3b602d8bab)

diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index f72a08a..453431e 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -856,139 +856,6 @@ out:
     REGION_DESTROY(pScreen, pReg);
 }
 
-static void
-exaImageGlyphBlt (DrawablePtr	pDrawable,
-		  GCPtr		pGC,
-		  int		x,
-		  int		y,
-		  unsigned int	nglyph,
-		  CharInfoPtr	*ppciInit,
-		  pointer	pglyphBase)
-{
-    FbGCPrivPtr	    pPriv = fbGetGCPrivate(pGC);
-    CharInfoPtr	    *ppci;
-    CharInfoPtr	    pci;
-    unsigned char   *pglyph;		/* pointer bits in glyph */
-    int		    gWidth, gHeight;	/* width and height of glyph */
-    FbStride	    gStride;		/* stride of glyph */
-    Bool	    opaque;
-    int		    gx, gy;
-    void	    (*glyph) (FbBits *,
-			      FbStride,
-			      int,
-			      FbStip *,
-			      FbBits,
-			      int,
-			      int);
-    FbBits	    *dst;
-    FbStride	    dstStride;
-    int		    dstBpp;
-    int		    dstXoff, dstYoff;
-    FbBits	    depthMask;
-    PixmapPtr	    pPixmap = exaGetDrawablePixmap(pDrawable);
-    ExaPixmapPriv(pPixmap);
-    RegionPtr	    pending_damage = NULL;
-    BoxRec	    extents;
-    int		    xoff, yoff;
-
-    if (pExaPixmap->pDamage)
-	pending_damage = DamagePendingRegion(pExaPixmap->pDamage);
-
-    if (pending_damage) {
-	extents = *REGION_EXTENTS(pScreen, pending_damage);
-
-	if (extents.x1 >= extents.x2 || extents.y1 >= extents.y2)
-	    return;
-
-	depthMask = FbFullMask(pDrawable->depth);
-    }
-
-    if (!pending_damage || (pGC->planemask & depthMask) != depthMask)
-    {
-	ExaCheckImageGlyphBlt(pDrawable, pGC, x, y, nglyph, ppciInit, pglyphBase);
-	return;
-    }
-
-    glyph = NULL;
-    switch (pDrawable->bitsPerPixel) {
-    case 8:	glyph = fbGlyph8; break;
-    case 16:    glyph = fbGlyph16; break;
-    case 24:    glyph = fbGlyph24; break;
-    case 32:    glyph = fbGlyph32; break;
-    }
-
-    x += pDrawable->x;
-    y += pDrawable->y;
-
-    exaGetDrawableDeltas(pDrawable, pPixmap, &xoff, &yoff);
-    extents.x1 -= xoff;
-    extents.x2 -= xoff;
-    extents.y1 -= yoff;
-    extents.y2 -= yoff;
-
-    exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pending_damage);
-
-    if (TERMINALFONT (pGC->font) && !glyph)
-    {
-	opaque = TRUE;
-    }
-    else
-    {
-	FbBits fg = fbReplicatePixel (pGC->bgPixel, pDrawable->bitsPerPixel);
-
-	fbSolidBoxClipped (pDrawable,
-			   fbGetCompositeClip(pGC),
-			   extents.x1,
-			   extents.y1,
-			   extents.x2,
-			   extents.y2,
-			   fbAnd (GXcopy, fg, pGC->planemask),
-			   fbXor (GXcopy, fg, pGC->planemask));
-
-	opaque = FALSE;
-    }
-
-    EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
-
-    exaPrepareAccessGC (pGC);
-
-    fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
-
-    for (ppci = ppciInit; nglyph; nglyph--, x += pci->metrics.characterWidth)
-    {
-	pci = *ppci++;
-	gWidth = GLYPHWIDTHPIXELS(pci);
-	gHeight = GLYPHHEIGHTPIXELS(pci);
-	gx = x + pci->metrics.leftSideBearing;
-	gy = y - pci->metrics.ascent;
-
-	if (!gWidth || !gHeight || (gx + gWidth) <= extents.x1 ||
-	    (gy + gHeight) <= extents.y1 || gx >= extents.x2 ||
-	    gy >= extents.y2)
-	    continue;
-
-	pglyph = FONTGLYPHBITS(pglyphBase, pci);
-
-	if (glyph && gWidth <= sizeof (FbStip) * 8 &&
-	    fbGlyphIn (fbGetCompositeClip(pGC), gx, gy, gWidth, gHeight))
-	{
-	    (*glyph) (dst + (gy + dstYoff) * dstStride, dstStride, dstBpp,
-		      (FbStip *) pglyph, pPriv->fg, gx + dstXoff, gHeight);
-	}
-	else
-	{
-	    RegionPtr pClip = fbGetCompositeClip(pGC);
-
-	    gStride = GLYPHWIDTHBYTESPADDED(pci) / sizeof (FbStip);
-	    fbPutXYImage (pDrawable, pClip, pPriv->fg, pPriv->bg, pPriv->pm,
-			  GXcopy, opaque, gx, gy, gWidth, gHeight,
-			  (FbStip *) pglyph, gStride, 0);
-	}
-    }
-    exaFinishAccessGC (pGC);
-    exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
-}
-
 const GCOps exaOps = {
     exaFillSpans,
     ExaCheckSetSpans,
@@ -1007,7 +874,7 @@ const GCOps exaOps = {
     miPolyText16,
     miImageText8,
     miImageText16,
-    exaImageGlyphBlt,
+    ExaCheckImageGlyphBlt,
     ExaCheckPolyGlyphBlt,
     ExaCheckPushPixels,
 };
commit 10e0603fb989d1e6b2675ef5ca8223777b4921e6
Author: Jeremy Huddleston <jeremy at yuffie.local>
Date:   Tue Feb 24 23:12:57 2009 -0800

    XQuartz: Re-enable support for capslock
    (cherry picked from commit 4901b8147e593d26d7a31a9b73a201254b948916)

diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c
index 89d2233..374c4e0 100644
--- a/hw/xquartz/darwinEvents.c
+++ b/hw/xquartz/darwinEvents.c
@@ -155,6 +155,7 @@ int darwin_modifier_mask_list[] = {
 #else
     NX_CONTROLMASK, NX_SHIFTMASK, NX_COMMANDMASK, NX_ALTERNATEMASK,
 #endif
+    NX_ALPHASHIFTMASK,
     0
 };
 
@@ -174,7 +175,7 @@ static void DarwinUpdateModifiers(
     }
     
     for(f=darwin_modifier_mask_list; *f; f++)
-        if(*f & flags) {
+        if(*f & flags && *f != NX_ALPHASHIFTMASK) {
             key = DarwinModifierNXMaskToNXKey(*f);
             if(key == -1)
                 ErrorF("DarwinUpdateModifiers: Unsupported NXMask: 0x%x\n", *f);
commit e96921ca954ff0d3de8a69cea085aac2d43b0a2e
Author: Michel Dänzer <daenzer at vmware.com>
Date:   Mon Feb 23 16:49:51 2009 +0100

    DRI1: Make DRICreateDrawable return TRUE for pixmaps.
    
    GLX_EXT_texture_from_pixmap was broken since commit
    a26c77ff432d2e85a2665fc36fca25143460c476 ('glx: fix retval checks when failures
    occur for drawable creation.')
    
    Signed-off-by: Michel Dänzer <daenzer at vmware.com>
    (cherry picked from commit ef320bdd5ec3419abba77041d3a4d96a3ff87563)

diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index 1a3e091..bddb651 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -1291,7 +1291,7 @@ DRICreateDrawable(ScreenPtr pScreen, ClientPtr client, DrawablePtr pDrawable,
 	    *hHWDrawable = pDRIDrawablePriv->hwDrawable;
 	}
     }
-    else { /* pixmap (or for GLX 1.3, a PBuffer) */
+    else if (pDrawable->type != DRAWABLE_PIXMAP) { /* PBuffer */
 	/* NOT_DONE */
 	return FALSE;
     }
commit 584f46b81c6ed126014e963cb4ea40f83014f1c7
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Thu Feb 19 13:57:28 2009 -0800

    Add Extensions section to xorg.conf man page
    
    Extensions section was added in X11R6.8.0 and documented in the release notes:
       http://www.x.org/archive/X11R6.8.0/doc/RELNOTES2.html#3
    but never made it into the man page.
    
    Also fix a bonus typo.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>
    (cherry picked from commit ab61033700b5383a7a15370dd054eaa80e72e811)

diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
index d9a4b35..b6288b6 100644
--- a/hw/xfree86/doc/man/xorg.conf.man.pre
+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
@@ -115,6 +115,7 @@ The section names are:
 .BR "Files          " "File pathnames"
 .BR "ServerFlags    " "Server flags"
 .BR "Module         " "Dynamic module loading"
+.BR "Extensions     " "Extension enabling"
 .BR "InputDevice    " "Input device description"
 .BR "Device         " "Graphics device description"
 .BR "VideoAdaptor   " "Xv video adaptor description"
@@ -313,7 +314,7 @@ where
 .I <identifier>
 is an alphanumeric identifier,
 .I [attribute]
-is an attribute wich will be passed to the underlying FPE and
+is an attribute which will be passed to the underlying FPE and
 .I <priority>
 is a number used to order the fontfile FPEs. Examples:
 .PP
@@ -774,6 +775,32 @@ It is recommended
 that at very least the \(lqextmod\(rq extension module be loaded.
 If it isn't, some commonly used server extensions (like the SHAPE
 extension) will not be available.
+.SH "EXTENSIONS SECTION"
+The
+.B Extensions
+section is used to specify which X11 protocol extensions should be enabled
+or disabled.
+The
+.B Extensions
+section is optional, as are all of the entries that may be specified in
+it.
+.PP
+Entries in this section are listed as Option statements with the name of
+the extension as the first argument, and a boolean value as the second.
+The extension name is case\-sensitive, and matches the form shown in the output
+of \*qXorg -extension ?\*q.
+.PP
+.RS 7
+Example: the MIT-SHM extension can be disabled with the following entry:
+.PP
+.RS 4
+.nf
+.B "Section \*qExtensions\*q"
+.B "    Option \*qMIT-SHM\*q \*qDisable\*q"
+.B "EndSection"
+.fi
+.RE
+.RE
 .SH "INPUTDEVICE SECTION"
 The config file may have multiple
 .B InputDevice
commit ae7991b16d7fefb4335b05f951a3228cef102683
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Feb 25 10:14:36 2009 -0800

    Pre-clip panning coordinates to keep crtc within panning region
    
    There is a separate panning region check, but that doesn't work under
    transformation, so just pre-clip the mouse coordinates when computing the
    panning offsets. This leaves the case where panning constants are changing
    unresolved.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry pick from commit c090f5514d28e1602a6ebbe7c909e98a0e3374d7)

diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 2d8c2a9..6f93a0d 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -172,12 +172,166 @@ xf86RandR13VerifyPanningArea (xf86CrtcPtr crtc, int screenWidth, int screenHeigh
     return ret;
 }
 
+/*
+ * The heart of the panning operation:
+ *
+ * Given a frame buffer position (fb_x, fb_y),
+ * and a crtc position (crtc_x, crtc_y),
+ * and a transform matrix which maps frame buffer to crtc,
+ * compute a panning position (pan_x, pan_y) that
+ * makes the resulting transform line those two up
+ */
+
+static void
+xf86ComputeCrtcPan (Bool transform_in_use,
+		    struct pixman_f_transform *m,
+		    double screen_x, double screen_y,
+		    double crtc_x, double crtc_y,
+		    int old_pan_x, int old_pan_y,
+		    int *new_pan_x, int *new_pan_y)
+{
+    if (transform_in_use) {
+	/*
+	 * Given the current transform, M, the current position
+	 * on the Screen, S, and the desired position on the CRTC,
+	 * C, compute a translation, T, such that:
+	 *
+	 * M T S = C
+	 *
+	 * where T is of the form
+	 *
+	 * | 1 0 dx |
+	 * | 0 1 dy |
+	 * | 0 0 1  |
+	 *
+	 * M T S =
+	 *   | M00 Sx + M01 Sy + M00 dx + M01 dy + M02 |   | Cx F |
+	 *   | M10 Sx + M11 Sy + M10 dx + M11 dy + M12 | = | Cy F |
+	 *   | M20 Sx + M21 Sy + M20 dx + M21 dy + M22 |   |  F   |
+	 *
+	 * R = M S
+	 *
+	 *   Cx F = M00 dx + M01 dy + R0
+	 *   Cy F = M10 dx + M11 dy + R1
+	 *      F = M20 dx + M21 dy + R2
+	 *
+	 * Zero out dx, then dy
+	 *
+	 * F (Cx M10 - Cy M00) =
+	 *	    (M10 M01 - M00 M11) dy + M10 R0 - M00 R1
+	 * F (M10 - Cy M20) =
+	 *	    (M10 M21 - M20 M11) dy + M10 R2 - M20 R1
+	 *
+	 * F (Cx M11 - Cy M01) =
+	 *	    (M11 M00 - M01 M10) dx + M11 R0 - M01 R1
+	 * F (M11 - Cy M21) =
+	 *	    (M11 M20 - M21 M10) dx + M11 R2 - M21 R1
+	 *
+	 * Make some temporaries
+	 *
+	 * T = | Cx M10 - Cy M00 |
+	 *     | Cx M11 - Cy M01 |
+	 *
+	 * U = | M10 M01 - M00 M11 |
+	 *     | M11 M00 - M01 M10 |
+	 *
+	 * Q = | M10 R0 - M00 R1 |
+	 *     | M11 R0 - M01 R1 |
+	 *
+	 * P = | M10 - Cy M20 |
+	 *     | M11 - Cy M21 |
+	 *
+	 * W = | M10 M21 - M20 M11 |
+	 *     | M11 M20 - M21 M10 |
+	 *
+	 * V = | M10 R2 - M20 R1 |
+	 *	   | M11 R2 - M21 R1 |
+	 *
+	 * Rewrite:
+	 *
+	 * F T0 = U0 dy + Q0
+	 * F P0 = W0 dy + V0
+	 * F T1 = U1 dx + Q1
+	 * F P1 = W1 dx + V1
+	 *
+	 * Solve for F (two ways)
+	 *
+	 * F (W0 T0 - U0 P0)  = W0 Q0 - U0 V0
+	 *
+	 *     W0 Q0 - U0 V0
+	 * F = -------------
+	 *     W0 T0 - U0 P0
+	 *
+	 * F (W1 T1 - U1 P1) = W1 Q1 - U1 V1
+	 *
+	 *     W1 Q1 - U1 V1
+	 * F = -------------
+	 *     W1 T1 - U1 P1
+	 *
+	 * We'll use which ever solution works (denominator != 0)
+	 *
+	 * Finally, solve for dx and dy:
+	 *
+	 * dx = (F T1 - Q1) / U1
+	 * dx = (F P1 - V1) / W1
+	 *
+	 * dy = (F T0 - Q0) / U0
+	 * dy = (F P0 - V0) / W0
+	 */
+	double			    r[3];
+	double			    q[2], u[2], t[2], v[2], w[2], p[2];
+	double			    f;
+	struct pict_f_vector	    d;
+	int			    i;
+
+	/* Get the un-normalized crtc coordinates again */
+	for (i = 0; i < 3; i++)
+	    r[i] = m->m[i][0] * screen_x + m->m[i][1] * screen_y + m->m[i][2];
+
+	/* Combine values into temporaries */
+	for (i = 0; i < 2; i++) {
+	    q[i] = m->m[1][i] * r[0] - m->m[0][i] * r[1];
+	    u[i] = m->m[1][i] * m->m[0][1-i] - m->m[0][i] * m->m[1][1-i];
+	    t[i] = m->m[1][i] * crtc_x - m->m[0][i] * crtc_y;
+
+	    v[i] = m->m[1][i] * r[2] - m->m[2][i] * r[1];
+	    w[i] = m->m[1][i] * m->m[2][1-i] - m->m[2][i] * m->m[1][1-i];
+	    p[i] = m->m[1][i] - m->m[2][i] * crtc_y;
+	}
+
+	/* Find a way to compute f */
+	f = 0;
+	for (i = 0; i < 2; i++) {
+	    double a = w[i] * q[i] - u[i] * v[i];
+	    double b = w[i] * t[i] - u[i] * p[i];
+	    if (b != 0) {
+		f = a/b;
+		break;
+	    }
+	}
+
+	/* Solve for the resulting transform vector */
+	for (i = 0; i < 2; i++) {
+	    if (u[i])
+		d.v[1-i] = (t[i] * f - q[i]) / u[i];
+	    else if (w[1])
+		d.v[1-i] = (p[i] * f - v[i]) / w[i];
+	    else
+		d.v[1-i] = 0;
+	}
+	*new_pan_x = old_pan_x - floor (d.v[0] + 0.5);
+	*new_pan_y = old_pan_y - floor (d.v[1] + 0.5);
+    } else {
+	*new_pan_x = screen_x - crtc_x;
+	*new_pan_y = screen_y - crtc_y;
+    }
+}
+
 static void
 xf86RandR13Pan (xf86CrtcPtr crtc, int x, int y)
 {
     int newX, newY;
     int width, height;
-    struct pict_f_vector    c;
     Bool panned = FALSE;
 
     if (crtc->version < 2)
@@ -193,20 +347,43 @@ xf86RandR13Pan (xf86CrtcPtr crtc, int x, int y)
     width  = crtc->mode.HDisplay;
     height = crtc->mode.VDisplay;
 
-    c.v[0] = x;
-    c.v[1] = y;
-    c.v[2] = 1.0;
-    if (crtc->transform_in_use) {
-	pixman_f_transform_point(&crtc->f_framebuffer_to_crtc, &c);
-    } else {
-	c.v[0] -= crtc->x;
-	c.v[1] -= crtc->y;
-    }
-
     if ((crtc->panningTrackingArea.x2 <= crtc->panningTrackingArea.x1 ||
 	 (x >= crtc->panningTrackingArea.x1 && x < crtc->panningTrackingArea.x2)) &&
 	(crtc->panningTrackingArea.y2 <= crtc->panningTrackingArea.y1 ||
-	 (y >= crtc->panningTrackingArea.y1 && y < crtc->panningTrackingArea.y2))) {
+	 (y >= crtc->panningTrackingArea.y1 && y < crtc->panningTrackingArea.y2)))
+    {
+	struct pict_f_vector    c;
+
+	/*
+	 * Pre-clip the mouse position to the panning area so that we don't
+	 * push the crtc outside. This doesn't deal with changes to the
+	 * panning values, only mouse position changes.
+	 */
+	if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1)
+	{
+	    if (x < crtc->panningTotalArea.x1)
+		x = crtc->panningTotalArea.x1;
+	    if (x >= crtc->panningTotalArea.x2)
+		x = crtc->panningTotalArea.x2 - 1;
+	}
+	if (crtc->panningTotalArea.y2 > crtc->panningTotalArea.y1)
+	{
+	    if (y < crtc->panningTotalArea.y1)
+		y = crtc->panningTotalArea.y1;
+	    if (y >= crtc->panningTotalArea.y2)
+		y = crtc->panningTotalArea.y2 - 1;
+	}
+
+	c.v[0] = x;
+	c.v[1] = y;
+	c.v[2] = 1.0;
+	if (crtc->transform_in_use) {
+	    pixman_f_transform_point(&crtc->f_framebuffer_to_crtc, &c);
+	} else {
+	    c.v[0] -= crtc->x;
+	    c.v[1] -= crtc->y;
+	}
+
 	if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1) {
 	    if (c.v[0] < crtc->panningBorder[0]) {
 		c.v[0] = crtc->panningBorder[0];
@@ -227,165 +404,35 @@ xf86RandR13Pan (xf86CrtcPtr crtc, int x, int y)
 		panned = TRUE;
 	    }
 	}
+	if (panned)
+	    xf86ComputeCrtcPan (crtc->transform_in_use,
+				&crtc->f_framebuffer_to_crtc,
+				x, y, c.v[0], c.v[1],
+				newX, newY, &newX, &newY);
     }
-    if (panned) {
-	if (crtc->transform_in_use) {
-	    /*
-	     * Under a transformation, we want to find a new crtc offset
-	     * which places the cursor in the desired position. That is,
-	     *
-	     * Given the current transform, M, the current cursor position
-	     * on the Screen, S, and the desired cursor position on the CRTC,
-	     * C, compute a translation, T, such that:
-	     *
-	     * M T S = C
-	     *
-	     * where T is of the form
-	     *
-	     * | 1 0 dx |
-	     * | 0 1 dy |
-	     * | 0 0 1  |
-	     *
-	     * M T S =
-	     *   | M00 Sx + M01 Sy + M00 dx + M01 dy + M02 |   | Cx F |
-	     *   | M10 Sx + M11 Sy + M10 dx + M11 dy + M12 | = | Cy F |
-	     *   | M20 Sx + M21 Sy + M20 dx + M21 dy + M22 |   |  F   |
-	     *
-	     * R = M S
-	     *
-	     *   Cx F = M00 dx + M01 dy + R0
-	     *   Cy F = M10 dx + M11 dy + R1
-	     *      F = M20 dx + M21 dy + R2
-	     *
-	     * Zero out dx, then dy
-	     *
-	     * F (Cx M10 - Cy M00) =
-	     *	    (M10 M01 - M00 M11) dy + M10 R0 - M00 R1
-	     * F (M10 - Cy M20) =
-	     *	    (M10 M21 - M20 M11) dy + M10 R2 - M20 R1
-	     *
-	     * F (Cx M11 - Cy M01) =
-	     *	    (M11 M00 - M01 M10) dx + M11 R0 - M01 R1
-	     * F (M11 - Cy M21) =
-	     *	    (M11 M20 - M21 M10) dx + M11 R2 - M21 R1
-	     *
-	     * Make some temporaries
-	     *
-	     * T = | Cx M10 - Cy M00 |
-	     *     | Cx M11 - Cy M01 |
-	     *
-	     * U = | M10 M01 - M00 M11 |
-	     *     | M11 M00 - M01 M10 |
-	     *
-	     * Q = | M10 R0 - M00 R1 |
-	     *     | M11 R0 - M01 R1 |
-	     *
-	     * P = | M10 - Cy M20 |
-	     *     | M11 - Cy M21 |
-	     *
-	     * W = | M10 M21 - M20 M11 |
-	     *     | M11 M20 - M21 M10 |
-	     *
-	     * V = | M10 R2 - M20 R1 |
-	     *	   | M11 R2 - M21 R1 |
-	     *
-	     * Rewrite:
-	     *
-	     * F T0 = U0 dy + Q0
-	     * F P0 = W0 dy + V0
-	     * F T1 = U1 dx + Q1
-	     * F P1 = W1 dx + V1
-	     *
-	     * Solve for F (two ways)
-	     *
-	     * F (W0 T0 - U0 P0)  = W0 Q0 - U0 V0
-	     *
-	     *     W0 Q0 - U0 V0
-	     * F = -------------
-	     *     W0 T0 - U0 P0
-	     *
-	     * F (W1 T1 - U1 P1) = W1 Q1 - U1 V1
-	     *
-	     *     W1 Q1 - U1 V1
-	     * F = -------------
-	     *     W1 T1 - U1 P1
-	     *
-	     * We'll use which ever solution works (denominator != 0)
-	     *
-	     * Finally, solve for dx and dy:
-	     *
-	     * dx = (F T1 - Q1) / U1
-	     * dx = (F P1 - V1) / W1
-	     *
-	     * dy = (F T0 - Q0) / U0
-	     * dy = (F P0 - V0) / W0
-	     */
-	    double	r[3];
-	    double	q[2], u[2], t[2], v[2], w[2], p[2];
-	    double	f;
-	    struct pict_f_vector    d;
-	    int	i;
-	    struct pixman_f_transform	*m = &crtc->f_framebuffer_to_crtc;
-
-	    /* Get the un-normalized crtc coordinates again */
-	    for (i = 0; i < 3; i++)
-		r[i] = m->m[i][0] * x + m->m[i][1] * y + m->m[i][2];
-
-	    /* Combine values into temporaries */
-	    for (i = 0; i < 2; i++) {
-		q[i] = m->m[1][i] * r[0] - m->m[0][i] * r[1];
-		u[i] = m->m[1][i] * m->m[0][1-i] - m->m[0][i] * m->m[1][1-i];
-		t[i] = m->m[1][i] * c.v[0] - m->m[0][i] * c.v[1];
-
-		v[i] = m->m[1][i] * r[2] - m->m[2][i] * r[1];
-		w[i] = m->m[1][i] * m->m[2][1-i] - m->m[2][i] * m->m[1][1-i];
-		p[i] = m->m[1][i] - m->m[2][i] * c.v[1];
-	    }
-
-	    /* Find a way to compute f */
-	    f = 0;
-	    for (i = 0; i < 2; i++) {
-		double a = w[i] * q[i] - u[i] * v[i];
-		double b = w[i] * t[i] - u[i] * p[i];
-		if (b != 0) {
-		    f = a/b;
-		    break;
-		}
-	    }
 
-	    /* Solve for the resulting transform vector */
-	    for (i = 0; i < 2; i++) {
-		if (u[i])
-		    d.v[1-i] = (t[i] * f - q[i]) / u[i];
-		else if (w[1])
-		    d.v[1-i] = (p[i] * f - v[i]) / w[i];
-		else
-		    d.v[1-i] = 0;
-	    }
-	    d.v[2] = 1;
-	    newX -= floor (d.v[0] + 0.5);
-	    newY -= floor (d.v[1] + 0.5);
-	} else {
-	    newX = x - c.v[0];
-	    newY = y - c.v[1];
+    /*
+     * Ensure that the crtc is within the panning region.
+     *
+     * XXX This computation only works when we do not have a transform
+     * in use.
+     */
+    if (!crtc->transform_in_use)
+    {
+	/* Validate against [xy]1 after [xy]2, to be sure that results are > 0 for [xy]1 > 0 */
+	if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1) {
+	    if (newX > crtc->panningTotalArea.x2 - width)
+		newX =  crtc->panningTotalArea.x2 - width;
+	    if (newX <  crtc->panningTotalArea.x1)
+		newX =  crtc->panningTotalArea.x1;
+	}
+	if (crtc->panningTotalArea.y2 > crtc->panningTotalArea.y1) {
+	    if (newY > crtc->panningTotalArea.y2 - height)
+		newY =  crtc->panningTotalArea.y2 - height;
+	    if (newY <  crtc->panningTotalArea.y1)
+		newY =  crtc->panningTotalArea.y1;
 	}
     }
-
-#if 0
-    /* Validate against [xy]1 after [xy]2, to be sure that results are > 0 for [xy]1 > 0 */
-    if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1) {
-	if (newX > crtc->panningTotalArea.x2 - width)
-	    newX =  crtc->panningTotalArea.x2 - width;
-	if (newX <  crtc->panningTotalArea.x1)
-	    newX =  crtc->panningTotalArea.x1;
-    }
-    if (crtc->panningTotalArea.y2 > crtc->panningTotalArea.y1) {
-	if (newY > crtc->panningTotalArea.y2 - height)
-	    newY =  crtc->panningTotalArea.y2 - height;
-	if (newY <  crtc->panningTotalArea.y1)
-	    newY =  crtc->panningTotalArea.y1;
-    }
-#endif
     if (newX != crtc->x || newY != crtc->y)
 	xf86CrtcSetOrigin (crtc, newX, newY);
 }
commit e59aa804df8a39541aa3224a5e688b819196070c
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Feb 25 10:12:23 2009 -0800

    RandR rotations and reflections offset by one pixel
    
    The matrix computation for rotation and reflection resulted in dropping a
    row or column of pixels as the offsets used in the matrix computations used
    width and height rather than width-1 and height-1.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 77c7a64e8885696665556c9fbcb3cffb552e367a)

diff --git a/randr/rrtransform.c b/randr/rrtransform.c
index 49be2e0..8bdff5a 100644
--- a/randr/rrtransform.c
+++ b/randr/rrtransform.c
@@ -185,21 +185,21 @@ RRTransformCompute (int			    x,
 	    break;
 	case RR_Rotate_90:
 	    f_rot_cos = 0;	    f_rot_sin = 1;
-	    f_rot_dx  = height;	    f_rot_dy  = 0;
+	    f_rot_dx  = height-1;   f_rot_dy  = 0;
 	    rot_cos = F ( 0);	    rot_sin = F ( 1);
-	    rot_dx =  F ( height);  rot_dy  = F (0);
+	    rot_dx =  F (height-1); rot_dy  = F (0);
 	    break;
 	case RR_Rotate_180:
 	    f_rot_cos = -1;	    f_rot_sin = 0;
-	    f_rot_dx  = width;	    f_rot_dy  = height;
+	    f_rot_dx  = width - 1;  f_rot_dy  = height - 1;
 	    rot_cos = F (-1);	    rot_sin = F ( 0);
-	    rot_dx  = F (width);   rot_dy  = F ( height);
+	    rot_dx  = F (width-1);  rot_dy  = F ( height-1);
 	    break;
 	case RR_Rotate_270:
 	    f_rot_cos = 0;	    f_rot_sin = -1;
-	    f_rot_dx  = 0;	    f_rot_dy  = width;
+	    f_rot_dx  = 0;	    f_rot_dy  = width-1;
 	    rot_cos = F ( 0);	    rot_sin = F (-1);
-	    rot_dx  = F ( 0);	    rot_dy  = F ( width);
+	    rot_dx  = F ( 0);	    rot_dy  = F ( width-1);
 	    break;
 	}
 	
@@ -222,11 +222,11 @@ RRTransformCompute (int			    x,
 	    f_scale_x = -1;
 	    scale_x = F(-1);
 	    if (rotation & (RR_Rotate_0|RR_Rotate_180)) {
-		f_scale_dx = width;
-		scale_dx = F(width);
+		f_scale_dx = width-1;
+		scale_dx = F(width-1);
 	    } else {
-		f_scale_dx = height;
-		scale_dx = F(height);
+		f_scale_dx = height-1;
+		scale_dx = F(height-1);
 	    }
 	}
 	if (rotation & RR_Reflect_Y)
@@ -234,11 +234,11 @@ RRTransformCompute (int			    x,
 	    f_scale_y = -1;
 	    scale_y = F(-1);
 	    if (rotation & (RR_Rotate_0|RR_Rotate_180)) {
-		f_scale_dy = height;
-		scale_dy = F(height);
+		f_scale_dy = height-1;
+		scale_dy = F(height-1);
 	    } else {
-		f_scale_dy = width;
-		scale_dy = F(width);
+		f_scale_dy = width-1;
+		scale_dy = F(width-1);
 	    }
 	}
 	
commit 9a59e7f304ab19c91738311bb9f1ec7709fc8847
Author: Keith Packard <keithp at keithp.com>
Date:   Sun Feb 8 15:08:15 2009 +0100

    xf86CrtcShadowClear is unused.
    
    Remove this now that clearing is done by repainting with appropriate extend
    modes.
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 60a4f1368785d26a49a3ef6df829723ca154c154)
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index 9f57394..6be77d5 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -146,37 +146,6 @@ xf86RotateCrtcRedisplay (xf86CrtcPtr crtc, RegionPtr region)
 }
 
 static void
-xf86CrtcShadowClear (xf86CrtcPtr crtc)
-{
-    PixmapPtr		dst_pixmap = crtc->rotatedPixmap;
-    ScrnInfoPtr		scrn = crtc->scrn;
-    ScreenPtr		screen = scrn->pScreen;
-    PicturePtr		dst;
-    PictFormatPtr	format = compWindowFormat (WindowTable[screen->myNum]);
-    static xRenderColor black = { 0, 0, 0, 0 };
-    xRectangle		rect;
-    int			error;
-
-    if (!dst_pixmap)
-	return;
-    dst = CreatePicture (None,
-			 &dst_pixmap->drawable,
-			 format,
-			 0L,
-			 NULL,
-			 serverClient,
-			 &error);
-    if (!dst)
-	return;
-    rect.x = 0;
-    rect.y = 0;
-    rect.width = dst_pixmap->drawable.width;
-    rect.height = dst_pixmap->drawable.height;
-    CompositeRects (PictOpSrc, dst, &black, 1, &rect);
-    FreePicture (dst, None);
-}
-
-static void
 xf86CrtcDamageShadow (xf86CrtcPtr crtc)
 {
     ScrnInfoPtr	pScrn = crtc->scrn;
commit 369d7b22a9009e7054bd121484fa128c7a6d21f6
Author: Keith Packard <keithp at keithp.com>
Date:   Thu Feb 5 11:36:54 2009 -0800

    Make panning+transform be correctly driven by mouse
    
    Figuring out how to adjust the crtc origin to keep the mouse pointer within
    the crtc is a bit of a trick
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    (cherry picked from commit 63810aca31b962c93be4796883bde6ccb653e3a9)
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index d8693dd..2d8c2a9 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -177,6 +177,8 @@ xf86RandR13Pan (xf86CrtcPtr crtc, int x, int y)
 {
     int newX, newY;
     int width, height;
+    struct pict_f_vector    c;
+    Bool panned = FALSE;
 
     if (crtc->version < 2)
 	return;
@@ -191,23 +193,185 @@ xf86RandR13Pan (xf86CrtcPtr crtc, int x, int y)
     width  = crtc->mode.HDisplay;
     height = crtc->mode.VDisplay;
 
+    c.v[0] = x;
+    c.v[1] = y;
+    c.v[2] = 1.0;
+    if (crtc->transform_in_use) {
+	pixman_f_transform_point(&crtc->f_framebuffer_to_crtc, &c);
+    } else {
+	c.v[0] -= crtc->x;
+	c.v[1] -= crtc->y;
+    }
+
     if ((crtc->panningTrackingArea.x2 <= crtc->panningTrackingArea.x1 ||
 	 (x >= crtc->panningTrackingArea.x1 && x < crtc->panningTrackingArea.x2)) &&
 	(crtc->panningTrackingArea.y2 <= crtc->panningTrackingArea.y1 ||
 	 (y >= crtc->panningTrackingArea.y1 && y < crtc->panningTrackingArea.y2))) {
 	if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1) {
-	    if (x < crtc->x + crtc->panningBorder[0])
-		newX = x - crtc->panningBorder[0];
-	    if (x >= crtc->x + width - crtc->panningBorder[2])
-		newX = x - width + crtc->panningBorder[2] + 1;
+	    if (c.v[0] < crtc->panningBorder[0]) {
+		c.v[0] = crtc->panningBorder[0];
+		panned = TRUE;
+	    }
+	    if (c.v[0] >= width - crtc->panningBorder[2]) {
+		c.v[0] = width - crtc->panningBorder[2] - 1;
+		panned = TRUE;
+	    }
 	}
 	if (crtc->panningTotalArea.y2 > crtc->panningTotalArea.y1) {
-	    if (y < crtc->y + crtc->panningBorder[1])
-		newY = y - crtc->panningBorder[1];
-	    if (y >= crtc->y + height - crtc->panningBorder[3])
-		newY = y - height + crtc->panningBorder[3] + 1;
+	    if (c.v[1] < crtc->panningBorder[1]) {
+		c.v[1] = crtc->panningBorder[1];
+		panned = TRUE;
+	    }
+	    if (c.v[1] >= height - crtc->panningBorder[3]) {
+		c.v[1] = height - crtc->panningBorder[3] - 1;
+		panned = TRUE;
+	    }
 	}
     }
+    if (panned) {
+	if (crtc->transform_in_use) {
+	    /*
+	     * Under a transformation, we want to find a new crtc offset
+	     * which places the cursor in the desired position. That is,
+	     *
+	     * Given the current transform, M, the current cursor position
+	     * on the Screen, S, and the desired cursor position on the CRTC,
+	     * C, compute a translation, T, such that:
+	     *
+	     * M T S = C
+	     *
+	     * where T is of the form
+	     *
+	     * | 1 0 dx |
+	     * | 0 1 dy |
+	     * | 0 0 1  |
+	     *
+	     * M T S =
+	     *   | M00 Sx + M01 Sy + M00 dx + M01 dy + M02 |   | Cx F |
+	     *   | M10 Sx + M11 Sy + M10 dx + M11 dy + M12 | = | Cy F |
+	     *   | M20 Sx + M21 Sy + M20 dx + M21 dy + M22 |   |  F   |
+	     *
+	     * R = M S
+	     *
+	     *   Cx F = M00 dx + M01 dy + R0
+	     *   Cy F = M10 dx + M11 dy + R1
+	     *      F = M20 dx + M21 dy + R2
+	     *
+	     * Zero out dx, then dy
+	     *
+	     * F (Cx M10 - Cy M00) =
+	     *	    (M10 M01 - M00 M11) dy + M10 R0 - M00 R1
+	     * F (M10 - Cy M20) =
+	     *	    (M10 M21 - M20 M11) dy + M10 R2 - M20 R1
+	     *
+	     * F (Cx M11 - Cy M01) =
+	     *	    (M11 M00 - M01 M10) dx + M11 R0 - M01 R1
+	     * F (M11 - Cy M21) =
+	     *	    (M11 M20 - M21 M10) dx + M11 R2 - M21 R1
+	     *
+	     * Make some temporaries
+	     *
+	     * T = | Cx M10 - Cy M00 |
+	     *     | Cx M11 - Cy M01 |
+	     *
+	     * U = | M10 M01 - M00 M11 |
+	     *     | M11 M00 - M01 M10 |
+	     *
+	     * Q = | M10 R0 - M00 R1 |
+	     *     | M11 R0 - M01 R1 |
+	     *
+	     * P = | M10 - Cy M20 |
+	     *     | M11 - Cy M21 |
+	     *
+	     * W = | M10 M21 - M20 M11 |
+	     *     | M11 M20 - M21 M10 |
+	     *
+	     * V = | M10 R2 - M20 R1 |
+	     *	   | M11 R2 - M21 R1 |
+	     *
+	     * Rewrite:
+	     *
+	     * F T0 = U0 dy + Q0
+	     * F P0 = W0 dy + V0
+	     * F T1 = U1 dx + Q1
+	     * F P1 = W1 dx + V1
+	     *
+	     * Solve for F (two ways)
+	     *
+	     * F (W0 T0 - U0 P0)  = W0 Q0 - U0 V0
+	     *
+	     *     W0 Q0 - U0 V0
+	     * F = -------------
+	     *     W0 T0 - U0 P0
+	     *
+	     * F (W1 T1 - U1 P1) = W1 Q1 - U1 V1
+	     *
+	     *     W1 Q1 - U1 V1
+	     * F = -------------
+	     *     W1 T1 - U1 P1
+	     *
+	     * We'll use which ever solution works (denominator != 0)
+	     *
+	     * Finally, solve for dx and dy:
+	     *
+	     * dx = (F T1 - Q1) / U1
+	     * dx = (F P1 - V1) / W1
+	     *
+	     * dy = (F T0 - Q0) / U0
+	     * dy = (F P0 - V0) / W0
+	     */
+	    double	r[3];
+	    double	q[2], u[2], t[2], v[2], w[2], p[2];
+	    double	f;
+	    struct pict_f_vector    d;
+	    int	i;
+	    struct pixman_f_transform	*m = &crtc->f_framebuffer_to_crtc;
+
+	    /* Get the un-normalized crtc coordinates again */
+	    for (i = 0; i < 3; i++)
+		r[i] = m->m[i][0] * x + m->m[i][1] * y + m->m[i][2];
+
+	    /* Combine values into temporaries */
+	    for (i = 0; i < 2; i++) {
+		q[i] = m->m[1][i] * r[0] - m->m[0][i] * r[1];
+		u[i] = m->m[1][i] * m->m[0][1-i] - m->m[0][i] * m->m[1][1-i];
+		t[i] = m->m[1][i] * c.v[0] - m->m[0][i] * c.v[1];
+
+		v[i] = m->m[1][i] * r[2] - m->m[2][i] * r[1];
+		w[i] = m->m[1][i] * m->m[2][1-i] - m->m[2][i] * m->m[1][1-i];
+		p[i] = m->m[1][i] - m->m[2][i] * c.v[1];
+	    }
+
+	    /* Find a way to compute f */
+	    f = 0;
+	    for (i = 0; i < 2; i++) {
+		double a = w[i] * q[i] - u[i] * v[i];
+		double b = w[i] * t[i] - u[i] * p[i];
+		if (b != 0) {
+		    f = a/b;
+		    break;
+		}
+	    }
+
+	    /* Solve for the resulting transform vector */
+	    for (i = 0; i < 2; i++) {
+		if (u[i])
+		    d.v[1-i] = (t[i] * f - q[i]) / u[i];
+		else if (w[1])
+		    d.v[1-i] = (p[i] * f - v[i]) / w[i];
+		else
+		    d.v[1-i] = 0;
+	    }
+	    d.v[2] = 1;
+	    newX -= floor (d.v[0] + 0.5);
+	    newY -= floor (d.v[1] + 0.5);
+	} else {
+	    newX = x - c.v[0];
+	    newY = y - c.v[1];
+	}
+    }
+
+#if 0
     /* Validate against [xy]1 after [xy]2, to be sure that results are > 0 for [xy]1 > 0 */
     if (crtc->panningTotalArea.x2 > crtc->panningTotalArea.x1) {
 	if (newX > crtc->panningTotalArea.x2 - width)
@@ -221,6 +385,7 @@ xf86RandR13Pan (xf86CrtcPtr crtc, int x, int y)
 	if (newY <  crtc->panningTotalArea.y1)
 	    newY =  crtc->panningTotalArea.y1;
     }
+#endif
     if (newX != crtc->x || newY != crtc->y)
 	xf86CrtcSetOrigin (crtc, newX, newY);
 }
commit c0a36197002c7de98f14dc98969409778d29dc50
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date:   Tue Feb 17 18:48:52 2009 -0800

    Make RgbPath keyword in xorg.conf a non-fatal error
    
    Xorg shouldn't refuse to run just because the user has an xorg.conf that
    had the previously-used RgbPath keyword in it.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith at sun.com>
    Acked-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit d2cf562bbad553d7f09b70202134f5b6ada0114e)
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/parser/Files.c b/hw/xfree86/parser/Files.c
index 2f77c0e..c352302 100644
--- a/hw/xfree86/parser/Files.c
+++ b/hw/xfree86/parser/Files.c
@@ -73,6 +73,8 @@ static xf86ConfigSymTabRec FilesTab[] =
 	{INPUTDEVICES, "inputdevices"},
 	{LOGFILEPATH, "logfile"},
 	{XKBDIR, "xkbdir"},
+	/* Obsolete keywords that aren't used but shouldn't cause errors: */
+	{OBSOLETE_TOKEN, "rgbpath"},
 	{-1, ""},
 };
 
@@ -189,6 +191,10 @@ xf86parseFilesSection (void)
 		case EOF_TOKEN:
 			Error (UNEXPECTED_EOF_MSG, NULL);
 			break;
+		case OBSOLETE_TOKEN:
+			xf86parseError (OBSOLETE_MSG, xf86tokenString ());
+			xf86getSubToken (&(ptr->file_comment));
+			break;
 		default:
 			Error (INVALID_KEYWORD_MSG, xf86tokenString ());
 			break;
diff --git a/hw/xfree86/parser/xf86tokens.h b/hw/xfree86/parser/xf86tokens.h
index 8091f09..b2d2350 100644
--- a/hw/xfree86/parser/xf86tokens.h
+++ b/hw/xfree86/parser/xf86tokens.h
@@ -70,6 +70,7 @@
 
 typedef enum {
     /* errno-style tokens */
+    OBSOLETE_TOKEN	= -5,
     EOF_TOKEN		= -4,
     LOCK_TOKEN		= -3,
     ERROR_TOKEN		= -2,
commit 6b8bbbd21b39181e9dd3175fa73c05008c361ba2
Author: Peter Hutterer <peter.hutterer at who-t.net>
Date:   Wed Feb 4 11:50:18 2009 +1000

    config: if we can't connect to HAL, listen for a startup notification.
    
    If HAL isn't available when we try to connect, the registered NameOwnerChanged
    signal handler waits until HAL is available. Once we connected to HAL, we
    unregister the signal handler again.
    This allows HAL to be started in parallel or after the server has started.
    
    Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
    (cherry picked from commit 4844bff58f296b2851be4e6b955c3a68d02437a9)
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/config/hal.c b/config/hal.c
index 8dfbb07..36fa839 100644
--- a/config/hal.c
+++ b/config/hal.c
@@ -467,11 +467,10 @@ disconnect_hook(void *data)
     info->system_bus = NULL;
 }
 
-static void
-connect_hook(DBusConnection *connection, void *data)
+static BOOL
+connect_and_register(DBusConnection *connection, struct config_hal_info *info)
 {
     DBusError error;
-    struct config_hal_info *info = data;
     char **devices;
     int num_devices, i;
 
@@ -479,8 +478,10 @@ connect_hook(DBusConnection *connection, void *data)
 
     dbus_error_init(&error);
 
-    if (!info->hal_ctx)
-        info->hal_ctx = libhal_ctx_new();
+    if (info->hal_ctx)
+        return TRUE; /* already registered, pretend we did something */
+
+    info->hal_ctx = libhal_ctx_new();
     if (!info->hal_ctx) {
         LogMessage(X_ERROR, "config/hal: couldn't create HAL context\n");
         goto out_err;
@@ -512,7 +513,7 @@ connect_hook(DBusConnection *connection, void *data)
 
     dbus_error_free(&error);
 
-    return;
+    return TRUE;
 
 out_ctx2:
     if (!libhal_ctx_shutdown(info->hal_ctx, &error))
@@ -526,6 +527,104 @@ out_err:
     info->hal_ctx = NULL;
     info->system_bus = NULL;
 
+    return FALSE;
+}
+
+
+/**
+ * Handle NewOwnerChanged signals to deal with HAL startup at X server runtime.
+ *
+ * NewOwnerChanged is send once when HAL shuts down, and once again when it
+ * comes back up. Message has three arguments, first is the name
+ * (org.freedesktop.Hal), the second one is the old owner, third one is new
+ * owner.
+ */
+static DBusHandlerResult
+ownerchanged_handler(DBusConnection *connection, DBusMessage *message, void *data)
+{
+    int ret = DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+
+    if (dbus_message_is_signal(message,
+                               "org.freedesktop.DBus",
+                               "NameOwnerChanged")) {
+        DBusError error;
+        char *name, *old_owner, *new_owner;
+
+        dbus_error_init(&error);
+        dbus_message_get_args(message, &error,
+                              DBUS_TYPE_STRING, &name,
+                              DBUS_TYPE_STRING, &old_owner,
+                              DBUS_TYPE_STRING, &new_owner,
+                              DBUS_TYPE_INVALID);
+
+        if (dbus_error_is_set(&error)) {
+            ErrorF("[config/hal] failed to get NameOwnerChanged args: %s (%s)\n",
+                   error.name, error.message);
+        } else if (name && strcmp(name, "org.freedesktop.Hal") == 0) {
+
+            if (!old_owner || !strlen(old_owner)) {
+                DebugF("[config/hal] HAL startup detected.\n");
+                if (connect_and_register(connection, (struct config_hal_info*)data))
+                    dbus_connection_unregister_object_path(connection,
+                                                     "/org/freedesktop/DBus");
+                else
+                    ErrorF("[config/hal] Failed to connect to HAL bus.\n");
+            }
+
+            ret = DBUS_HANDLER_RESULT_HANDLED;
+        }
+        dbus_error_free(&error);
+    }
+
+    return ret;
+}
+
+/**
+ * Register a handler for the NameOwnerChanged signal.
+ */
+static BOOL
+listen_for_startup(DBusConnection *connection, void *data)
+{
+    DBusObjectPathVTable vtable = { .message_function = ownerchanged_handler, };
+    DBusError error;
+    const char MATCH_RULE[] = "sender='org.freedesktop.DBus',"
+                              "interface='org.freedesktop.DBus',"
+                              "type='signal',"
+                              "path='/org/freedesktop/DBus',"
+                              "member='NameOwnerChanged'";
+    int rc = FALSE;
+
+    dbus_error_init(&error);
+    dbus_bus_add_match(connection, MATCH_RULE, &error);
+    if (!dbus_error_is_set(&error)) {
+        if (dbus_connection_register_object_path(connection,
+                                                  "/org/freedesktop/DBus",
+                                                  &vtable,
+                                                  data))
+            rc = TRUE;
+        else
+            ErrorF("[config/hal] cannot register object path.\n");
+    } else {
+        ErrorF("[config/hal] couldn't add match rule: %s (%s)\n", error.name,
+                error.message);
+        ErrorF("[config/hal] cannot detect a HAL startup.\n");
+    }
+
+    dbus_error_free(&error);
+
+    return rc;
+}
+
+static void
+connect_hook(DBusConnection *connection, void *data)
+{
+    struct config_hal_info *info = data;
+
+    if (listen_for_startup(connection, data) &&
+        connect_and_register(connection, info))
+        dbus_connection_unregister_object_path(connection,
+                                               "/org/freedesktop/DBus");
+
     return;
 }
 
commit 4557b3f6c4273cd83b701beaf7a150c806fed298
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Feb 18 16:43:23 2009 -0800

    X11/fonts/fontmod.h doesn't exist anymore.
    
    libXfont 1.4.0 no longer includes this file, nor do we need it, so just stop
    attempting to reference it.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xfree86/loader/loaderProcs.h b/hw/xfree86/loader/loaderProcs.h
index 827f3a9..a10f0b3 100644
--- a/hw/xfree86/loader/loaderProcs.h
+++ b/hw/xfree86/loader/loaderProcs.h
@@ -56,7 +56,6 @@
 #undef IN_LOADER
 #define IN_LOADER
 #include "xf86Module.h"
-#include <X11/fonts/fontmod.h>
 
 typedef struct module_desc {
     struct module_desc *child;
commit 3575cb86a18d9e80e239acefdab18694e4ca2098
Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Tue Feb 17 08:27:32 2009 -0800

    glx: Inialize best_score before calculating visual scores
    
    This bug was pointed out by Peter Ã…strand.
    
    Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
    (cherry picked from commit 4039603413f9f46d7f725463a70b4a51838e0049)
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/glx/glxscreens.c b/glx/glxscreens.c
index 027afb8..95d35eb 100644
--- a/glx/glxscreens.c
+++ b/glx/glxscreens.c
@@ -353,7 +353,7 @@ static __GLXconfig *
 pickFBConfig(__GLXscreen *pGlxScreen, VisualPtr visual)
 {
     __GLXconfig *best = NULL, *config;
-    int best_score;
+    int best_score = 0;
 
     for (config = pGlxScreen->fbconfigs; config != NULL; config = config->next) {
 	int score = 0;
commit d050a61747bd5e5f9c96f5df5a191598c3f01e5c
Author: Jeremy Huddleston <jeremy at yuffie.local>
Date:   Tue Feb 17 23:25:14 2009 -0800

    configure.ac: Support version strings like W.X.Y.Z-XXXXXX
    (cherry picked from commit 43967514cd57ad836d7fb85c8c9e58ada07e0232)
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index 35450da..b4d18dd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -409,7 +409,7 @@ XORG_RELEASE_VERSION
 dnl augment XORG_RELEASE_VERSION for our snapshot number and to expose the
 dnl major number
 PVMAJOR=`echo $PACKAGE_VERSION | cut -d . -f 1`
-PVS=`echo $PACKAGE_VERSION | cut -d . -f 4`
+PVS=`echo $PACKAGE_VERSION | cut -d . -f 4 | cut -d - -f 1`
 if test "x$PVS" = "x"; then
 	PVS="0"
 fi
commit 8e16e64f55deb8e94007915333ba356c0f7e4f73
Author: Jeremy Huddleston <jeremy at yuffie.local>
Date:   Tue Feb 17 23:24:25 2009 -0800

    XQuartz: Don't need GlxSetVisualConfig any more
    
    Fixes build failure resulting from 516f8e2cad1311a09764e2633644188d1e3c31bb
    (cherry picked from commit 066b17028a35956a089815716e38571f305469c5)
    
    Signed-off-by: Keith Packard <keithp at keithp.com>

diff --git a/hw/xquartz/GL/indirect.c b/hw/xquartz/GL/indirect.c
index 517ab1a..0a60672 100644
--- a/hw/xquartz/GL/indirect.c
+++ b/hw/xquartz/GL/indirect.c
@@ -723,8 +723,6 @@ static __GLXscreen * __glXAquaScreenProbe(ScreenPtr pScreen) {
     screen->base.fbconfigs = CreateConfigs(&screen->base.numFBConfigs, 
 					   pScreen->myNum);
     
-    GlxSetVisualConfig(GLX_ALL_VISUALS);
-
     __glXScreenInit(&screen->base, pScreen);
 
     /* __glXScreenInit initializes these, so the order here is important, if we need these... */


More information about the xorg-commit mailing list