summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2004-01-03 11:46:57 +0000
committerEric Anholt <anholt@freebsd.org>2004-01-03 11:46:57 +0000
commit3db761a17b60b80acb83f365628b093f0ba6958c (patch)
tree93ecc2805bbb34ae3fcfa962993dd50e7579c8e1
parentd15acfa79b64b8dab1e930ce8e5423a212a1360b (diff)
- Add more Composite operations, including Saturate, to Radeon Composite
accel. I don't 100% trust that the math works for Saturate, but I can't tell from existing information. - Fix texture pitch fallback checks. - Fallback when src or mask have transforms. - Disable Radeon Composite accel until the offset thing is fixed. - Set offscreenPitch to 64 on Radeon thanks to new information and a kaa fix. Fixes acceleration at width!=1024.
-rw-r--r--hw/kdrive/ati/ati_draw.c7
-rw-r--r--hw/kdrive/ati/radeon_composite.c16
2 files changed, 18 insertions, 5 deletions
diff --git a/hw/kdrive/ati/ati_draw.c b/hw/kdrive/ati/ati_draw.c
index aa012da9a..bf7000b7c 100644
--- a/hw/kdrive/ati/ati_draw.c
+++ b/hw/kdrive/ati/ati_draw.c
@@ -475,12 +475,13 @@ ATIDrawInit(ScreenPtr pScreen)
atis->kaa.Blend = R128BlendDMA;
atis->kaa.DoneBlend = R128DoneBlendDMA;
} else if (!atic->is_r200) {
- atis->kaa.PrepareBlend = RadeonPrepareBlend;
+ /* XXX: This code is broken so far. */
+ /*atis->kaa.PrepareBlend = RadeonPrepareBlend;
atis->kaa.Blend = RadeonBlend;
atis->kaa.DoneBlend = RadeonDoneBlend;
atis->kaa.PrepareComposite = RadeonPrepareComposite;
atis->kaa.Composite = RadeonComposite;
- atis->kaa.DoneComposite = RadeonDoneComposite;
+ atis->kaa.DoneComposite = RadeonDoneComposite;*/
}
} else {
#else
@@ -501,7 +502,7 @@ ATIDrawInit(ScreenPtr pScreen)
atis->kaa.flags = KAA_OFFSCREEN_PIXMAPS;
if (atic->is_radeon) {
atis->kaa.offscreenByteAlign = 1024;
- atis->kaa.offscreenPitch = 1024;
+ atis->kaa.offscreenPitch = 64;
} else {
atis->kaa.offscreenByteAlign = 32;
/* Pitch alignment is in sets of 8 pixels, and we need to cover
diff --git a/hw/kdrive/ati/radeon_composite.c b/hw/kdrive/ati/radeon_composite.c
index a9645a551..d6ac82f6a 100644
--- a/hw/kdrive/ati/radeon_composite.c
+++ b/hw/kdrive/ati/radeon_composite.c
@@ -69,6 +69,14 @@ static CARD32 RadeonBlendOp[] = {
RADEON_SRC_BLEND_GL_ONE_MINUS_DST_ALPHA | RADEON_DST_BLEND_GL_ONE_MINUS_SRC_ALPHA,
/* Add */
RADEON_SRC_BLEND_GL_ONE | RADEON_DST_BLEND_GL_ONE,
+ /* Saturate */
+ RADEON_SRC_BLEND_GL_SRC_ALPHA_SATURATE | RADEON_DST_BLEND_GL_ONE,
+ /* DisjointClear */
+ RADEON_SRC_BLEND_GL_ZERO | RADEON_DST_BLEND_GL_ZERO,
+ /* DisjointSrc */
+ RADEON_SRC_BLEND_GL_ONE | RADEON_DST_BLEND_GL_ZERO,
+ /* DisjointDst */
+ RADEON_SRC_BLEND_GL_ZERO | RADEON_DST_BLEND_GL_ONE,
};
/* Compute log base 2 of val. */
@@ -130,9 +138,9 @@ RadeonTextureSetup(PicturePtr pPict, PixmapPtr pPix, int unit)
txoffset = ((CARD8 *)pPix->devPrivate.ptr -
pScreenPriv->screen->memory_base);
- if ((txoffset & 0x3f) != 0)
+ if ((txoffset & 0x1f) != 0)
ATI_FALLBACK(("Bad texture offset 0x%x\n", txoffset));
- if ((txpitch & 0x3f) != 0)
+ if ((txpitch & 0x1f) != 0)
ATI_FALLBACK(("Bad texture pitch 0x%x\n", txpitch));
/* RADEON_REG_PP_TXFILTER_0, RADEON_REG_PP_TXFORMAT_0,
@@ -173,6 +181,10 @@ RadeonPrepareComposite(int op, PicturePtr pSrcPicture, PicturePtr pMaskPicture,
/* Check for unsupported compositing operations. */
if (op >= sizeof(RadeonBlendOp) / sizeof(RadeonBlendOp[0]))
ATI_FALLBACK(("Unsupported Composite op 0x%x\n", op));
+ if (pSrcPicture->transform)
+ ATI_FALLBACK(("Source transform unsupported.\n"));
+ if (pMaskPicture && pMaskPicture->transform)
+ ATI_FALLBACK(("Mask transform unsupported.\n"));
accel_atis = atis;