summaryrefslogtreecommitdiff
path: root/src/radeon_render.c
diff options
context:
space:
mode:
authorMichel Daenzer <michel@daenzer.net>2006-05-01 17:49:41 +0000
committerMichel Daenzer <michel@daenzer.net>2006-05-01 17:49:41 +0000
commit36c04b88416905b9ae305583e8e34fefdbfafc50 (patch)
treed2dde51e15d9aed0320c37ff608ef4edf869a3ac /src/radeon_render.c
parentb90d3710e67caad0686efab491c2b76ae877920c (diff)
Bugzilla #6755 <https://bugs.freedesktop.org/show_bug.cgi?id=6755> Patch
#5536 <https://bugs.freedesktop.org/attachment.cgi?id=5536>: Change HostDataBlit interface to take dst_offset_pitch and coordinates instead of just a destination pointer, as the latter is not sufficient with tiling. Also, use HW clipping to avoid overwriting destination data outside of the specified width. Adapt to new HostDataBlit interface. This fixes corruption with UploadToScreen to the front buffer (from exaPutImage).
Diffstat (limited to 'src/radeon_render.c')
-rw-r--r--src/radeon_render.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/radeon_render.c b/src/radeon_render.c
index e444bd2c..9e3529e3 100644
--- a/src/radeon_render.c
+++ b/src/radeon_render.c
@@ -383,9 +383,10 @@ static Bool FUNC_NAME(R100SetupTexture)(
RADEONInfoPtr info = RADEONPTR(pScrn);
CARD8 *dst;
CARD32 tex_size = 0, txformat;
- int dst_pitch, offset, size, i, tex_bytepp;
+ int dst_pitch, offset, size, tex_bytepp;
#ifdef ACCEL_CP
- CARD32 buf_pitch;
+ CARD32 buf_pitch, dst_pitch_off;
+ int x, y;
unsigned int hpass;
CARD8 *tmp_dst;
#endif
@@ -430,11 +431,13 @@ static Bool FUNC_NAME(R100SetupTexture)(
#ifdef ACCEL_CP
+ RADEONHostDataParams( pScrn, dst, dst_pitch, tex_bytepp, &dst_pitch_off, &x, &y );
+
while ( height )
{
tmp_dst = RADEONHostDataBlit( pScrn, tex_bytepp, width,
- dst_pitch, &buf_pitch,
- &dst, &height, &hpass);
+ dst_pitch_off, &buf_pitch,
+ x, &y, &height, &hpass );
RADEONHostDataBlitCopyPass( pScrn, tex_bytepp, tmp_dst, src,
hpass, buf_pitch, src_pitch );
src += hpass * src_pitch;
@@ -445,12 +448,10 @@ static Bool FUNC_NAME(R100SetupTexture)(
#else
- i = height;
-
if (info->accel->NeedToSync)
info->accel->Sync(pScrn);
- while(i--) {
+ while (height--) {
memcpy(dst, src, width * tex_bytepp);
src += src_pitch;
dst += dst_pitch;
@@ -715,9 +716,10 @@ static Bool FUNC_NAME(R200SetupTexture)(
RADEONInfoPtr info = RADEONPTR(pScrn);
CARD8 *dst;
CARD32 tex_size = 0, txformat;
- int dst_pitch, offset, size, i, tex_bytepp;
+ int dst_pitch, offset, size, tex_bytepp;
#ifdef ACCEL_CP
- CARD32 buf_pitch;
+ CARD32 buf_pitch, dst_pitch_off;
+ int x, y;
unsigned int hpass;
CARD8 *tmp_dst;
#endif
@@ -762,11 +764,13 @@ static Bool FUNC_NAME(R200SetupTexture)(
#ifdef ACCEL_CP
+ RADEONHostDataParams( pScrn, dst, dst_pitch, tex_bytepp, &dst_pitch_off, &x, &y );
+
while ( height )
{
tmp_dst = RADEONHostDataBlit( pScrn, tex_bytepp, width,
- dst_pitch, &buf_pitch,
- &dst, &height, &hpass );
+ dst_pitch_off, &buf_pitch,
+ x, &y, &height, &hpass );
RADEONHostDataBlitCopyPass( pScrn, tex_bytepp, tmp_dst, src,
hpass, buf_pitch, src_pitch );
src += hpass * src_pitch;
@@ -777,11 +781,10 @@ static Bool FUNC_NAME(R200SetupTexture)(
#else
- i = height;
if (info->accel->NeedToSync)
info->accel->Sync(pScrn);
- while(i--) {
+ while (height--) {
memcpy(dst, src, width * tex_bytepp);
src += src_pitch;
dst += dst_pitch;