summaryrefslogtreecommitdiff
path: root/src/mga_exa.c
diff options
context:
space:
mode:
authorTilman Sauerbeck <tilman@hammerfest.(none)>2006-09-09 11:58:32 +0200
committerTilman Sauerbeck <tilman@hammerfest.(none)>2006-09-09 11:58:32 +0200
commit9fa71aef67df48b59f9d70fddd2725f739d171a9 (patch)
tree3a7680b13793021b0f9283880217fc2926d82e4c /src/mga_exa.c
parent7a7feb251b8172786755ab81b154bbfb7d193dbc (diff)
Do A8->A8 ops in hardware.
Diffstat (limited to 'src/mga_exa.c')
-rw-r--r--src/mga_exa.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/src/mga_exa.c b/src/mga_exa.c
index 6faceb4..ad6f5eb 100644
--- a/src/mga_exa.c
+++ b/src/mga_exa.c
@@ -400,14 +400,6 @@ mgaCheckComposite(int op, PicturePtr pSrcPict, PicturePtr pMaskPict,
}
}
- switch (pDstPict->format) {
- case PICT_a8:
- DEBUG_MSG(("render to A8 unsupported\n"));
- return FALSE;
- default:
- break;
- }
-
if (PICT_FORMAT_TYPE(pDstPict->format) == PICT_TYPE_ABGR) {
DEBUG_MSG(("render to (A)BGR unsupported\n"));
return FALSE;
@@ -560,16 +552,22 @@ mgaPrepareComposite(int op, PicturePtr pSrcPict, PicturePtr pMaskPict,
if (pMask)
PrepareSourceTexture(1, pMaskPict, pMask);
- if (pSrcPict->format == PICT_a8) {
- /* C = 0 A = As */
+ /* C = Cs A = As */
+ ds0 = C_ARG1_CUR | COLOR_ARG1 |
+ A_ARG1_CUR | ALPHA_ARG1;
- /* MGA HW: A8 format makes RGB white. We use FCOL for the black
- * If FCOL was not 0, it would have been be premultiplied (RENDER)
- * color component would have been:
- * C_ARG1_ALPHA | C_ARG2_FCOL | COLOR_MUL
- */
- ds0 = C_ARG2_FCOL | COLOR_ARG2 |
- A_ARG1_CUR | ALPHA_ARG1;
+ if (pSrcPict->format == PICT_a8) {
+ if (pDstPict->format != PICT_a8) {
+ /* C = 0 A = As */
+
+ /* MGA HW: A8 format makes RGB white. We use FCOL for the black
+ * If FCOL was not 0, it would have been be premultiplied (RENDER)
+ * color component would have been:
+ * C_ARG1_ALPHA | C_ARG2_FCOL | COLOR_MUL
+ */
+ ds0 = C_ARG2_FCOL | COLOR_ARG2 |
+ A_ARG1_CUR | ALPHA_ARG1;
+ }
/* MGA HW: TMU1 must be enabled when DUALSTAGE0 contains something */
if (!pMask) {
@@ -578,10 +576,6 @@ mgaPrepareComposite(int op, PicturePtr pSrcPict, PicturePtr pMaskPict,
ds1 = C_ARG2_PREV | COLOR_ARG2 |
A_ARG2_PREV | ALPHA_ARG2;
}
- } else {
- /* C = Cs A = As */
- ds0 = C_ARG1_CUR | COLOR_ARG1 |
- A_ARG1_CUR | ALPHA_ARG1;
}
if (pMask) {