Index: src/radeon.h =================================================================== RCS file: /cvs/xorg/driver/xf86-video-ati/src/radeon.h,v retrieving revision 1.42 diff -p -u -r1.42 radeon.h --- src/radeon.h 26 Apr 2006 08:38:47 -0000 1.42 +++ src/radeon.h 28 Apr 2006 09:48:43 -0000 @@ -802,7 +816,8 @@ extern int RADEONCPStop(ScrnInfo extern CARD8* RADEONHostDataBlit(ScrnInfoPtr pScrn, unsigned int bpp, unsigned int w, CARD32 dstPitch, CARD32 *bufPitch, CARD8 **dst, - unsigned int *h, unsigned int *hpass); + unsigned int *h, unsigned int *hpass, + Bool tiled); extern void RADEONHostDataBlitCopyPass(ScrnInfoPtr pScrn, unsigned int bpp, CARD8 *dst, CARD8 *src, Index: src/radeon_accel.c =================================================================== RCS file: /cvs/xorg/driver/xf86-video-ati/src/radeon_accel.c,v retrieving revision 1.25 diff -p -u -r1.25 radeon_accel.c --- src/radeon_accel.c 28 Apr 2006 02:55:08 -0000 1.25 +++ src/radeon_accel.c 28 Apr 2006 09:48:43 -0000 @@ -618,7 +618,8 @@ RADEONHostDataBlit( CARD32 *bufPitch, CARD8* *dst, unsigned int *h, - unsigned int *hpass + unsigned int *hpass, + Bool tiled ){ RADEONInfoPtr info = RADEONPTR( pScrn ); CARD32 format, dst_offs, dwords, x, y; @@ -638,13 +639,11 @@ RADEONHostDataBlit( break; case 2: format = RADEON_GMC_DST_16BPP; - w = (w + 1) & ~1; - *bufPitch = 2 * w; + *bufPitch = 2 * ((w + 1) & ~1); break; case 1: format = RADEON_GMC_DST_8BPP_CI; - w = (w + 3) & ~3; - *bufPitch = w; + *bufPitch = (w + 3) & ~3; break; default: xf86DrvMsg( pScrn->scrnIndex, X_ERROR, @@ -675,15 +674,16 @@ RADEONHostDataBlit( RADEON_WAIT_UNTIL_IDLE();*/ dst_offs = *dst - info->FB + info->fbLocation; - *hpass = min( *h, ( ( RADEON_BUFFER_SIZE - 8 * 4 ) / *bufPitch ) ); + *hpass = min( *h, ( ( RADEON_BUFFER_SIZE - 10 * 4 ) / *bufPitch ) ); dwords = *hpass * *bufPitch / 4; - y = ( dst_offs & 1023 ) / dstPitch; - x = ( ( dst_offs & 1023 ) - ( y * dstPitch ) ) / bpp; + y = ( dst_offs & RADEON_BUFFER_ALIGN ) / dstPitch; + x = ( ( dst_offs & RADEON_BUFFER_ALIGN ) - ( y * dstPitch ) ) / bpp; - BEGIN_RING( dwords + 8 ); - OUT_RING( CP_PACKET3( RADEON_CP_PACKET3_CNTL_HOSTDATA_BLT, dwords + 8 - 2 ) ); + BEGIN_RING( dwords + 10 ); + OUT_RING( CP_PACKET3( RADEON_CP_PACKET3_CNTL_HOSTDATA_BLT, dwords + 10 - 2 ) ); OUT_RING( RADEON_GMC_DST_PITCH_OFFSET_CNTL + | RADEON_GMC_DST_CLIPPING | RADEON_GMC_BRUSH_NONE | format | RADEON_GMC_SRC_DATATYPE_COLOR @@ -691,11 +691,14 @@ RADEONHostDataBlit( | RADEON_DP_SRC_SOURCE_HOST_DATA | RADEON_GMC_CLR_CMP_CNTL_DIS | RADEON_GMC_WR_MSK_DIS ); - OUT_RING( dstPitch << 16 | dst_offs >> 10 ); + OUT_RING( (tiled ? RADEON_DST_TILE_MACRO : 0) | dstPitch << 16 + | (dst_offs & ~RADEON_BUFFER_ALIGN) >> 10 ); + OUT_RING( (y << 16) | x ); + OUT_RING( ((y + *hpass) << 16) | (x + w) ); OUT_RING( 0xffffffff ); OUT_RING( 0xffffffff ); OUT_RING( y << 16 | x ); - OUT_RING( *hpass << 16 | w ); + OUT_RING( *hpass << 16 | (*bufPitch / bpp) ); OUT_RING( dwords ); ret = ( CARD8* )&__head[__count]; Index: src/radeon_exa_funcs.c =================================================================== RCS file: /cvs/xorg/driver/xf86-video-ati/src/radeon_exa_funcs.c,v retrieving revision 1.5 diff -p -u -r1.5 radeon_exa_funcs.c --- src/radeon_exa_funcs.c 22 Mar 2006 22:30:14 -0000 1.5 +++ src/radeon_exa_funcs.c 28 Apr 2006 09:48:45 -0000 @@ -220,6 +218,7 @@ FUNC_NAME(RADEONUploadToScreen)(PixmapPt #ifdef ACCEL_CP unsigned int hpass; CARD32 buf_pitch; + Bool tiled = RADEONPixmapIsColortiled(pDst); #endif #if X_BYTE_ORDER == X_BIG_ENDIAN unsigned char *RADEONMMIO = info->MMIO; @@ -243,8 +250,8 @@ FUNC_NAME(RADEONUploadToScreen)(PixmapPt RADEON_SWITCH_TO_2D(); while ((buf = RADEONHostDataBlit(pScrn, cpp, w, dst_pitch, &buf_pitch, - &dst, &h, &hpass)) != 0) { - RADEONHostDataBlitCopyPass(pScrn, cpp, buf, (unsigned char *)src, + &dst, (unsigned int*)&h, &hpass, tiled)) != 0) { + RADEONHostDataBlitCopyPass(pScrn, cpp, buf, (CARD8 *)src, hpass, buf_pitch, src_pitch); src += hpass * src_pitch; Index: src/radeon_render.c =================================================================== RCS file: /cvs/xorg/driver/xf86-video-ati/src/radeon_render.c,v retrieving revision 1.19 diff -p -u -r1.19 radeon_render.c --- src/radeon_render.c 22 Mar 2006 22:30:14 -0000 1.19 +++ src/radeon_render.c 28 Apr 2006 09:48:45 -0000 @@ -434,7 +434,7 @@ static Bool FUNC_NAME(R100SetupTexture)( { tmp_dst = RADEONHostDataBlit( pScrn, tex_bytepp, width, dst_pitch, &buf_pitch, - &dst, &height, &hpass); + &dst, &height, &hpass, FALSE ); RADEONHostDataBlitCopyPass( pScrn, tex_bytepp, tmp_dst, src, hpass, buf_pitch, src_pitch ); src += hpass * src_pitch; @@ -766,7 +766,7 @@ static Bool FUNC_NAME(R200SetupTexture)( { tmp_dst = RADEONHostDataBlit( pScrn, tex_bytepp, width, dst_pitch, &buf_pitch, - &dst, &height, &hpass ); + &dst, &height, &hpass, FALSE ); RADEONHostDataBlitCopyPass( pScrn, tex_bytepp, tmp_dst, src, hpass, buf_pitch, src_pitch ); src += hpass * src_pitch; Index: src/radeon_video.c =================================================================== RCS file: /cvs/xorg/driver/xf86-video-ati/src/radeon_video.c,v retrieving revision 1.33 diff -p -u -r1.33 radeon_video.c --- src/radeon_video.c 7 Apr 2006 23:06:02 -0000 1.33 +++ src/radeon_video.c 28 Apr 2006 09:48:46 -0000 @@ -2059,7 +2059,7 @@ RADEONCopyData( } while ( buf = RADEONHostDataBlit( pScrn, bpp, w, dstPitch, - &bufPitch, &dst, &h, &hpass ) ) + &bufPitch, &dst, &h, &hpass, FALSE ) ) { RADEONHostDataBlitCopyPass( pScrn, bpp, buf, src, hpass, bufPitch, srcPitch ); @@ -2147,7 +2147,7 @@ RADEONCopyRGB24Data( while ( dptr = ( CARD32* )RADEONHostDataBlit( pScrn, 4, w, dstPitch, &bufPitch, &dst, &h, - &hpass ) ) + &hpass, FALSE ) ) { for( j = 0; j < hpass; j++ ) { @@ -2221,7 +2221,7 @@ RADEONCopyMungedData( /* XXX Fix endian flip on R300 */ while ( buf = RADEONHostDataBlit( pScrn, 4, w/2, dstPitch, - &bufPitch, &dst1, &h, &hpass ) ) + &bufPitch, &dst1, &h, &hpass, FALSE ) ) { while ( hpass-- ) {