xserver: Branch 'master' - 3 commits

Keith Packard keithp at kemper.freedesktop.org
Wed Oct 19 19:22:17 PDT 2011


 randr/rrproperty.c  |   19 +++++++++++++---
 render/mipict.c     |   61 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 render/mipict.h     |   20 +++++++++++++++++
 render/picture.c    |   44 ++++++++++---------------------------
 render/picturestr.h |   21 +++++++++++++++++
 5 files changed, 130 insertions(+), 35 deletions(-)

New commits:
commit ff61592441916b83aeb778c74352bb5b26247f84
Merge: af3f64f... 525d417...
Author: Keith Packard <keithp at keithp.com>
Date:   Wed Oct 19 19:14:32 2011 -0700

    Merge remote-tracking branch 'aplattner/for-master'

commit 525d4172b246e13b8122e059e3b22866e00561d9
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Sep 4 09:34:08 2011 -0700

    render: export TriStrip and TriFan to the drivers
    
    Rather than perform an intermediate copy and expand the strip and the
    fan into a triangle list (thereby tripling the number of edges that the
    driver needs to process), allow the backend to hook directly into the
    appropriate Composite function.
    
    In order to extend the PictureScreen, without needlessly bumping the
    ABI, we move the existing copy implementations to mipict.c and assign
    those by default. To notify the ddx that the new entry points are
    available, we introduce PICTURE_SCREEN_VERSION.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
    Reviewed-by: Aaron Plattner <aplattner at nvidia.com>

diff --git a/render/mipict.c b/render/mipict.c
index 9a44c27..0b86bee 100644
--- a/render/mipict.c
+++ b/render/mipict.c
@@ -569,6 +569,64 @@ miRenderPixelToColor (PictFormatPtr format,
     }
 }
 
