summaryrefslogtreecommitdiff
path: root/src/sna/fb
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-07-17 18:28:24 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-07-17 18:43:31 +0100
commitfce69c79c4840e7863d7c382da0d22be90a9f19a (patch)
tree335bca0fe71e676b96c088ac798db65b70fc2868 /src/sna/fb
parentc29f96d50839388377ad57c6366f9bc7ad8b9d0a (diff)
sna: prefer fbBlt over pixman_blt
It is currently much better optimised through memcpy. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/fb')
-rw-r--r--src/sna/fb/fbcopy.c41
1 files changed, 13 insertions, 28 deletions
diff --git a/src/sna/fb/fbcopy.c b/src/sna/fb/fbcopy.c
index a2b1deda..a486a5b1 100644
--- a/src/sna/fb/fbcopy.c
+++ b/src/sna/fb/fbcopy.c
@@ -35,42 +35,27 @@ fbCopyNtoN(DrawablePtr src_drawable, DrawablePtr dst_drawable, GCPtr gc,
{
CARD8 alu = gc ? gc->alu : GXcopy;
FbBits pm = gc ? fb_gc(gc)->pm : FB_ALLONES;
- FbBits *src;
- FbStride srcStride;
- int srcBpp;
+ FbBits *src, *dst;
+ FbStride srcStride, dstStride;
+ int dstBpp, srcBpp;
int srcXoff, srcYoff;
- FbBits *dst;
- FbStride dstStride;
- int dstBpp;
int dstXoff, dstYoff;
fbGetDrawable(src_drawable, src, srcStride, srcBpp, srcXoff, srcYoff);
fbGetDrawable(dst_drawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
- while (nbox--) {
- if (pm == FB_ALLONES && alu == GXcopy && !reverse && !upsidedown) {
- if (!pixman_blt
- ((uint32_t *) src, (uint32_t *) dst, srcStride, dstStride,
- srcBpp, dstBpp, (box->x1 + dx + srcXoff),
- (box->y1 + dy + srcYoff), (box->x1 + dstXoff),
- (box->y1 + dstYoff), (box->x2 - box->x1),
- (box->y2 - box->y1)))
- goto fallback;
- else
- goto next;
- }
-fallback:
- fbBlt(src + (box->y1 + dy + srcYoff) * srcStride,
- srcStride,
- (box->x1 + dx + srcXoff) * srcBpp,
- dst + (box->y1 + dstYoff) * dstStride,
- dstStride,
+ src += (dy + srcYoff) * srcStride;
+ srcXoff += dx;
+ dst += dstYoff * dstStride;
+ do {
+ fbBlt(src + box->y1 * srcStride, srcStride,
+ (box->x1 + srcXoff) * srcBpp,
+ dst + box->y1 * dstStride, dstStride,
(box->x1 + dstXoff) * dstBpp,
(box->x2 - box->x1) * dstBpp,
- (box->y2 - box->y1), alu, pm, dstBpp, reverse, upsidedown);
-next:
- box++;
- }
+ (box->y2 - box->y1),
+ alu, pm, dstBpp, reverse, upsidedown);
+ } while (box++, --nbox);
}
void