xf86-video-ati: Branch 'master'

Alex Deucher agd5f at kemper.freedesktop.org
Mon May 17 06:59:49 PDT 2010


 src/radeon_exa_render.c |   46 ++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 40 insertions(+), 6 deletions(-)

New commits:
commit 27c3326863deae36bc35e2c3b73fffd400208ff1
Author: Alex Deucher <alexdeucher at gmail.com>
Date:   Mon May 17 09:53:32 2010 -0400

    r1xx/r2xx EXA: handle RepeatNone properly with transforms
    
    Fallback with unsupported ops like r3xx, r6xx.
    
    Should fix fdo bug 28142.
    
    Signed-off-by: Alex Deucher <alexdeucher at gmail.com>

diff --git a/src/radeon_exa_render.c b/src/radeon_exa_render.c
index e68faff..a42588d 100644
--- a/src/radeon_exa_render.c
+++ b/src/radeon_exa_render.c
@@ -332,8 +332,12 @@ static Bool RADEONSetupSourceTile(PicturePtr pPict,
 
 /* R100-specific code */
 
-static Bool R100CheckCompositeTexture(PicturePtr pPict, int unit)
+static Bool R100CheckCompositeTexture(PicturePtr pPict,
+				      PicturePtr pDstPict,
+				      int op,
+				      int unit)
 {
+    unsigned int repeatType = pPict->repeat ? pPict->repeatType : RepeatNone;
     int w = pPict->pDrawable->width;
     int h = pPict->pDrawable->height;
     int i;
@@ -362,6 +366,19 @@ static Bool R100CheckCompositeTexture(PicturePtr pPict, int unit)
 	RADEON_FALLBACK(("Unsupported filter 0x%x\n", pPict->filter));
     }
 
+    /* for REPEAT_NONE, Render semantics are that sampling outside the source
+     * picture results in alpha=0 pixels. We can implement this with a border color
+     * *if* our source texture has an alpha channel, otherwise we need to fall
+     * back. If we're not transformed then we hope that upper layers have clipped
+     * rendering to the bounds of the source drawable, in which case it doesn't
+     * matter. I have not, however, verified that the X server always does such
+     * clipping.
+     */
+    if (pPict->transform != 0 && repeatType == RepeatNone && PICT_FORMAT_A(pPict->format) == 0) {
+	if (!(((op == PictOpSrc) || (op == PictOpClear)) && (PICT_FORMAT_A(pDstPict->format) == 0)))
+	    RADEON_FALLBACK(("REPEAT_NONE unsupported for transformed xRGB source\n"));
+    }
+
     return TRUE;
 }
 
@@ -551,11 +568,11 @@ static Bool R100CheckComposite(int op, PicturePtr pSrcPicture,
 	    }
 	}
 
-	if (!R100CheckCompositeTexture(pMaskPicture, 1))
+	if (!R100CheckCompositeTexture(pMaskPicture, pDstPicture, op, 1))
 	    return FALSE;
     }
 
-    if (!R100CheckCompositeTexture(pSrcPicture, 0))
+    if (!R100CheckCompositeTexture(pSrcPicture, pDstPicture, op, 0))
 	return FALSE;
 
     if (!RADEONGetDestFormat(pDstPicture, &tmp1))
@@ -723,8 +740,12 @@ static Bool FUNC_NAME(R100PrepareComposite)(int op,
 
 #ifdef ONLY_ONCE
 
-static Bool R200CheckCompositeTexture(PicturePtr pPict, int unit)
+static Bool R200CheckCompositeTexture(PicturePtr pPict,
+				      PicturePtr pDstPict,
+				      int op,
+				      int unit)
 {
+    unsigned int repeatType = pPict->repeat ? pPict->repeatType : RepeatNone;
     int w = pPict->pDrawable->width;
     int h = pPict->pDrawable->height;
     int i;
@@ -752,6 +773,19 @@ static Bool R200CheckCompositeTexture(PicturePtr pPict, int unit)
 	pPict->filter != PictFilterBilinear)
 	RADEON_FALLBACK(("Unsupported filter 0x%x\n", pPict->filter));
 
+    /* for REPEAT_NONE, Render semantics are that sampling outside the source
+     * picture results in alpha=0 pixels. We can implement this with a border color
+     * *if* our source texture has an alpha channel, otherwise we need to fall
+     * back. If we're not transformed then we hope that upper layers have clipped
+     * rendering to the bounds of the source drawable, in which case it doesn't
+     * matter. I have not, however, verified that the X server always does such
+     * clipping.
+     */
+    if (pPict->transform != 0 && repeatType == RepeatNone && PICT_FORMAT_A(pPict->format) == 0) {
+	if (!(((op == PictOpSrc) || (op == PictOpClear)) && (PICT_FORMAT_A(pDstPict->format) == 0)))
+	    RADEON_FALLBACK(("REPEAT_NONE unsupported for transformed xRGB source\n"));
+    }
+
     return TRUE;
 }
 
@@ -932,11 +966,11 @@ static Bool R200CheckComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskP
 	    }
 	}
 
-	if (!R200CheckCompositeTexture(pMaskPicture, 1))
+	if (!R200CheckCompositeTexture(pMaskPicture, pDstPicture, op, 1))
 	    return FALSE;
     }
 
-    if (!R200CheckCompositeTexture(pSrcPicture, 0))
+    if (!R200CheckCompositeTexture(pSrcPicture, pDstPicture, op, 1))
 	return FALSE;
 
     if (!RADEONGetDestFormat(pDstPicture, &tmp1))


More information about the xorg-commit mailing list