R6xx/r7xx: implement memcpy buffer swaps
authorAlex Deucher <alexdeucher@gmail.com>
Wed, 15 Jul 2009 01:19:32 +0000 (21:19 -0400)
committerAlex Deucher <alexdeucher@gmail.com>
Wed, 15 Jul 2009 01:19:32 +0000 (21:19 -0400)
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.

src/mesa/drivers/dri/radeon/radeon_common.c

index 60d6bbb5af96df1f3bb276b2a17a73a2c1c7e5f7..e75e6a33de0ddd2dc0e72fb9b5ad2d4cc99d311c 100644 (file)
@@ -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 ) {