summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2004-01-11 00:10:34 +0000
committerEric Anholt <anholt@freebsd.org>2004-01-11 00:10:34 +0000
commit6c97b277d9140b9d6bca047c56e303f6fc1d92e0 (patch)
treeae835af4c692d87aec6ebf3a1265d116c67dc121 /hw
parent92702565657d48f1fcc2bae1b5989b1d6d3dd164 (diff)
Support 1x1 repeat sources in R128's Blend.
Diffstat (limited to 'hw')
-rw-r--r--hw/kdrive/ati/ati_draw.c4
-rw-r--r--hw/kdrive/ati/r128_blendtmp.h18
2 files changed, 18 insertions, 4 deletions
diff --git a/hw/kdrive/ati/ati_draw.c b/hw/kdrive/ati/ati_draw.c
index 45b94831f..8a79bf27c 100644
--- a/hw/kdrive/ati/ati_draw.c
+++ b/hw/kdrive/ati/ati_draw.c
@@ -111,7 +111,9 @@ int src_bpp;
/* 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)
diff --git a/hw/kdrive/ati/r128_blendtmp.h b/hw/kdrive/ati/r128_blendtmp.h
index 57eeb21eb..d31cdb3ad 100644
--- a/hw/kdrive/ati/r128_blendtmp.h
+++ b/hw/kdrive/ati/r128_blendtmp.h
@@ -54,10 +54,12 @@ TAG(R128PrepareBlend)(int op, PicturePtr pSrcPicture, PicturePtr pDstPicture,
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 @@ TAG(R128PrepareBlend)(int op, PicturePtr pSrcPicture, PicturePtr pDstPicture,
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 @@ TAG(R128Blend)(int srcX, int srcY, int dstX, int dstY, int width, int height)
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));