[xserver-commit] xserver/hw/kdrive/ati ati_draw.c,1.12,1.13 r128_blendtmp.h,1.2,1.3
Eric Anholt
xserver-commit@pdx.freedesktop.org
Sat, 10 Jan 2004 16:10:56 -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 r128_blendtmp.h
Log Message:
Support 1x1 repeat sources in R128's Blend.
Index: ati_draw.c
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/ati/ati_draw.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- ati_draw.c 9 Jan 2004 08:43:48 -0000 1.12
+++ ati_draw.c 11 Jan 2004 00:10:34 -0000 1.13
@@ -111,7 +111,9 @@
/* If is_24bpp is set, then we are using the accelerator in 8-bit mode due
* to it being broken for 24bpp, so coordinates have to be multiplied by 3.
*/
-int is_24bpp;
+Bool is_24bpp;
+/* For r128 Blend, tells whether to force src x/y offset to (0,0). */
+Bool is_repeat;
static void
ATIWaitAvailMMIO(int n)
Index: r128_blendtmp.h
===================================================================
RCS file: /cvs/xserver/xserver/hw/kdrive/ati/r128_blendtmp.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- r128_blendtmp.h 29 Dec 2003 06:24:01 -0000 1.2
+++ r128_blendtmp.h 11 Jan 2004 00:10:34 -0000 1.3
@@ -54,10 +54,12 @@
return FALSE;
src_bpp = pSrc->drawable.bitsPerPixel;
+ is_repeat = pSrcPicture->repeat;
if (op >= sizeof(R128BlendOp)/sizeof(R128BlendOp[0]))
ATI_FALLBACK(("Unsupported op 0x%x\n", op));
- if (pSrcPicture->repeat)
+ if (pSrcPicture->repeat && (pSrc->drawable.width != 1 ||
+ pSrc->drawable.height != 1))
ATI_FALLBACK(("repeat unsupported\n"));
if (pSrcPicture->transform != NULL)
ATI_FALLBACK(("transform unsupported\n"));
@@ -86,8 +88,13 @@
OUT_REG(R128_REG_SCALE_3D_DATATYPE, srcDatatype);
OUT_REG(R128_REG_SCALE_PITCH, src_pitch / src_bpp);
/* 4.16 fixed point scaling factor? */
- OUT_REG(R128_REG_SCALE_X_INC, 65536);
- OUT_REG(R128_REG_SCALE_Y_INC, 65536);
+ if (is_repeat) {
+ OUT_REG(R128_REG_SCALE_X_INC, 0);
+ OUT_REG(R128_REG_SCALE_Y_INC, 0);
+ } else {
+ OUT_REG(R128_REG_SCALE_X_INC, 65536);
+ OUT_REG(R128_REG_SCALE_Y_INC, 65536);
+ }
OUT_REG(R128_REG_SCALE_HACC, 0x00000000);
OUT_REG(R128_REG_SCALE_VACC, 0x00000000);
OUT_REG(RADEON_REG_DP_CNTL,
@@ -104,6 +111,11 @@
ATICardInfo *atic = atis->atic;
LOCALS;
+ if (is_repeat) {
+ srcX = 0;
+ srcY = 0;
+ }
+
BEGIN(4);
OUT_REG(R128_REG_SCALE_OFFSET_0, src_offset + srcY * src_pitch + srcX *
(src_bpp >> 3));