+void
+miTriStrip (CARD8	    op,
+	    PicturePtr	    pSrc,
+	    PicturePtr	    pDst,
+	    PictFormatPtr  maskFormat,
+	    INT16	    xSrc,
+	    INT16	    ySrc,
+	    int		    npoints,
+	    xPointFixed    *points)
+{
+    xTriangle           *tris, *tri;
+    int                 ntri;
+
+    ntri = npoints - 2;
+    tris = malloc(ntri * sizeof (xTriangle));
+    if (!tris)
+        return;
+
+    for (tri = tris; npoints >= 3; npoints--, points++, tri++)
+    {
+        tri->p1 = points[0];
+        tri->p2 = points[1];
+        tri->p3 = points[2];
+    }
+    CompositeTriangles (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
+    free(tris);
+}
+
+void
+miTriFan (CARD8		op,
+	  PicturePtr	pSrc,
+	  PicturePtr	pDst,
+	  PictFormatPtr	maskFormat,
+	  INT16		xSrc,
+	  INT16		ySrc,
+	  int		npoints,
+	  xPointFixed	*points)
+{
+    xTriangle		*tris, *tri;
+    xPointFixed		*first;
+    int			ntri;
+
+    ntri = npoints - 2;
+    tris = malloc(ntri * sizeof (xTriangle));
+    if (!tris)
+	return;
+
+    first = points++;
+    for (tri = tris; npoints >= 3; npoints--, points++, tri++)
+    {
+	tri->p1 = *first;
+	tri->p2 = points[0];
+	tri->p3 = points[1];
+    }
+    CompositeTriangles (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
+    free(tris);
+}
+
 Bool
 miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
 {
@@ -602,5 +660,8 @@ miPictureInit (ScreenPtr pScreen, PictFormatPtr formats, int nformats)
     ps->AddTraps	= 0;			/* requires DDX support */
     ps->AddTriangles	= 0;			/* requires DDX support */
 
+    ps->TriStrip	= miTriStrip; /* converts call to CompositeTriangles */
+    ps->TriFan		= miTriFan;
+
     return TRUE;
 }
diff --git a/render/mipict.h b/render/mipict.h
index f6d9dee..4399a6f 100644
--- a/render/mipict.h
+++ b/render/mipict.h
@@ -140,6 +140,26 @@ miCompositeRects (CARD8		op,
 		  xRectangle    *rects);
 
 extern _X_EXPORT void
+miTriStrip (CARD8	    op,
+	    PicturePtr	    pSrc,
+	    PicturePtr	    pDst,
+	    PictFormatPtr  maskFormat,
+	    INT16	    xSrc,
+	    INT16	    ySrc,
+	    int		    npoints,
+	    xPointFixed    *points);
+
+extern _X_EXPORT void
+miTriFan (CARD8		op,
+	  PicturePtr	pSrc,
+	  PicturePtr	pDst,
+	  PictFormatPtr	maskFormat,
+	  INT16		xSrc,
+	  INT16		ySrc,
+	  int		npoints,
+	  xPointFixed	*points);
+
+extern _X_EXPORT void
 miTrapezoidBounds (int ntrap, xTrapezoid *traps, BoxPtr box);
 
 extern _X_EXPORT void
diff --git a/render/picture.c b/render/picture.c
index 5640c4d..f134596 100644
--- a/render/picture.c
+++ b/render/picture.c
@@ -1715,23 +1715,14 @@ CompositeTriStrip (CARD8	    op,
 		   int		    npoints,
 		   xPointFixed	    *points)
 {
-    xTriangle           *tris, *tri;
-    int                 ntri;
-    
+    PictureScreenPtr	ps = GetPictureScreen(pDst->pDrawable->pScreen);
+
     if (npoints < 3)
         return;
-    ntri = npoints - 2;
-    tris = malloc(ntri * sizeof (xTriangle));
-    if (!tris)
-        return;
-    for (tri = tris; npoints >= 3; npoints--, points++, tri++)
-    {
-        tri->p1 = points[0];
-        tri->p2 = points[1];
-        tri->p3 = points[2];
-    }
-    CompositeTriangles (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
-    free(tris);
+
+    ValidatePicture (pSrc);
+    ValidatePicture (pDst);
+    (*ps->TriStrip) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points);
 }
 
 void
@@ -1744,25 +1735,14 @@ CompositeTriFan (CARD8		op,
 		 int		npoints,
 		 xPointFixed	*points)
 {
-    xTriangle		*tris, *tri;
-    xPointFixed		*first;
-    int			ntri;
-    
+    PictureScreenPtr	ps = GetPictureScreen(pDst->pDrawable->pScreen);
+
     if (npoints < 3)
 	return;
-    ntri = npoints - 2;
-    tris = malloc(ntri * sizeof (xTriangle));
-    if (!tris)
-	return;
-    first = points++;
-    for (tri = tris; npoints >= 3; npoints--, points++, tri++)
-    {
-	tri->p1 = *first;
-	tri->p2 = points[0];
-	tri->p3 = points[1];
-    }
-    CompositeTriangles (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntri, tris);
-    free(tris);
+
+    ValidatePicture (pSrc);
+    ValidatePicture (pDst);
+    (*ps->TriFan) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points);
 }
 
 void
diff --git a/render/picturestr.h b/render/picturestr.h
index 7b7f911..1f3f5a4 100644
--- a/render/picturestr.h
+++ b/render/picturestr.h
@@ -260,6 +260,24 @@ typedef void	(*TrianglesProcPtr)	    (CARD8	    op,
 					     int	    ntri,
 					     xTriangle	    *tris);
 
+typedef void	(*TriStripProcPtr)	    (CARD8	    op,
+					     PicturePtr	    pSrc,
+					     PicturePtr	    pDst,
+					     PictFormatPtr  maskFormat,
+					     INT16	    xSrc,
+					     INT16	    ySrc,
+					     int	    npoint,
+					     xPointFixed    *points);
+
+typedef void	(*TriFanProcPtr)	    (CARD8	    op,
+					     PicturePtr	    pSrc,
+					     PicturePtr	    pDst,
+					     PictFormatPtr  maskFormat,
+					     INT16	    xSrc,
+					     INT16	    ySrc,
+					     int	    npoint,
+					     xPointFixed    *points);
+
 typedef Bool	(*InitIndexedProcPtr)	    (ScreenPtr	    pScreen,
 					     PictFormatPtr  pFormat);
 
@@ -348,6 +366,9 @@ typedef struct _PictureScreen {
     RealizeGlyphProcPtr   	RealizeGlyph;
     UnrealizeGlyphProcPtr 	UnrealizeGlyph;
 
+#define PICTURE_SCREEN_VERSION 2
+    TriStripProcPtr		TriStrip;
+    TriFanProcPtr		TriFan;
 } PictureScreenRec, *PictureScreenPtr;
 
 extern _X_EXPORT DevPrivateKeyRec PictureScreenPrivateKeyRec;
commit 9b26e6bc8d2cdf5bac3025796855ccf05972358f
Author: Luc Verhaegen <libv at skynet.be>
Date:   Tue Aug 23 15:19:59 2011 -0700

    randr: stop clients from deleting immutable output properties
    
    Immutable in randr means that clients are not able to alter the
    property itself, they are only allowed to alter the property value.
    This logically means that the property then should not be deleted
    by the client either.
    
    Signed-off-by: Luc Verhaegen <libv at skynet.be>
    Reviewed-by: Rami Ylimäki <rami.ylimaki at vincit.fi>
    Reviewed-by: Aaron Plattner <aplattner at nvidia.com>
    Signed-off-by: Aaron Plattner <aplattner at nvidia.com>

diff --git a/randr/rrproperty.c b/randr/rrproperty.c
index 6ed24d3..d0a9020 100644
--- a/randr/rrproperty.c
+++ b/randr/rrproperty.c
@@ -549,18 +549,31 @@ int
 ProcRRDeleteOutputProperty (ClientPtr client)
 {
     REQUEST(xRRDeleteOutputPropertyReq);
-    RROutputPtr	output;
-              
+    RROutputPtr		output;
+    RRPropertyPtr	prop;
+
     REQUEST_SIZE_MATCH(xRRDeleteOutputPropertyReq);
     UpdateCurrentTime();
     VERIFY_RR_OUTPUT(stuff->output, output, DixReadAccess);
-    
+
     if (!ValidAtom(stuff->property))
     {
 	client->errorValue = stuff->property;
 	return BadAtom;
     }
 
+    prop = RRQueryOutputProperty(output, stuff->property);
+    if (!prop)
+    {
+	client->errorValue = stuff->property;
+	return BadName;
+    }
+
+    if (prop->immutable)
+    {
+	client->errorValue = stuff->property;
+	return BadAccess;
+    }
 
     RRDeleteOutputProperty(output, stuff->property);
     return Success;


More information about the xorg-commit mailing list