Module Name:    xsrc
Committed By:   macallan
Date:           Wed Jul  6 03:43:41 UTC 2011

Modified Files:
        xsrc/external/mit/xf86-video-ati/dist/src: radeon_render.c

Log Message:
make Xrender acceleration work again on R1xx
tested on a Sun XVR-100


To generate a diff of this commit:
cvs rdiff -u -r1.1.1.3 -r1.2 \
    xsrc/external/mit/xf86-video-ati/dist/src/radeon_render.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: xsrc/external/mit/xf86-video-ati/dist/src/radeon_render.c
diff -u xsrc/external/mit/xf86-video-ati/dist/src/radeon_render.c:1.1.1.3 xsrc/external/mit/xf86-video-ati/dist/src/radeon_render.c:1.2
--- xsrc/external/mit/xf86-video-ati/dist/src/radeon_render.c:1.1.1.3	Sun May 23 06:09:25 2010
+++ xsrc/external/mit/xf86-video-ati/dist/src/radeon_render.c	Wed Jul  6 03:43:41 2011
@@ -409,6 +409,9 @@
     dst_pitch = RADEON_ALIGN(width * tex_bytepp, 64);
     size = dst_pitch * height;
 
+    info->accel_state->texW[0] = width;
+    info->accel_state->texH[0] = height;
+
     if ((flags & XAA_RENDER_REPEAT) && (height != 1) &&
 	(RADEON_ALIGN(width * tex_bytepp, 32) != dst_pitch))
 	return FALSE;
@@ -432,7 +435,7 @@
 	txformat |= ATILog2(width) << RADEON_TXFORMAT_WIDTH_SHIFT;
 	txformat |= ATILog2(height) << RADEON_TXFORMAT_HEIGHT_SHIFT;
     } else {
-	tex_size = (height << 16) | width;
+	tex_size = ((height - 1) << 16) | (width - 1);
 	txformat |= RADEON_TXFORMAT_NON_POWER2;
     }
 
@@ -462,7 +465,6 @@
 
     if (info->accel_state->accel->NeedToSync)
 	info->accel_state->accel->Sync(pScrn);
-
     while (height--) {
 	memcpy(dst, src, width * tex_bytepp);
 	src += src_pitch;
@@ -633,10 +635,10 @@
 
     r = width + l;
     b = height + t;
-    fl = srcx;
-    fr = srcx + width;
-    ft = srcy;
-    fb = srcy + height;
+    fl = (float)srcx / info->accel_state->texW[0];
+    fr = (float)(srcx + width) / info->accel_state->texW[0];
+    ft = (float)srcy / info->accel_state->texH[0];
+    fb = (float)(srcy + height) / info->accel_state->texH[0];
 
 #ifdef ACCEL_CP
     BEGIN_RING(25);

Reply via email to