summaryrefslogtreecommitdiff
path: root/fb
diff options
context:
space:
mode:
authorSoren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com>2007-02-06 17:11:01 -0500
committerSoren Sandmann Pedersen <ssp@dhcp83-218.boston.redhat.com>2007-02-06 17:11:01 -0500
commit5a3334410367a2186b2c667fa1eb6cf0baf93e95 (patch)
treefaaa40bc49964f486bc8cf2fdd6c3d3a72d73ba5 /fb
parentb2cd3b133748cc5aa541905a703a6fdb1cbbb1e6 (diff)
Add new fbCompositeSrc_8888x0565mmx() function, based on patch by Dan
Williams. Bug 9682.
Diffstat (limited to 'fb')
-rw-r--r--fb/fbmmx.c98
-rw-r--r--fb/fbmmx.h12
2 files changed, 110 insertions, 0 deletions
diff --git a/fb/fbmmx.c b/fb/fbmmx.c
index f74930a39..5bbede10b 100644
--- a/fb/fbmmx.c
+++ b/fb/fbmmx.c
@@ -1339,6 +1339,104 @@ fbCompositeSrc_8888x8888mmx (CARD8 op,
}
void
+fbCompositeSrc_8888x0565mmx (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height)
+{
+ CARD16 *dstLine, *dst;
+ CARD32 *srcLine, *src;
+ FbStride dstStride, srcStride;
+ CARD16 w;
+
+ CHECKPOINT();
+
+ fbComposeGetStart (pDst, xDst, yDst, CARD16, dstStride, dstLine, 1);
+ fbComposeGetStart (pSrc, xSrc, ySrc, CARD32, srcStride, srcLine, 1);
+
+ assert (pSrc->pDrawable == pMask->pDrawable);
+
+ while (height--)
+ {
+ dst = dstLine;
+ dstLine += dstStride;
+ src = srcLine;
+ srcLine += srcStride;
+ w = width;
+
+ CHECKPOINT();
+
+ while (w && (unsigned long)dst & 7)
+ {
+ __m64 vsrc = load8888 (*src);
+ ullong d = *dst;
+ __m64 vdest = expand565 ((__m64)d, 0);
+
+ vdest = pack565(over(vsrc, expand_alpha(vsrc), vdest), vdest, 0);
+
+ *dst = (ullong)vdest;
+
+ w--;
+ dst++;
+ src++;
+ }
+
+ CHECKPOINT();
+
+ while (w >= 4)
+ {
+ __m64 vsrc0, vsrc1, vsrc2, vsrc3;
+ __m64 vdest;
+
+ vsrc0 = load8888(*(src + 0));
+ vsrc1 = load8888(*(src + 1));
+ vsrc2 = load8888(*(src + 2));
+ vsrc3 = load8888(*(src + 3));
+
+ vdest = *(__m64 *)dst;
+
+ vdest = pack565(over(vsrc0, expand_alpha(vsrc0), expand565(vdest, 0)), vdest, 0);
+ vdest = pack565(over(vsrc1, expand_alpha(vsrc1), expand565(vdest, 1)), vdest, 1);
+ vdest = pack565(over(vsrc2, expand_alpha(vsrc2), expand565(vdest, 2)), vdest, 2);
+ vdest = pack565(over(vsrc3, expand_alpha(vsrc3), expand565(vdest, 3)), vdest, 3);
+
+ *(__m64 *)dst = vdest;
+
+ w -= 4;
+ dst += 4;
+ src += 4;
+ }
+
+ CHECKPOINT();
+
+ while (w)
+ {
+ __m64 vsrc = load8888 (*src);
+ ullong d = *dst;
+ __m64 vdest = expand565 ((__m64)d, 0);
+
+ vdest = pack565(over(vsrc, expand_alpha(vsrc), vdest), vdest, 0);
+
+ *dst = (ullong)vdest;
+
+ w--;
+ dst++;
+ src++;
+ }
+ }
+
+ _mm_empty();
+}
+
+void
fbCompositeSolidMask_nx8x8888mmx (CARD8 op,
PicturePtr pSrc,
PicturePtr pMask,
diff --git a/fb/fbmmx.h b/fb/fbmmx.h
index 34718e3c0..b3e4d71ef 100644
--- a/fb/fbmmx.h
+++ b/fb/fbmmx.h
@@ -130,6 +130,18 @@ void fbCompositeSrc_8888RevNPx8888mmx (CARD8 op,
INT16 yDst,
CARD16 width,
CARD16 height);
+void fbCompositeSrc_8888x0565mmx (CARD8 op,
+ PicturePtr pSrc,
+ PicturePtr pMask,
+ PicturePtr pDst,
+ INT16 xSrc,
+ INT16 ySrc,
+ INT16 xMask,
+ INT16 yMask,
+ INT16 xDst,
+ INT16 yDst,
+ CARD16 width,
+ CARD16 height);
void fbCompositeSrc_8888RevNPx0565mmx (CARD8 op,
PicturePtr pSrc,
PicturePtr pMask,