diff options
author | Thomas Pfaff <tpfaff@pcs.com> | 2008-02-06 10:39:45 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-06 19:41:18 +0100 |
commit | 91c4313206e4409871e2ddd13c29508afe1c8834 (patch) | |
tree | a37ae47c38b3f1fa119f141d546c000f58502eb9 /drivers/video/console/fbcon.c | |
parent | FB/S3C2410: check default_display parameter passed in platform data (diff) | |
download | linux-91c4313206e4409871e2ddd13c29508afe1c8834.tar.xz linux-91c4313206e4409871e2ddd13c29508afe1c8834.zip |
fbcon: fix color generation for monochrome framebuffer
The current attr_fgcol_ec / attr_bgcol_ec macros do a simple shift of bits
to get the color from vc_video_erase_char. For a monochrome display
however the attribute does not contain any color, only attribute bits.
Furthermore the reverse bit is lost because it is shifted out, the
resulting color is always 0.
This can bee seen on a monochrome console either directly or by setting it
to inverse mode via "setterm -inversescreen on" . Text is written with
correct color, fb_fillrects from a bit_clear / bit_clear_margins will get
wrong colors.
Signed-off-by: Thomas Pfaff <tpfaff@pcs.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/console/fbcon.c')
-rw-r--r-- | drivers/video/console/fbcon.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index c6babb178c77..022282494d3f 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -334,10 +334,7 @@ static inline int get_color(struct vc_data *vc, struct fb_info *info, switch (depth) { case 1: { - int col = ~(0xfff << (max(info->var.green.length, - max(info->var.red.length, - info->var.blue.length)))) & 0xff; - + int col = mono_col(info); /* 0 or 1 */ int fg = (info->fix.visual != FB_VISUAL_MONO01) ? col : 0; int bg = (info->fix.visual != FB_VISUAL_MONO01) ? 0 : col; |