xserver: Branch 'master' - 5 commits

Eric Anholt anholt at kemper.freedesktop.org
Mon Jul 3 20:32:33 EEST 2006


 configure.ac             |    2 +-
 exa/exa_render.c         |    5 ++++-
 hw/xfree86/xaa/xaaPict.c |    8 +++++++-
 render/filter.c          |   32 +++++++++++++++++++++++++-------
 render/picture.c         |   17 +++++++++++------
 render/picturestr.h      |   10 ++++++++++
 6 files changed, 58 insertions(+), 16 deletions(-)

New commits:
diff-tree a838fb70c52a829872680f6a2a2e7dd6d2dc9247 (from 25d871d98462f0481ee419295ddc94b8c79dc881)
Author: Eric Anholt <anholt at FreeBSD.org>
Date:   Mon Jul 3 19:22:36 2006 +0200

    Bump server version to 7.1.99.2 for gradient and repeat fixes.

diff --git a/configure.ac b/configure.ac
index af7d066..9d8dfed 100644
--- a/configure.ac
+++ b/configure.ac
@@ -296,7 +296,7 @@ DEFAULT_VENDOR_NAME_SHORT="X.Org"
 DEFAULT_VERSION_MAJOR=7
 DEFAULT_VERSION_MINOR=1
 DEFAULT_VERSION_PATCH=99
-DEFAULT_VERSION_SNAP=1
+DEFAULT_VERSION_SNAP=2
 DEFAULT_RELEASE_DATE="21 December 2005"
 DEFAULT_VENDOR_WEB="http://wiki.x.org"
 
diff-tree 25d871d98462f0481ee419295ddc94b8c79dc881 (from 7106a77df37c06d2b5568eceeb9297096bff3137)
Author: Eric Anholt <anholt at FreeBSD.org>
Date:   Mon Jul 3 19:22:26 2006 +0200

    Fix source picture filter check for multiple screens.
    
    Now, we only check for filter commonality if we're operating on a source
    picture, and we compare the id (screen-independent index of the filter name)
    rather than the pointer to the filter (per-screen state).

