Messages in this thread Patch in this message | | | Subject | pre9: PATCH for drivers/video/fbcon.c | From | edmundo@rano ... | Date | Sat, 23 Jan 1999 19:52:31 +0000 |
| |
If anyone wants 512-character fonts to work properly in a frame buffer console (particular one that doesn't do colour) they might be interested in this trivial little bug fix which didn't quite make it into 2.2.0-final:
To see one of the bugs that this patch fixes, get a colour frame buffer console and change from a 256-char font to a 512-char font, or vice versa, reset the console and, after each step, observe the appearance of the mouse pointer as you move it over text. For example:
$ consolechars -f LatArCyrHeb-16.psf $ echo -e '\033c' $ consolechars -f default8x16.psf $ echo -e '\033c'
--- v2.2.0-pre9/linux/drivers/video/fbcon.c Fri Jan 22 21:17:31 1999 +++ linux/drivers/video/fbcon.c Fri Jan 22 21:25:12 1999 @@ -1334,8 +1334,10 @@ p->_fontheight = h; if (p->conp->vc_hi_font_mask && cnt == 256) { p->conp->vc_hi_font_mask = 0; - if (p->conp->vc_can_do_color) + if (p->conp->vc_can_do_color) { p->conp->vc_complement_mask >>= 1; + p->conp->vc_s_complement_mask >>= 1; + } p->fgshift--; p->bgshift--; p->charmask = 0xff; @@ -1347,24 +1349,34 @@ int count = conp->vc_screenbuf_size/2; unsigned short c; for (; count > 0; count--, cp++) { + unsigned short newc; c = scr_readw(cp); - scr_writew(((c & 0xfe00) >> 1) | (c & 0xff), cp); + if (conp->vc_can_do_color) + newc = ((c & 0xfe00) >> 1) | (c & 0xff); + else + newc = c & ~0x100; + scr_writew(newc, cp); } c = conp->vc_video_erase_char; - conp->vc_video_erase_char = ((c & 0xfe00) >> 1) | (c & 0xff); - conp->vc_attr >>= 1; + if (conp->vc_can_do_color) { + conp->vc_video_erase_char = ((c & 0xfe00) >> 1) | (c & 0xff); + conp->vc_attr >>= 1; + } else + conp->vc_video_erase_char = c & ~0x100; } } else if (!p->conp->vc_hi_font_mask && cnt == 512) { p->conp->vc_hi_font_mask = 0x100; - if (p->conp->vc_can_do_color) + if (p->conp->vc_can_do_color) { p->conp->vc_complement_mask <<= 1; + p->conp->vc_s_complement_mask <<= 1; + } p->fgshift++; p->bgshift++; p->charmask = 0x1ff; /* ++Edmund: reorder the attribute bits */ - { + if (p->conp->vc_can_do_color) { struct vc_data *conp = p->conp; unsigned short *cp = (unsigned short *) conp->vc_origin; int count = conp->vc_screenbuf_size/2; - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |