[xserver-commit] xserver/hw/kdrive/ati ati_draw.c,1.7,1.8 radeon_composite.c,1.2,1.3

Eric Anholt xserver-commit@pdx.freedesktop.org
Sat, 03 Jan 2004 03:46:59 -0800


Committed by: anholt

Update of /cvs/xserver/xserver/hw/kdrive/ati
In directory pdx:/home/anholt/xserver/hw/kdrive/ati

Modified Files:
	ati_draw.c radeon_composite.c 
Log Message:
- 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.


Index: ati_draw.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/ati/ati_draw.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- ati_draw.c	30 Dec 2003 08:23:56 -0000	1.7
+++ ati_draw.c	3 Jan 2004 11:46:57 -0000	1.8
@@ -475,12 +475,13 @@
 			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 @@
 	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

Index: radeon_composite.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/ati/radeon_composite.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- radeon_composite.c	31 Dec 2003 23:24:33 -0000	1.2
+++ radeon_composite.c	3 Jan 2004 11:46:57 -0000	1.3
@@ -69,6 +69,14 @@
 	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 @@
 	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 @@
 	/* 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;