summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2009-02-05 16:25:06 -0500
committerAlex Deucher <alexdeucher@gmail.com>2009-02-05 16:25:06 -0500
commitbd28b5817ed96e86a2cb275f72a7233d8fc5eccc (patch)
tree8b00f8173315deae8d3e1ba5c50b36baa8228e68
parent989275e2ea28ae213e819dd1c16dd3be3c41e15a (diff)
R6xx/R7xx EXA: improve overlapping copy performance
send vertices for each line of the copy, but only draw once
-rw-r--r--src/r600_exa.c35
1 files changed, 6 insertions, 29 deletions
diff --git a/src/r600_exa.c b/src/r600_exa.c
index 20875f3..85fed7e 100644
--- a/src/r600_exa.c
+++ b/src/r600_exa.c
@@ -721,65 +721,42 @@ R600OverlapCopy(PixmapPtr pDst,
uint32_t dst_offset = exaGetPixmapOffset(pDst) + rhdPtr->FbIntAddress + rhdPtr->FbScanoutStart;
int i;
+ R600DoPrepareCopy(pScrn,
+ dst_pitch, pDst->drawable.width, pDst->drawable.height, dst_offset, pDst->drawable.bitsPerPixel,
+ dst_pitch, pDst->drawable.height, dst_offset, pDst->drawable.bitsPerPixel,
+ accel_state->rop, accel_state->planemask);
+
if (is_overlap(srcX, srcX + w, srcY, srcY + h,
dstX, dstX + w, dstY, dstY + h)) {
if (srcY == dstY) { // left/right
if (srcX < dstX) { // right
// copy right to left
for (i = w; i > 0; i--) {
- R600DoPrepareCopy(pScrn,
- dst_pitch, pDst->drawable.width, pDst->drawable.height, dst_offset, pDst->drawable.bitsPerPixel,
- dst_pitch, pDst->drawable.height, dst_offset, pDst->drawable.bitsPerPixel,
- accel_state->rop, accel_state->planemask);
R600AppendCopyVertex(pScrn, srcX + i - 1, srcY, dstX + i - 1, dstY, 1, h);
- R600DoCopy(pScrn);
}
} else { //left
// copy left to right
for (i = 0; i < w; i++) {
- R600DoPrepareCopy(pScrn,
- dst_pitch, pDst->drawable.width, pDst->drawable.height, dst_offset, pDst->drawable.bitsPerPixel,
- dst_pitch, pDst->drawable.height, dst_offset, pDst->drawable.bitsPerPixel,
- accel_state->rop, accel_state->planemask);
-
R600AppendCopyVertex(pScrn, srcX + i, srcY, dstX + i, dstY, 1, h);
- R600DoCopy(pScrn);
}
}
} else { //up/down
if (srcY > dstY) { // up
// copy top to bottom
for (i = 0; i < h; i++) {
- R600DoPrepareCopy(pScrn,
- dst_pitch, pDst->drawable.width, pDst->drawable.height, dst_offset, pDst->drawable.bitsPerPixel,
- dst_pitch, pDst->drawable.height, dst_offset, pDst->drawable.bitsPerPixel,
- accel_state->rop, accel_state->planemask);
-
R600AppendCopyVertex(pScrn, srcX, srcY + i, dstX, dstY + i, w, 1);
- R600DoCopy(pScrn);
}
} else { // down
// copy bottom to top
for (i = h; i > 0; i--) {
- R600DoPrepareCopy(pScrn,
- dst_pitch, pDst->drawable.width, pDst->drawable.height, dst_offset, pDst->drawable.bitsPerPixel,
- dst_pitch, pDst->drawable.height, dst_offset, pDst->drawable.bitsPerPixel,
- accel_state->rop, accel_state->planemask);
-
R600AppendCopyVertex(pScrn, srcX, srcY + i - 1, dstX, dstY + i - 1, w, 1);
- R600DoCopy(pScrn);
}
}
}
} else {
- R600DoPrepareCopy(pScrn,
- dst_pitch, pDst->drawable.width, pDst->drawable.height, dst_offset, pDst->drawable.bitsPerPixel,
- dst_pitch, pDst->drawable.height, dst_offset, pDst->drawable.bitsPerPixel,
- accel_state->rop, accel_state->planemask);
-
R600AppendCopyVertex(pScrn, srcX, srcY, dstX, dstY, w, h);
- R600DoCopy(pScrn);
}
+ R600DoCopy(pScrn);
}
static void