xf86-video-ati: Branch 'master'

Alex Deucher agd5f at kemper.freedesktop.org
Thu Apr 3 11:44:40 PDT 2008


 src/radeon_exa_render.c |   22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

New commits:
commit c40a7aa3989576a8144213e2f31b892d21df8686
Author: Owen W. Taylor <otaylor at fishsoup.net>
Date:   Thu Apr 3 14:43:55 2008 -0400

    R3xx/R5xx: Fix pitch and clamp mode for repeating textures
    
         - We can always use TXPITCH on a R300 even when repeating,
           (previous check for pitch matching width was also wrong)
         - Fix clamp mode for repeating textures to be WRAP

diff --git a/src/radeon_exa_render.c b/src/radeon_exa_render.c
index 9496bb6..4e5ab81 100644
--- a/src/radeon_exa_render.c
+++ b/src/radeon_exa_render.c
@@ -870,6 +870,7 @@ static Bool FUNC_NAME(R300TextureSetup)(PicturePtr pPict, PixmapPtr pPix,
     if ((txpitch & 0x1f) != 0)
 	RADEON_FALLBACK(("Bad texture pitch 0x%x\n", (int)txpitch));
 
+    /* TXPITCH = pixels (texels) per line - 1 */
     pixel_shift = pPix->drawable.bitsPerPixel >> 4;
     txpitch >>= pixel_shift;
     txpitch -= 1;
@@ -894,20 +895,21 @@ static Bool FUNC_NAME(R300TextureSetup)(PicturePtr pPict, PixmapPtr pPix,
     if (IS_R500_3D && ((h - 1) & 0x800))
 	txpitch |= R500_TXHEIGHT_11;
 
-    if (pPict->repeat) {
-	if ((h != 1) &&
-	    (((w * pPix->drawable.bitsPerPixel / 8 + 31) & ~31) != txpitch))
-	    RADEON_FALLBACK(("Width %d and pitch %u not compatible for repeat\n",
-			     w, (unsigned)txpitch));
-    } else
-	txformat0 |= R300_TXPITCH_EN;
-
+    /* Use TXPITCH instead of TXWIDTH for address computations: we could
+     * omit this if there is no padding, but there is no apparent advantage
+     * in doing so.
+     */
+    txformat0 |= R300_TXPITCH_EN;
 
     info->texW[unit] = w;
     info->texH[unit] = h;
 
-    txfilter = (R300_TX_CLAMP_S(R300_TX_CLAMP_CLAMP_LAST) |
-		R300_TX_CLAMP_T(R300_TX_CLAMP_CLAMP_LAST));
+    if (pPict->repeat)
+      txfilter = (R300_TX_CLAMP_S(R300_TX_CLAMP_WRAP) |
+		  R300_TX_CLAMP_T(R300_TX_CLAMP_WRAP));
+    else
+      txfilter = (R300_TX_CLAMP_S(R300_TX_CLAMP_CLAMP_LAST) |
+		  R300_TX_CLAMP_T(R300_TX_CLAMP_CLAMP_LAST));
 
     txfilter |= (unit << R300_TX_ID_SHIFT);
 


More information about the xorg-commit mailing list