linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 19/26] fbcon: Fix big-endian bogosity in slow_imageblit()
       [not found] ` <20060404235927.GA27049@kroah.com>
@ 2006-04-05  0:01   ` gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2006-04-05  0:01 UTC (permalink / raw)
  To: linux-kernel, stable, Andrew Morton
  Cc: Justin Forbes, Zwane Mwaikambo, Theodore Ts'o, Randy Dunlap,
	Dave Jones, Chuck Wolber, torvalds, alan,
	Linux Fbdev development list, Antonino Daplas, Herbert Poetzl,
	Greg Kroah-Hartman

[-- Attachment #1: fbcon-fix-big-endian-bogosity-in.patch --]
[-- Type: text/plain, Size: 1414 bytes --]

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 |    2 +-
 include/linux/fb.h        |    2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

--- linux-2.6.16.1.orig/drivers/video/cfbimgblt.c
+++ linux-2.6.16.1/drivers/video/cfbimgblt.c
@@ -169,7 +169,7 @@ static inline void slow_imageblit(const 
 
 		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? */
--- linux-2.6.16.1.orig/include/linux/fb.h
+++ linux-2.6.16.1/include/linux/fb.h
@@ -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
 
     /*

--

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-04-05  0:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20060404235634.696852000@quad.kroah.org>
     [not found] ` <20060404235927.GA27049@kroah.com>
2006-04-05  0:01   ` [patch 19/26] fbcon: Fix big-endian bogosity in slow_imageblit() gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).