summaryrefslogtreecommitdiff
path: root/src/radeon_render.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/radeon_render.c')
-rw-r--r--src/radeon_render.c31
1 files changed, 21 insertions, 10 deletions
diff --git a/src/radeon_render.c b/src/radeon_render.c
index 9e3529e..054e60f 100644
--- a/src/radeon_render.c
+++ b/src/radeon_render.c
@@ -398,6 +398,13 @@ static Bool FUNC_NAME(R100SetupTexture)(
txformat = RadeonGetTextureFormat(format);
tex_bytepp = PICT_FORMAT_BPP(format) >> 3;
+ dst_pitch = (width * tex_bytepp + 63) & ~63;
+ size = dst_pitch * height;
+
+ if ((flags & XAA_RENDER_REPEAT) &&
+ (((width * tex_bytepp + 31) & ~31) != dst_pitch))
+ return FALSE;
+
#ifndef ACCEL_CP
#if X_BYTE_ORDER == X_BIG_ENDIAN
@@ -410,9 +417,6 @@ static Bool FUNC_NAME(R100SetupTexture)(
#endif
- dst_pitch = (width * tex_bytepp + 63) & ~63;
- size = dst_pitch * height;
-
if (!AllocateLinear(pScrn, size))
return FALSE;
@@ -731,6 +735,13 @@ static Bool FUNC_NAME(R200SetupTexture)(
txformat = RadeonGetTextureFormat(format);
tex_bytepp = PICT_FORMAT_BPP(format) >> 3;
+ dst_pitch = (width * tex_bytepp + 63) & ~63;
+ size = dst_pitch * height;
+
+ if ((flags & XAA_RENDER_REPEAT) &&
+ (((width * tex_bytepp + 31) & ~31) != dst_pitch))
+ return FALSE;
+
#ifndef ACCEL_CP
#if X_BYTE_ORDER == X_BIG_ENDIAN
@@ -743,9 +754,6 @@ static Bool FUNC_NAME(R200SetupTexture)(
#endif
- dst_pitch = (width * tex_bytepp + 63) & ~63;
- size = dst_pitch * height;
-
if (!AllocateLinear(pScrn, size))
return FALSE;
@@ -757,6 +765,9 @@ static Bool FUNC_NAME(R200SetupTexture)(
txformat |= RADEON_TXFORMAT_NON_POWER2;
}
+ info->texW[0] = width;
+ info->texH[0] = height;
+
offset = info->RenderTex->offset * pScrn->bitsPerPixel / 8;
dst = (CARD8*)(info->FB + offset);
@@ -956,10 +967,10 @@ FUNC_NAME(R200SubsequentCPUToScreenTexture) (
r = width + l;
b = height + t;
- fl = srcx;
- fr = srcx + width;
- ft = srcy;
- fb = srcy + height;
+ fl = (float)srcx / info->texW[0];
+ fr = (float)(srcx + width) / info->texW[0];
+ ft = (float)srcy / info->texH[0];
+ fb = (float)(srcy + height) / info->texH[0];
#ifdef ACCEL_CP
BEGIN_RING(24);