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>
This commit is contained in:
committed by
Linus Torvalds
parent
e8973637bd
commit
91c4313206
@@ -63,7 +63,7 @@ static void bit_clear(struct vc_data *vc, struct fb_info *info, int sy,
|
||||
int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
|
||||
struct fb_fillrect region;
|
||||
|
||||
region.color = attr_bgcol_ec(bgshift, vc);
|
||||
region.color = attr_bgcol_ec(bgshift, vc, info);
|
||||
region.dx = sx * vc->vc_font.width;
|
||||
region.dy = sy * vc->vc_font.height;
|
||||
region.width = width * vc->vc_font.width;
|
||||
@@ -213,7 +213,7 @@ static void bit_clear_margins(struct vc_data *vc, struct fb_info *info,
|
||||
unsigned int bs = info->var.yres - bh;
|
||||
struct fb_fillrect region;
|
||||
|
||||
region.color = attr_bgcol_ec(bgshift, vc);
|
||||
region.color = attr_bgcol_ec(bgshift, vc, info);
|
||||
region.rop = ROP_COPY;
|
||||
|
||||
if (rw && !bottom_only) {
|
||||
|
Reference in New Issue
Block a user