]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] fbdev: Shift pixel value before entering loop in cfbimageblit
authorAntonino A. Daplas <adaplas@gmail.com>
Tue, 13 Dec 2005 06:17:20 +0000 (22:17 -0800)
committerLinus Torvalds <torvalds@g5.osdl.org>
Tue, 13 Dec 2005 06:31:17 +0000 (22:31 -0800)
In slow imageblit, the pixel value is shifted by a certain amount (dependent
on the bpp and endianness) for each iteration.  This is inefficient.  Better
do the shifting once before going into the loop.

Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/video/cfbimgblt.c

index a7770c4f17d08f980c9e8724dc9e1d07ddd27ac5..7a01742a82af0519181ad69ff5056ca0589e2668 100644 (file)
@@ -162,6 +162,8 @@ static inline void slow_imageblit(const struct fb_image *image, struct fb_info *
        u32 i, j, l;
        
        dst2 = (u32 __iomem *) dst1;
+       fgcolor <<= LEFT_POS(bpp);
+       bgcolor <<= LEFT_POS(bpp);
 
        for (i = image->height; i--; ) {
                shift = val = 0;
@@ -180,7 +182,6 @@ static inline void slow_imageblit(const struct fb_image *image, struct fb_info *
                while (j--) {
                        l--;
                        color = (*s & 1 << (BIT_NR(l))) ? fgcolor : bgcolor;
-                       color <<= LEFT_POS(bpp);
                        val |= SHIFT_HIGH(color, shift);
                        
                        /* Did the bitshift spill bits to the next long? */