This is the mail archive of the ecos-patches@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fix framebuffer block move support


As per a bug reported on ecos-discuss:

2008-11-09  Bart Veer  <bartv@ecoscentric.com>

	* src/linear.c: fix the block move operations (new_y > y) overlap
	handling.

Index: src/linear.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/io/framebuf/current/src/linear.c,v
retrieving revision 1.1
diff -u -p -r1.1 linear.c
--- src/linear.c	7 Oct 2008 10:15:04 -0000	1.1
+++ src/linear.c	9 Nov 2008 11:42:01 -0000
@@ -515,9 +515,9 @@ cyg_fb_linear_move_block_8_impl(void* fb
         dest   += (height * stride);
         
         for ( ; height; height--) {
-            __builtin_memcpy(dest, source, width);
             source  -= stride;
             dest    -= stride;
+            __builtin_memcpy(dest, source, width);
         }
         return;
     }
@@ -640,9 +640,9 @@ cyg_fb_linear_move_block_16_impl(void* f
         dest   = (cyg_uint16*)(((cyg_uint8*)dest)   + (height * stride8));
         width <<= 1;
         for ( ; height; height--) {
-            __builtin_memcpy(dest, source, width);
             source   = (cyg_uint16*)(((cyg_uint8*)source) - stride8);
             dest     = (cyg_uint16*)(((cyg_uint8*)dest) - stride8);
+            __builtin_memcpy(dest, source, width);
         }
         return;
     }
@@ -765,9 +765,9 @@ cyg_fb_linear_move_block_32_impl(void* f
         dest    = (cyg_uint32*)(((cyg_uint8*)dest)   + (height * stride8));
         width <<= 2;
         for ( ; height; height--) {
-            __builtin_memcpy(dest, source, width);
             source   = (cyg_uint32*)(((cyg_uint8*)source) - stride8);
             dest     = (cyg_uint32*)(((cyg_uint8*)dest) - stride8);
+            __builtin_memcpy(dest, source, width);
         }
         return;
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]