]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[PATCH] fbcon: Fix big-endian bogosity in slow_imageblit()
authorAntonino A. Daplas <adaplas@gmail.com>
Mon, 27 Mar 2006 13:11:44 +0000 (21:11 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 7 Apr 2006 16:44:29 +0000 (09:44 -0700)
The monochrome->color expansion routine that handles bitmaps which have
(widths % 8) != 0 (slow_imageblit) produces corrupt characters in big-endian.
This is caused by a bogus bit test in slow_imageblit().

Fix.

Signed-off-by: Antonino Daplas <adaplas@pol.net>
Acked-by: Herbert Poetzl <herbert@13thfloor.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/video/cfbimgblt.c
include/linux/fb.h

index 910e2338a27e3a38c7c182bcfcfe6f7e9d9c2864..8ba6152db2fdb4bc659b289adecf798cdd7f43e9 100644 (file)
@@ -169,7 +169,7 @@ static inline void slow_imageblit(const struct fb_image *image, struct fb_info *
 
                while (j--) {
                        l--;
-                       color = (*s & 1 << (FB_BIT_NR(l))) ? fgcolor : bgcolor;
+                       color = (*s & (1 << l)) ? fgcolor : bgcolor;
                        val |= FB_SHIFT_HIGH(color, shift);
                        
                        /* Did the bitshift spill bits to the next long? */
index 2cb19e6503aa954003e7ae30703188697bda472b..2fdd8aeca245ea02a75dd6a58f59dad54010c867 100644 (file)
@@ -839,12 +839,10 @@ struct fb_info {
 #define FB_LEFT_POS(bpp)          (32 - bpp)
 #define FB_SHIFT_HIGH(val, bits)  ((val) >> (bits))
 #define FB_SHIFT_LOW(val, bits)   ((val) << (bits))
-#define FB_BIT_NR(b)              (7 - (b))
 #else
 #define FB_LEFT_POS(bpp)          (0)
 #define FB_SHIFT_HIGH(val, bits)  ((val) << (bits))
 #define FB_SHIFT_LOW(val, bits)   ((val) >> (bits))
-#define FB_BIT_NR(b)              (b)
 #endif
 
     /*