align blits for texture rectangles correctly, fix potential problem overwriting dma...
authorRoland Scheidegger <rscheidegger@gmx.ch>
Fri, 6 Feb 2004 15:24:51 +0000 (15:24 +0000)
committerRoland Scheidegger <rscheidegger@gmx.ch>
Fri, 6 Feb 2004 15:24:51 +0000 (15:24 +0000)
src/mesa/drivers/dri/r200/r200_texmem.c

index ed0ca5869034c1ef77eaaa16bdfc2a66e55239f1..473520a9507870b4f213c0a93712bf1e4c634da5 100644 (file)
@@ -231,7 +231,7 @@ static void r200UploadRectSubImage( r200ContextPtr rmesa,
         tex = (char *)texImage->Data + done * src_pitch;
 
         memset(&region, 0, sizeof(region));
-        r200AllocDmaRegion( rmesa, &region, lines * dstPitch, 64 );
+        r200AllocDmaRegion( rmesa, &region, lines * dstPitch, 1024 );
 
         /* Copy texdata to dma:
          */
@@ -240,10 +240,10 @@ static void r200UploadRectSubImage( r200ContextPtr rmesa,
                    __FUNCTION__, src_pitch, dstPitch);
 
         if (src_pitch == dstPitch) {
-           memcpy( region.address, tex, lines * src_pitch );
+           memcpy( region.address + region.start, tex, lines * src_pitch );
         } 
         else {
-           char *buf = region.address;
+           char *buf = region.address + region.start;
            int i;
            for (i = 0 ; i < lines ; i++) {
               memcpy( buf, tex, src_pitch );