summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTilman Sauerbeck <tilman@code-monkey.de>2006-09-06 15:38:39 +0200
committerTilman Sauerbeck <tilman@code-monkey.de>2006-09-06 15:38:39 +0200
commit74e85b19e564927337f23f6de25bb58f309e892b (patch)
treeb806194aa8b1a5f537e4d8bd790893500581ec7f
parentc2490640b4b237239872c5acbde3704e6e1412e9 (diff)
Enabled alpha filtering.
This doesn't influence rendercheck's test outcome, but helps with evas_xrender_x11_test.
-rw-r--r--src/mga_exa.c13
-rw-r--r--src/mga_reg.h1
2 files changed, 10 insertions, 4 deletions
diff --git a/src/mga_exa.c b/src/mga_exa.c
index a5812ad..7ba62d5 100644
--- a/src/mga_exa.c
+++ b/src/mga_exa.c
@@ -412,6 +412,7 @@ PrepareSourceTexture(int tmu, PicturePtr pSrcPicture, PixmapPtr pSrc)
int texctl = MGA_PITCHLIN | ((pitch & (2048 - 1)) << 9) |
MGA_NOPERSPECTIVE | MGA_TAKEY;
int texctl2 = MGA_G400_TC2_MAGIC | MGA_TC2_CKSTRANSDIS;
+ int texfilter = MGA_FILTERALPHA | (0x10 << 21);
for (i = 0; i < sizeof(texformats) / sizeof(texformats[0]); i++) {
if (texformats[i].fmt == pSrcPicture->format) {
@@ -420,6 +421,11 @@ PrepareSourceTexture(int tmu, PicturePtr pSrcPicture, PixmapPtr pSrc)
}
}
+ if (pSrcPicture->filter == PictFilterBilinear)
+ texfilter |= MGA_MAG_BILIN | MGA_MIN_BILIN;
+ else
+ texfilter |= MGA_MAG_NRST | MGA_MIN_NRST;
+
if (!pSrcPicture->repeat)
texctl |= MGA_CLAMPUV;
@@ -429,15 +435,14 @@ PrepareSourceTexture(int tmu, PicturePtr pSrcPicture, PixmapPtr pSrc)
WAITFIFO(6);
OUTREG(MGAREG_TEXCTL2, texctl2);
OUTREG(MGAREG_TEXCTL, texctl);
+
/* Source (texture) address + pitch */
OUTREG(MGAREG_TEXORG, exaGetPixmapOffset(pSrc));
OUTREG(MGAREG_TEXWIDTH, (w - 1) << 18 | ((8 - w_log2) & 63) << 9 | w_log2);
OUTREG(MGAREG_TEXHEIGHT, (h - 1) << 18 | ((8 - h_log2) & 63) << 9 | h_log2);
+
/* Set blit filtering flags */
- if (pSrcPicture->filter == PictFilterBilinear)
- OUTREG(MGAREG_TEXFILTER, (0x10 << 21) | MGA_MAG_BILIN | MGA_MIN_BILIN);
- else
- OUTREG(MGAREG_TEXFILTER, (0x10 << 21) | MGA_MAG_NRST | MGA_MIN_NRST);
+ OUTREG(MGAREG_TEXFILTER, texfilter);
if (tmu == 1) {
WAITFIFO(1);
diff --git a/src/mga_reg.h b/src/mga_reg.h
index 8e844f2..9a64955 100644
--- a/src/mga_reg.h
+++ b/src/mga_reg.h
@@ -502,6 +502,7 @@
# define MGA_MIN_ANISO (0x0000000D)
# define MGA_MAG_NRST (0x00000000)
# define MGA_MAG_BILIN (0x00000020)
+# define MGA_FILTERALPHA (0x00100000)
#define MGAREG_ALPHASTART 0x2c70
#define MGAREG_ALPHAXINC 0x2c74
#define MGAREG_ALPHAYINC 0x2c78