diff --git a/render/filter.c b/render/filter.c
index 61e0400..71375da 100644
--- a/render/filter.c
+++ b/render/filter.c
@@ -277,9 +277,17 @@ SetPictureFilter (PicturePtr pPicture, c
 
     pFilter = PictureFindFilter (screenInfo.screens[0], name, len);
 
-    for (s = 0; s < screenInfo.numScreens; s++) {
-	if (PictureFindFilter (screenInfo.screens[s], name, len) != pFilter)
-	    return BadMatch;
+    if (pPicture->pDrawable == NULL) {
+	/* For source pictures, the picture isn't tied to a screen.  So, ensure
+	 * that all screens can handle a filter we set for the picture.
+	 */
+	for (s = 0; s < screenInfo.numScreens; s++) {
+	    if (PictureFindFilter (screenInfo.screens[s], name, len)->id !=
+		pFilter->id)
+	    {
+		return BadMatch;
+	    }
+	}
     }
 
     if (!pFilter)
diff-tree 7106a77df37c06d2b5568eceeb9297096bff3137 (from f5e92542a14f51029347b6476e4e4af69144930b)
Author: Eric Anholt <anholt at FreeBSD.org>
Date:   Sun Jul 2 12:41:35 2006 +0200

    Fix bugs in support for new repeatTypes in XAA and EXA.
    
    EXA now won't pass pictures with new repeatTypes to drivers.  We can add a flag
    for them to support it at a later time.

diff --git a/exa/exa_render.c b/exa/exa_render.c
index b21c5d7..2187af8 100644
--- a/exa/exa_render.c
+++ b/exa/exa_render.c
@@ -535,7 +535,8 @@ exaComposite(CARD8	op,
 	if (op == PictOpSrc)
 	{
 	    if (pSrc->pDrawable->width == 1 &&
-		pSrc->pDrawable->height == 1 && pSrc->repeat)
+		pSrc->pDrawable->height == 1 && pSrc->repeat &&
+		pSrc->repeatType == RepeatNormal)
 	    {
 		ret = exaTryDriverSolidFill(pSrc, pDst, xSrc, ySrc, xDst, yDst,
 					    width, height);
@@ -575,6 +576,8 @@ exaComposite(CARD8	op,
 	    pMask->repeat = 0;
 
     if (pExaScr->info->PrepareComposite &&
+	(!pSrc->repeat || pSrc->repeat == RepeatNormal) &&
+	(!pMask || !pMask->repeat || pMask->repeat == RepeatNormal) &&
 	!pSrc->alphaMap && (!pMask || !pMask->alphaMap) && !pDst->alphaMap)
     {
 	ret = exaTryDriverComposite(op, pSrc, pMask, pDst, xSrc, ySrc, xMask,
diff --git a/hw/xfree86/xaa/xaaPict.c b/hw/xfree86/xaa/xaaPict.c
index a1ff510..a7acf45 100644
--- a/hw/xfree86/xaa/xaaPict.c
+++ b/hw/xfree86/xaa/xaaPict.c
@@ -218,7 +218,13 @@ XAADoComposite (
 
     if (pDst->alphaMap || pSrc->alphaMap || (pMask && pMask->alphaMap))
 	return FALSE;
-	
+
+    if ((pSrc->repeat && pSrc->repeatType != RepeatNormal) ||
+	(pMask && pMask->repeat && pMask->repeatType != RepeatNormal))
+    {
+	return FALSE;
+    }
+
     xDst += pDst->pDrawable->x;
     yDst += pDst->pDrawable->y;
     xSrc += pSrc->pDrawable->x;
diff-tree f5e92542a14f51029347b6476e4e4af69144930b (from 6ef457913955d4289081c7d07d528963ccf5272c)
Author: Eric Anholt <anholt at FreeBSD.org>
Date:   Fri Jun 30 12:03:47 2006 +0200

    Bug #7366: Fix crashes when setting filters on source pictures.
    
    Now, filters may only be set on source pictures when the filter is common to
    all screens.  Also, like SetPictureTransform, ChangePictureFilter is now not
    called on source pictures.

diff --git a/render/filter.c b/render/filter.c
index f81cc4a..61e0400 100644
--- a/render/filter.c
+++ b/render/filter.c
@@ -271,11 +271,16 @@ PictureResetFilters (ScreenPtr pScreen)
 int
 SetPictureFilter (PicturePtr pPicture, char *name, int len, xFixed *params, int nparams)
 {
-    ScreenPtr		pScreen = pPicture->pDrawable->pScreen;
-    PictureScreenPtr	ps = GetPictureScreen(pScreen);
-    PictFilterPtr	pFilter = PictureFindFilter (pScreen, name, len);
+    PictFilterPtr	pFilter;
     xFixed		*new_params;
-    int			i, result;
+    int			i, s, result;
+
+    pFilter = PictureFindFilter (screenInfo.screens[0], name, len);
+
+    for (s = 0; s < screenInfo.numScreens; s++) {
+	if (PictureFindFilter (screenInfo.screens[s], name, len) != pFilter)
+	    return BadMatch;
+    }
 
     if (!pFilter)
 	return BadName;
@@ -300,8 +305,13 @@ SetPictureFilter (PicturePtr pPicture, c
 	pPicture->filter_params[i] = params[i];
     pPicture->filter = pFilter->id;
 
-    result = (*ps->ChangePictureFilter) (pPicture, pPicture->filter,
-					 params, nparams);
-    return result;
+    if (pPicture->pDrawable) {
+	ScreenPtr pScreen = pPicture->pDrawable->pScreen;
+	PictureScreenPtr ps = GetPictureScreen(pScreen);
+
+	result = (*ps->ChangePictureFilter) (pPicture, pPicture->filter,
+					     params, nparams);
+	return result;
+    }
     return Success;
 }
diff --git a/render/picturestr.h b/render/picturestr.h
index 25969a6..f1617f6 100644
--- a/render/picturestr.h
+++ b/render/picturestr.h
@@ -355,7 +355,12 @@ typedef struct _PictureScreen {
      */
     ChangePictureTransformProcPtr   ChangePictureTransform;
 
+    /**
+     * Called immediately after a picture's transform is changed through the
+     * SetPictureFilter request.  Not called for source-only pictures.
+     */
     ChangePictureFilterProcPtr	ChangePictureFilter;
+
     DestroyPictureFilterProcPtr	DestroyPictureFilter;
 
     TrapezoidsProcPtr		Trapezoids;
diff-tree 6ef457913955d4289081c7d07d528963ccf5272c (from 50a3e1ad18c815a5adafee22beccdf970bae62d6)
Author: Eric Anholt <anholt at FreeBSD.org>
Date:   Fri Jun 30 03:01:14 2006 +0200

    Bug #7366: Fix two crashes in operations on source pictures.
    
    A screen's ChangePictureTransform now isn't called when changing the transform,
    as source pictures aren't associated with screens.  Also, attempting to set
    an AlphaMap to a source picture will fail with BadMatch just like a Window
    would, preventing another crash.

diff --git a/render/picture.c b/render/picture.c
index ee385e5..55763fc 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -1217,7 +1217,8 @@ ChangePicture (PicturePtr	pPicture,
 			    error = BadPixmap;
 			    break;
 			}
-			if (pAlpha->pDrawable->type != DRAWABLE_PIXMAP)
+			if (pAlpha->pDrawable == NULL ||
+			    pAlpha->pDrawable->type != DRAWABLE_PIXMAP)
 			{
 			    client->errorValue = pid;
 			    error = BadMatch;
@@ -1469,9 +1470,6 @@ SetPictureTransform (PicturePtr	    pPic
 	{ 0x00000, xFixed1, 0x00000 },
 	{ 0x00000, 0x00000, xFixed1 },
     } };
-    ScreenPtr		pScreen = pPicture->pDrawable->pScreen;
-    PictureScreenPtr	ps = GetPictureScreen(pScreen);
-    int			result;
 
     if (transform && memcmp (transform, &identity, sizeof (PictTransform)) == 0)
 	transform = 0;
@@ -1496,9 +1494,16 @@ SetPictureTransform (PicturePtr	    pPic
     }
     pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT;
 
-    result = (*ps->ChangePictureTransform) (pPicture, transform);
+    if (pPicture->pDrawable != NULL) {
+	int result;
+	PictureScreenPtr ps = GetPictureScreen(pPicture->pDrawable->pScreen);
 
-    return result;
+	result = (*ps->ChangePictureTransform) (pPicture, transform);
+
+	return result;
+    }
+
+    return Success;
 }
 
 void
diff --git a/render/picturestr.h b/render/picturestr.h
index 1ea9120..25969a6 100644
--- a/render/picturestr.h
+++ b/render/picturestr.h
@@ -349,7 +349,12 @@ typedef struct _PictureScreen {
     PictFilterAliasPtr		filterAliases;
     int				nfilterAliases;
 
+    /**
+     * Called immediately after a picture's transform is changed through the
+     * SetPictureTransform request.  Not called for source-only pictures.
+     */
     ChangePictureTransformProcPtr   ChangePictureTransform;
+
     ChangePictureFilterProcPtr	ChangePictureFilter;
     DestroyPictureFilterProcPtr	DestroyPictureFilter;
 



More information about the xorg-commit mailing list