xf86-video-ati: Branch 'r6xx-r7xx-support' - 3 commits
Alex Deucher
agd5f at kemper.freedesktop.org
Tue Feb 24 08:09:20 PST 2009
src/r600_exa.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++-----------
src/radeon.h | 1
2 files changed, 50 insertions(+), 11 deletions(-)
New commits:
commit c74727015453ff3c3d6d06b812ebca9eb19a9767
Author: Alex Deucher <alexdeucher at gmail.com>
Date: Tue Feb 24 11:08:46 2009 -0500
R6xx/R7xx EXA: init copy_area to NULL
diff --git a/src/r600_exa.c b/src/r600_exa.c
index b4db38d..52b0042 100644
--- a/src/r600_exa.c
+++ b/src/r600_exa.c
@@ -4425,6 +4425,7 @@ R600DrawInit(ScreenPtr pScreen)
return FALSE;
info->accel_state->XInited3D = FALSE;
+ info->accel_state->copy_area = NULL;
if (!R600LoadShaders(pScrn, pScreen))
return FALSE;
commit 95ce13572dc2d9f5dd6cf55c23411e275c0aadf1
Author: Alex Deucher <alexdeucher at gmail.com>
Date: Tue Feb 24 10:51:13 2009 -0500
R6xx/R7xx EXA: Optimize temp surface for overlapping copies
- allocate temp surface in PrepareCopy()
- fall back to old OverlapCopy() path if we are not able
to allocate a temp surface
diff --git a/src/r600_exa.c b/src/r600_exa.c
index 8da0b4d..b4db38d 100644
--- a/src/r600_exa.c
+++ b/src/r600_exa.c
@@ -694,13 +694,15 @@ R600PrepareCopy(PixmapPtr pSrc, PixmapPtr pDst,
accel_state->planemask = planemask;
if (exaGetPixmapOffset(pSrc) == exaGetPixmapOffset(pDst)) {
+ unsigned long size = pDst->drawable.height * accel_state->dst_pitch * pDst->drawable.bitsPerPixel/8;
accel_state->same_surface = TRUE;
-#ifdef SHOW_VERTEXES
- ErrorF("same surface!\n");
-#endif
+ if (accel_state->copy_area) {
+ exaOffscreenFree(pDst->drawable.pScreen, accel_state->copy_area);
+ accel_state->copy_area = NULL;
+ }
+ accel_state->copy_area = exaOffscreenAlloc(pDst->drawable.pScreen, size, 256, TRUE, NULL, NULL);
} else {
-
accel_state->same_surface = FALSE;
R600DoPrepareCopy(pScrn,
@@ -868,29 +870,27 @@ R600Copy(PixmapPtr pDst,
struct radeon_accel_state *accel_state = info->accel_state;
if (accel_state->same_surface && is_overlap(srcX, srcX + w, srcY, srcY + h, dstX, dstX + w, dstY, dstY + h)) {
- uint32_t pitch = exaGetPixmapPitch(pDst) / (pDst->drawable.bitsPerPixel / 8);
- uint32_t orig_offset, tmp_offset;
+ if (accel_state->copy_area) {
+ uint32_t pitch = exaGetPixmapPitch(pDst) / (pDst->drawable.bitsPerPixel / 8);
+ uint32_t orig_offset, tmp_offset;
- if(!(accel_state->copy_area)) {
- unsigned long size=pDst->drawable.height*pitch*pDst->drawable.bitsPerPixel/8;
- accel_state->copy_area=exaOffscreenAlloc(pDst->drawable.pScreen, size, 256, TRUE, NULL, NULL);
- }
-
- tmp_offset = accel_state->copy_area->offset + info->fbLocation + pScrn->fbOffset;
- orig_offset = exaGetPixmapOffset(pDst) + info->fbLocation + pScrn->fbOffset;
+ tmp_offset = accel_state->copy_area->offset + info->fbLocation + pScrn->fbOffset;
+ orig_offset = exaGetPixmapOffset(pDst) + info->fbLocation + pScrn->fbOffset;
- R600DoPrepareCopy(pScrn,
- pitch, pDst->drawable.width, pDst->drawable.height, orig_offset, pDst->drawable.bitsPerPixel,
- pitch, pDst->drawable.height, tmp_offset, pDst->drawable.bitsPerPixel,
- accel_state->rop, accel_state->planemask);
- R600AppendCopyVertex(pScrn, srcX, srcY, dstX, dstY, w, h);
- R600DoCopy(pScrn);
- R600DoPrepareCopy(pScrn,
- pitch, pDst->drawable.width, pDst->drawable.height, tmp_offset, pDst->drawable.bitsPerPixel,
- pitch, pDst->drawable.height, orig_offset, pDst->drawable.bitsPerPixel,
- accel_state->rop, accel_state->planemask);
- R600AppendCopyVertex(pScrn, dstX, dstY, dstX, dstY, w, h);
- R600DoCopy(pScrn);
+ R600DoPrepareCopy(pScrn,
+ pitch, pDst->drawable.width, pDst->drawable.height, orig_offset, pDst->drawable.bitsPerPixel,
+ pitch, pDst->drawable.height, tmp_offset, pDst->drawable.bitsPerPixel,
+ accel_state->rop, accel_state->planemask);
+ R600AppendCopyVertex(pScrn, srcX, srcY, dstX, dstY, w, h);
+ R600DoCopy(pScrn);
+ R600DoPrepareCopy(pScrn,
+ pitch, pDst->drawable.width, pDst->drawable.height, tmp_offset, pDst->drawable.bitsPerPixel,
+ pitch, pDst->drawable.height, orig_offset, pDst->drawable.bitsPerPixel,
+ accel_state->rop, accel_state->planemask);
+ R600AppendCopyVertex(pScrn, dstX, dstY, dstX, dstY, w, h);
+ R600DoCopy(pScrn);
+ } else
+ R600OverlapCopy(pDst, srcX, srcY, dstX, dstY, w, h);
} else if(accel_state->same_surface) {
uint32_t pitch = exaGetPixmapPitch(pDst) / (pDst->drawable.bitsPerPixel / 8);
uint32_t offset = exaGetPixmapOffset(pDst) + info->fbLocation + pScrn->fbOffset;
@@ -914,12 +914,12 @@ R600DoneCopy(PixmapPtr pDst)
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
- if(!(accel_state->same_surface))
+ if (!accel_state->same_surface)
R600DoCopy(pScrn);
if (accel_state->copy_area) {
exaOffscreenFree(pDst->drawable.pScreen, accel_state->copy_area);
- accel_state->copy_area=NULL;
+ accel_state->copy_area = NULL;
}
}
commit 1a7db3fc2a0277d724d60d028064d8ef75019c28
Author: Mark van Doesburg <mark.vandoesburg at hetnet.nl>
Date: Tue Feb 24 10:44:19 2009 -0500
R6xx/R7xx EXA: use a temp surface for overlapping copy
diff --git a/src/r600_exa.c b/src/r600_exa.c
index a252fb6..8da0b4d 100644
--- a/src/r600_exa.c
+++ b/src/r600_exa.c
@@ -867,11 +867,44 @@ R600Copy(PixmapPtr pDst,
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
- //blit to/from same surfacce
- if (accel_state->same_surface)
- R600OverlapCopy(pDst, srcX, srcY, dstX, dstY, w, h);
- else
+ if (accel_state->same_surface && is_overlap(srcX, srcX + w, srcY, srcY + h, dstX, dstX + w, dstY, dstY + h)) {
+ uint32_t pitch = exaGetPixmapPitch(pDst) / (pDst->drawable.bitsPerPixel / 8);
+ uint32_t orig_offset, tmp_offset;
+
+ if(!(accel_state->copy_area)) {
+ unsigned long size=pDst->drawable.height*pitch*pDst->drawable.bitsPerPixel/8;
+ accel_state->copy_area=exaOffscreenAlloc(pDst->drawable.pScreen, size, 256, TRUE, NULL, NULL);
+ }
+
+ tmp_offset = accel_state->copy_area->offset + info->fbLocation + pScrn->fbOffset;
+ orig_offset = exaGetPixmapOffset(pDst) + info->fbLocation + pScrn->fbOffset;
+
+ R600DoPrepareCopy(pScrn,
+ pitch, pDst->drawable.width, pDst->drawable.height, orig_offset, pDst->drawable.bitsPerPixel,
+ pitch, pDst->drawable.height, tmp_offset, pDst->drawable.bitsPerPixel,
+ accel_state->rop, accel_state->planemask);
R600AppendCopyVertex(pScrn, srcX, srcY, dstX, dstY, w, h);
+ R600DoCopy(pScrn);
+ R600DoPrepareCopy(pScrn,
+ pitch, pDst->drawable.width, pDst->drawable.height, tmp_offset, pDst->drawable.bitsPerPixel,
+ pitch, pDst->drawable.height, orig_offset, pDst->drawable.bitsPerPixel,
+ accel_state->rop, accel_state->planemask);
+ R600AppendCopyVertex(pScrn, dstX, dstY, dstX, dstY, w, h);
+ R600DoCopy(pScrn);
+ } else if(accel_state->same_surface) {
+ uint32_t pitch = exaGetPixmapPitch(pDst) / (pDst->drawable.bitsPerPixel / 8);
+ uint32_t offset = exaGetPixmapOffset(pDst) + info->fbLocation + pScrn->fbOffset;
+
+ R600DoPrepareCopy(pScrn,
+ pitch, pDst->drawable.width, pDst->drawable.height, offset, pDst->drawable.bitsPerPixel,
+ pitch, pDst->drawable.height, offset, pDst->drawable.bitsPerPixel,
+ accel_state->rop, accel_state->planemask);
+ R600AppendCopyVertex(pScrn, srcX, srcY, dstX, dstY, w, h);
+ R600DoCopy(pScrn);
+ } else {
+ R600AppendCopyVertex(pScrn, srcX, srcY, dstX, dstY, w, h);
+ }
+
}
static void
@@ -881,10 +914,14 @@ R600DoneCopy(PixmapPtr pDst)
RADEONInfoPtr info = RADEONPTR(pScrn);
struct radeon_accel_state *accel_state = info->accel_state;
- if (accel_state->same_surface)
- return;
- else
+ if(!(accel_state->same_surface))
R600DoCopy(pScrn);
+
+ if (accel_state->copy_area) {
+ exaOffscreenFree(pDst->drawable.pScreen, accel_state->copy_area);
+ accel_state->copy_area=NULL;
+ }
+
}
#define RADEON_TRACE_FALL 0
diff --git a/src/radeon.h b/src/radeon.h
index aa9dc46..2edad51 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -684,6 +684,7 @@ struct radeon_accel_state {
drmBufPtr scratch;
// copy
+ ExaOffscreenArea *copy_area;
Bool same_surface;
int rop;
uint32_t planemask;
More information about the xorg-commit
mailing list