summaryrefslogtreecommitdiff
path: root/src/radeon_exa_render.c
diff options
context:
space:
mode:
authorMichel Dänzer <daenzer@vmware.com>2009-08-27 09:52:10 +0200
committerMichel Dänzer <daenzer@vmware.com>2009-08-27 09:52:10 +0200
commit27d9664f8862d1948dd32021f8e9bcb94f23e4ef (patch)
tree4eecbe5bf8db1137bd2816d5c11704b788845038 /src/radeon_exa_render.c
parent9b5517fcf7f2397a1a814d396fc9dc24769a6d9f (diff)
EXA: RENDER repeat cleanups.
We can't rely on the server setting pPict->repeatType to something sensible when pPict->repeat is FALSE, but we can do it ourselves.
Diffstat (limited to 'src/radeon_exa_render.c')
-rw-r--r--src/radeon_exa_render.c62
1 files changed, 35 insertions, 27 deletions
diff --git a/src/radeon_exa_render.c b/src/radeon_exa_render.c
index 4dbdc147..cc977602 100644
--- a/src/radeon_exa_render.c
+++ b/src/radeon_exa_render.c
@@ -410,6 +410,10 @@ static Bool FUNC_NAME(R100TextureSetup)(PicturePtr pPict, PixmapPtr pPix,
RADEON_FALLBACK(("Bad filter 0x%x\n", pPict->filter));
}
+ /* Unfortunately we can't rely on the X server doing this for us */
+ if (!pPict->repeat)
+ pPict->repeatType = RepeatNone;
+
switch (pPict->repeatType) {
case RepeatNormal:
txfilter |= RADEON_CLAMP_S_WRAP | RADEON_CLAMP_T_WRAP;
@@ -793,6 +797,10 @@ static Bool FUNC_NAME(R200TextureSetup)(PicturePtr pPict, PixmapPtr pPix,
RADEON_FALLBACK(("Bad filter 0x%x\n", pPict->filter));
}
+ /* Unfortunately we can't rely on the X server doing this for us */
+ if (!pPict->repeat)
+ pPict->repeatType = RepeatNone;
+
switch (pPict->repeatType) {
case RepeatNormal:
txfilter |= R200_CLAMP_S_WRAP | R200_CLAMP_T_WRAP;
@@ -1171,36 +1179,36 @@ static Bool FUNC_NAME(R300TextureSetup)(PicturePtr pPict, PixmapPtr pPix,
txfilter = (unit << R300_TX_ID_SHIFT);
- if (pPict->repeat) {
- switch (pPict->repeatType) {
- case RepeatNormal:
- if (unit != 0 || !info->accel_state->need_src_tile_x)
- txfilter |= R300_TX_CLAMP_S(R300_TX_CLAMP_WRAP);
- else
- txfilter |= R300_TX_CLAMP_S(R300_TX_CLAMP_CLAMP_GL);
+ /* Unfortunately we can't rely on the X server doing this for us */
+ if (!pPict->repeat)
+ pPict->repeatType = RepeatNone;
- if (unit != 0 || !info->accel_state->need_src_tile_y)
- txfilter |= R300_TX_CLAMP_T(R300_TX_CLAMP_WRAP);
- else
- txfilter |= R300_TX_CLAMP_T(R300_TX_CLAMP_CLAMP_GL);
+ switch (pPict->repeatType) {
+ case RepeatNormal:
+ if (unit != 0 || !info->accel_state->need_src_tile_x)
+ txfilter |= R300_TX_CLAMP_S(R300_TX_CLAMP_WRAP);
+ else
+ txfilter |= R300_TX_CLAMP_S(R300_TX_CLAMP_CLAMP_GL);
+
+ if (unit != 0 || !info->accel_state->need_src_tile_y)
+ txfilter |= R300_TX_CLAMP_T(R300_TX_CLAMP_WRAP);
+ else
+ txfilter |= R300_TX_CLAMP_T(R300_TX_CLAMP_CLAMP_GL);
- break;
- case RepeatPad:
- txfilter |= R300_TX_CLAMP_S(R300_TX_CLAMP_CLAMP_LAST) |
- R300_TX_CLAMP_T(R300_TX_CLAMP_CLAMP_LAST);
- break;
- case RepeatReflect:
- txfilter |= R300_TX_CLAMP_S(R300_TX_CLAMP_MIRROR) |
- R300_TX_CLAMP_T(R300_TX_CLAMP_MIRROR);
- break;
- case RepeatNone:
- txfilter |= R300_TX_CLAMP_S(R300_TX_CLAMP_CLAMP_GL) |
- R300_TX_CLAMP_T(R300_TX_CLAMP_CLAMP_GL);
- break;
- }
- } else
+ break;
+ case RepeatPad:
+ txfilter |= R300_TX_CLAMP_S(R300_TX_CLAMP_CLAMP_LAST) |
+ R300_TX_CLAMP_T(R300_TX_CLAMP_CLAMP_LAST);
+ break;
+ case RepeatReflect:
+ txfilter |= R300_TX_CLAMP_S(R300_TX_CLAMP_MIRROR) |
+ R300_TX_CLAMP_T(R300_TX_CLAMP_MIRROR);
+ break;
+ case RepeatNone:
txfilter |= R300_TX_CLAMP_S(R300_TX_CLAMP_CLAMP_GL) |
- R300_TX_CLAMP_T(R300_TX_CLAMP_CLAMP_GL);
+ R300_TX_CLAMP_T(R300_TX_CLAMP_CLAMP_GL);
+ break;
+ }
switch (pPict->filter) {
case PictFilterNearest: