summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/r600_exa.c21
-rw-r--r--src/r6xx_accel.c6
2 files changed, 15 insertions, 12 deletions
diff --git a/src/r600_exa.c b/src/r600_exa.c
index cfe041fd..db4c0b19 100644
--- a/src/r600_exa.c
+++ b/src/r600_exa.c
@@ -720,6 +720,7 @@ R600PrepareCopy(PixmapPtr pSrc, PixmapPtr pDst,
accel_state->dst_pitch = exaGetPixmapPitch(pDst) / (pDst->drawable.bitsPerPixel / 8);
accel_state->src_pitch[0] = exaGetPixmapPitch(pSrc) / (pSrc->drawable.bitsPerPixel / 8);
+ accel_state->same_surface = FALSE;
#if defined(XF86DRM_MODE)
if (info->cs) {
@@ -728,11 +729,15 @@ R600PrepareCopy(PixmapPtr pSrc, PixmapPtr pDst,
accel_state->src_bo[0] = radeon_get_pixmap_bo(pSrc);
accel_state->src_bo[1] = NULL;
accel_state->dst_bo = radeon_get_pixmap_bo(pDst);
+ if (accel_state->dst_bo == accel_state->src_bo[0])
+ accel_state->same_surface = TRUE;
} else
#endif
{
accel_state->src_mc_addr[0] = exaGetPixmapOffset(pSrc) + info->fbLocation + pScrn->fbOffset;
accel_state->dst_mc_addr = exaGetPixmapOffset(pDst) + info->fbLocation + pScrn->fbOffset;
+ if (exaGetPixmapOffset(pSrc) == exaGetPixmapOffset(pDst))
+ accel_state->same_surface = TRUE;
}
accel_state->src_width[0] = pSrc->drawable.width;
@@ -766,9 +771,8 @@ R600PrepareCopy(PixmapPtr pSrc, PixmapPtr pDst,
accel_state->rop = rop;
accel_state->planemask = planemask;
- if (exaGetPixmapOffset(pSrc) == exaGetPixmapOffset(pDst)) {
+ if (accel_state->same_surface == TRUE) {
unsigned long size = pDst->drawable.height * accel_state->dst_pitch * pDst->drawable.bitsPerPixel/8;
- accel_state->same_surface = TRUE;
#if defined(XF86DRM_MODE)
if (info->cs) {
@@ -802,9 +806,7 @@ R600PrepareCopy(PixmapPtr pSrc, PixmapPtr pDst,
}
accel_state->copy_area = exaOffscreenAlloc(pDst->drawable.pScreen, size, 256, TRUE, NULL, NULL);
}
- } else {
- accel_state->same_surface = FALSE;
-
+ } else
R600DoPrepareCopy(pScrn,
accel_state->src_pitch[0], pSrc->drawable.width, pSrc->drawable.height,
accel_state->src_mc_addr[0], accel_state->src_bo[0], pSrc->drawable.bitsPerPixel,
@@ -812,8 +814,6 @@ R600PrepareCopy(PixmapPtr pSrc, PixmapPtr pDst,
accel_state->dst_mc_addr, accel_state->dst_bo, pDst->drawable.bitsPerPixel,
rop, planemask);
- }
-
return TRUE;
}
@@ -853,8 +853,8 @@ R600OverlapCopy(PixmapPtr pDst,
}
#endif
- if (is_overlap(srcX, srcX + w, srcY, srcY + h,
- dstX, dstX + w, dstY, dstY + h)) {
+ if (is_overlap(srcX, srcX + (w - 1), srcY, srcY + (h - 1),
+ dstX, dstX + (w - 1), dstY, dstY + (h - 1))) {
/* Calculate height/width of non-overlapping area */
hchunk = (srcX < dstX) ? (dstX - srcX) : (srcX - dstX);
vchunk = (srcY < dstY) ? (dstY - srcY) : (srcY - dstY);
@@ -1008,7 +1008,8 @@ R600Copy(PixmapPtr pDst,
#endif
if (accel_state->same_surface &&
- is_overlap(srcX, srcX + w, srcY, srcY + h, dstX, dstX + w, dstY, dstY + h)) {
+ is_overlap(srcX, srcX + (w - 1), srcY, srcY + (h - 1),
+ dstX, dstX + (w - 1), dstY, dstY + (h - 1))) {
if (accel_state->copy_area) {
uint32_t pitch = exaGetPixmapPitch(pDst) / (pDst->drawable.bitsPerPixel / 8);
uint32_t orig_offset, tmp_offset;
diff --git a/src/r6xx_accel.c b/src/r6xx_accel.c
index 7c7f4693..6346e526 100644
--- a/src/r6xx_accel.c
+++ b/src/r6xx_accel.c
@@ -48,9 +48,11 @@ void r600_cs_flush_indirect(ScrnInfoPtr pScrn)
if (!info->cs->cdw)
return;
- if (info->accel_state->vb_bo)
+ if (info->accel_state->vb_bo) {
radeon_bo_unmap(info->accel_state->vb_bo);
- info->accel_state->vb_bo = NULL;
+ radeon_bo_ref(info->accel_state->vb_bo);
+ info->accel_state->vb_bo = NULL;
+ }
radeon_cs_emit(info->cs);
radeon_cs_erase(info->cs);