summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2006-07-23 18:51:47 +0200
committerMichel Dänzer <michel@tungstengraphics.com>2006-07-23 18:51:47 +0200
commitfba8c839b47e2c8d6a6d65950c3431ff5b870aa0 (patch)
tree5ad048673d73f92060e09bc7b50205cc578ad4f8
parent60ebe97e2d5d27c2bf4213e201cef74503809cb6 (diff)
Bug #6819: Fix broken rendering with *8b8g8r8 source formats.
Use the corresponding texture formats with R200 family. Unfortunately, it looks like the R100 family can't accelerate these source formats, so we have to fall back for them.
-rw-r--r--src/radeon_exa_render.c35
-rw-r--r--src/radeon_reg.h1
2 files changed, 15 insertions, 21 deletions
diff --git a/src/radeon_exa_render.c b/src/radeon_exa_render.c
index e28b1021..98b8dfdd 100644
--- a/src/radeon_exa_render.c
+++ b/src/radeon_exa_render.c
@@ -95,7 +95,6 @@ static struct blendinfo RadeonBlendOp[] = {
struct formatinfo {
int fmt;
- Bool byte_swap;
CARD32 card_fmt;
};
@@ -103,25 +102,23 @@ struct formatinfo {
* TXFORMAT_Y8 expands to (Y,Y,Y,1). TXFORMAT_I8 expands to (I,I,I,I)
*/
static struct formatinfo R100TexFormats[] = {
- {PICT_a8r8g8b8, 0, RADEON_TXFORMAT_ARGB8888 | RADEON_TXFORMAT_ALPHA_IN_MAP},
- {PICT_x8r8g8b8, 0, RADEON_TXFORMAT_ARGB8888},
- {PICT_a8b8g8r8, 1, RADEON_TXFORMAT_RGBA8888 | RADEON_TXFORMAT_ALPHA_IN_MAP},
- {PICT_x8b8g8r8, 1, RADEON_TXFORMAT_RGBA8888},
- {PICT_r5g6b5, 0, RADEON_TXFORMAT_RGB565},
- {PICT_a1r5g5b5, 0, RADEON_TXFORMAT_ARGB1555 | RADEON_TXFORMAT_ALPHA_IN_MAP},
- {PICT_x1r5g5b5, 0, RADEON_TXFORMAT_ARGB1555},
- {PICT_a8, 0, RADEON_TXFORMAT_I8 | RADEON_TXFORMAT_ALPHA_IN_MAP},
+ {PICT_a8r8g8b8, RADEON_TXFORMAT_ARGB8888 | RADEON_TXFORMAT_ALPHA_IN_MAP},
+ {PICT_x8r8g8b8, RADEON_TXFORMAT_ARGB8888},
+ {PICT_r5g6b5, RADEON_TXFORMAT_RGB565},
+ {PICT_a1r5g5b5, RADEON_TXFORMAT_ARGB1555 | RADEON_TXFORMAT_ALPHA_IN_MAP},
+ {PICT_x1r5g5b5, RADEON_TXFORMAT_ARGB1555},
+ {PICT_a8, RADEON_TXFORMAT_I8 | RADEON_TXFORMAT_ALPHA_IN_MAP},
};
static struct formatinfo R200TexFormats[] = {
- {PICT_a8r8g8b8, 0, R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP},
- {PICT_x8r8g8b8, 0, R200_TXFORMAT_ARGB8888},
- {PICT_a8b8g8r8, 1, R200_TXFORMAT_RGBA8888 | R200_TXFORMAT_ALPHA_IN_MAP},
- {PICT_x8b8g8r8, 1, R200_TXFORMAT_RGBA8888},
- {PICT_r5g6b5, 0, R200_TXFORMAT_RGB565},
- {PICT_a1r5g5b5, 0, R200_TXFORMAT_ARGB1555 | R200_TXFORMAT_ALPHA_IN_MAP},
- {PICT_x1r5g5b5, 0, R200_TXFORMAT_ARGB1555},
- {PICT_a8, 0, R200_TXFORMAT_I8 | R200_TXFORMAT_ALPHA_IN_MAP},
+ {PICT_a8r8g8b8, R200_TXFORMAT_ARGB8888 | R200_TXFORMAT_ALPHA_IN_MAP},
+ {PICT_x8r8g8b8, R200_TXFORMAT_ARGB8888},
+ {PICT_a8b8g8r8, R200_TXFORMAT_ABGR8888 | R200_TXFORMAT_ALPHA_IN_MAP},
+ {PICT_x8b8g8r8, R200_TXFORMAT_ABGR8888},
+ {PICT_r5g6b5, R200_TXFORMAT_RGB565},
+ {PICT_a1r5g5b5, R200_TXFORMAT_ARGB1555 | R200_TXFORMAT_ALPHA_IN_MAP},
+ {PICT_x1r5g5b5, R200_TXFORMAT_ARGB1555},
+ {PICT_a8, R200_TXFORMAT_I8 | R200_TXFORMAT_ALPHA_IN_MAP},
};
/* Common Radeon setup code */
@@ -245,8 +242,6 @@ static Bool FUNC_NAME(R100TextureSetup)(PicturePtr pPict, PixmapPtr pPix,
break;
}
txformat = R100TexFormats[i].card_fmt;
- if (R100TexFormats[i].byte_swap)
- txoffset |= RADEON_TXO_ENDIAN_BYTE_SWAP;
if (RADEONPixmapIsColortiled(pPix))
txoffset |= RADEON_TXO_MACRO_TILE;
@@ -500,8 +495,6 @@ static Bool FUNC_NAME(R200TextureSetup)(PicturePtr pPict, PixmapPtr pPix,
break;
}
txformat = R200TexFormats[i].card_fmt;
- if (R200TexFormats[i].byte_swap)
- txoffset |= R200_TXO_ENDIAN_BYTE_SWAP;
if (RADEONPixmapIsColortiled(pPix))
txoffset |= R200_TXO_MACRO_TILE;
diff --git a/src/radeon_reg.h b/src/radeon_reg.h
index 53cc8032..b7c6e263 100644
--- a/src/radeon_reg.h
+++ b/src/radeon_reg.h
@@ -2435,6 +2435,7 @@
# define R200_TXFORMAT_DXT1 (12 << 0)
# define R200_TXFORMAT_DXT23 (14 << 0)
# define R200_TXFORMAT_DXT45 (15 << 0)
+# define R200_TXFORMAT_ABGR8888 (22 << 0)
# define R200_TXFORMAT_FORMAT_MASK (31 << 0)
# define R200_TXFORMAT_FORMAT_SHIFT 0
# define R200_TXFORMAT_ALPHA_IN_MAP (1 << 6)