aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/radeon/radeon_common.c
diff options
context:
space:
mode:
authorAlex Deucher <[email protected]>2009-07-14 21:19:32 -0400
committerAlex Deucher <[email protected]>2009-07-14 21:19:32 -0400
commit10b3e64bcada2e68144cc6ed40f7d760aff873e2 (patch)
treece32def24ebb3088b333f65fda159de47821d292 /src/mesa/drivers/dri/radeon/radeon_common.c
parent9385e4e1ff343c135532ddde04c0febf297003d7 (diff)
R6xx/r7xx: implement memcpy buffer swaps
This allows double buffered apps to run, but perfomance will be awful until we implement something faster. You must update to the latest kernel modules.
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_common.c')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_common.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c
index 60d6bbb5af9..e75e6a33de0 100644
--- a/src/mesa/drivers/dri/radeon/radeon_common.c
+++ b/src/mesa/drivers/dri/radeon/radeon_common.c
@@ -475,6 +475,24 @@ void radeonCopyBuffer( __DRIdrawablePrivate *dPriv,
if (!n)
continue;
+ if (IS_R600_CLASS(rmesa->radeonScreen)) {
+ int src_pitch = rmesa->radeonScreen->backPitch * rmesa->radeonScreen->cpp;
+ int dst_pitch = rmesa->radeonScreen->frontPitch * rmesa->radeonScreen->cpp;
+ char *src = (char *)rmesa->radeonScreen->driScreen->pFB + rmesa->radeonScreen->backOffset;
+ char *dst = (char *)rmesa->radeonScreen->driScreen->pFB + rmesa->radeonScreen->frontOffset;
+ int j;
+ drm_clip_rect_t *pb = rmesa->sarea->boxes;
+
+ for (j = 0; j < n; j++) {
+ int x = pb[j].x1;
+ int y = pb[j].y1;
+ int w = pb[j].x2 - x;
+ int h = pb[j].y2 - y;
+
+ r600_sw_blit(src, src_pitch, dst, dst_pitch, x, y, w, h, rmesa->radeonScreen->cpp);
+ }
+ }
+
ret = drmCommandNone( rmesa->dri.fd, DRM_RADEON_SWAP );
if ( ret ) {