Use memcpy directly in the common code
authorAlex Deucher <alexdeucher@gmail.com>
Wed, 15 Jul 2009 15:16:41 +0000 (11:16 -0400)
committerAlex Deucher <alexdeucher@gmail.com>
Wed, 15 Jul 2009 15:16:41 +0000 (11:16 -0400)
This alleviates the need for an additional symbol.

src/mesa/drivers/dri/r600/r600_cmdbuf.c
src/mesa/drivers/dri/radeon/radeon_bo_legacy.c
src/mesa/drivers/dri/radeon/radeon_common.c

index b8e1debf8fcddb146e80b84e6e80be84ebd1cf0b..7bde3360b61e8f0e80dc0ccf0d4c6009cdc245a5 100644 (file)
@@ -676,19 +676,3 @@ void r600InitCmdBuf(context_t *r600) /* from rcommonInitCmdBuf */
        }
 }
 
-void r600_sw_blit(char *srcp, int src_pitch, char *dstp, int dst_pitch,
-                 int x, int y, int w, int h, int cpp)
-{
-       char *src = srcp;
-       char *dst = dstp;
-
-       src += (y * src_pitch) + (x * cpp);
-       dst += (y * dst_pitch) + (x * cpp);
-
-       while (h--) {
-               memcpy(dst, src, w * cpp);
-               src += src_pitch;
-               dst += dst_pitch;
-       }
-}
-
index ae5f0c4cfe75189b4402bcb1f57b5af3730908bf..94c2d97825636eb77df0c25e643c4b442c6109df 100644 (file)
@@ -618,7 +618,7 @@ static int bo_vram_validate(struct radeon_bo *bo,
                            (bo_legacy->offset - boml->fb_location);
 
                    /* FIXME: alignment, pitch, etc. */
-                   r600_sw_blit(src, 0, dst, 0, 0, 0, 1, 1, bo->size);
+                   memcpy(dst, src, bo->size);
            } else {
                    /* Copy to VRAM using a blit.
                     * All memory is 4K aligned. We're using 1024 pixels wide blits.
index e75e6a33de0ddd2dc0e72fb9b5ad2d4cc99d311c..1848b7113e11fa012ed5ec2e994aa3609344a3fc 100644 (file)
@@ -476,8 +476,9 @@ void radeonCopyBuffer( __DRIdrawablePrivate *dPriv,
                        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;
+                       int cpp = rmesa->radeonScreen->cpp;
+                       int src_pitch = rmesa->radeonScreen->backPitch * cpp;
+                       int dst_pitch = rmesa->radeonScreen->frontPitch * cpp;
                        char *src = (char *)rmesa->radeonScreen->driScreen->pFB + rmesa->radeonScreen->backOffset;
                        char *dst = (char *)rmesa->radeonScreen->driScreen->pFB + rmesa->radeonScreen->frontOffset;
                        int j;
@@ -489,7 +490,14 @@ void radeonCopyBuffer( __DRIdrawablePrivate *dPriv,
                                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);
+                               src += (y * src_pitch) + (x * cpp);
+                               dst += (y * dst_pitch) + (x * cpp);
+
+                               while (h--) {
+                                       memcpy(dst, src, w * cpp);
+                                       src += src_pitch;
+                                       dst += dst_pitch;
+                               }
                        }
                }