You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
vt: add color support to the "underline" and "italic" attributes
Add color support to the "underline" and "italic" attributes as in OpenBSD/NetBSD-style (vt220) and xterm. Signed-off-by: Jan Engelhardt <jengelh@gmx.de> Acked-by: "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
1c2bbe6a11
commit
fa6ce9ab5f
@@ -384,7 +384,7 @@ static inline u16 mda_convert_attr(u16 ch)
|
||||
}
|
||||
|
||||
static u8 mdacon_build_attr(struct vc_data *c, u8 color, u8 intensity,
|
||||
u8 blink, u8 underline, u8 reverse)
|
||||
u8 blink, u8 underline, u8 reverse, u8 italic)
|
||||
{
|
||||
/* The attribute is just a bit vector:
|
||||
*
|
||||
@@ -397,6 +397,7 @@ static u8 mdacon_build_attr(struct vc_data *c, u8 color, u8 intensity,
|
||||
return (intensity & 3) |
|
||||
((underline & 1) << 2) |
|
||||
((reverse & 1) << 3) |
|
||||
(!!italic << 4) |
|
||||
((blink & 1) << 7);
|
||||
}
|
||||
|
||||
|
||||
@@ -548,7 +548,8 @@ promcon_scroll(struct vc_data *conp, int t, int b, int dir, int count)
|
||||
}
|
||||
|
||||
#if !(PROMCON_COLOR)
|
||||
static u8 promcon_build_attr(struct vc_data *conp, u8 _color, u8 _intensity, u8 _blink, u8 _underline, u8 _reverse)
|
||||
static u8 promcon_build_attr(struct vc_data *conp, u8 _color, u8 _intensity,
|
||||
u8 _blink, u8 _underline, u8 _reverse, u8 _italic)
|
||||
{
|
||||
return (_reverse) ? 0xf : 0x7;
|
||||
}
|
||||
|
||||
@@ -314,7 +314,7 @@ static unsigned long sticon_getxy(struct vc_data *conp, unsigned long pos,
|
||||
}
|
||||
|
||||
static u8 sticon_build_attr(struct vc_data *conp, u8 color, u8 intens,
|
||||
u8 blink, u8 underline, u8 reverse)
|
||||
u8 blink, u8 underline, u8 reverse, u8 italic)
|
||||
{
|
||||
u8 attr = ((color & 0x70) >> 1) | ((color & 7));
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ static void vgacon_save_screen(struct vc_data *c);
|
||||
static int vgacon_scroll(struct vc_data *c, int t, int b, int dir,
|
||||
int lines);
|
||||
static u8 vgacon_build_attr(struct vc_data *c, u8 color, u8 intensity,
|
||||
u8 blink, u8 underline, u8 reverse);
|
||||
u8 blink, u8 underline, u8 reverse, u8);
|
||||
static void vgacon_invert_region(struct vc_data *c, u16 * p, int count);
|
||||
static unsigned long vgacon_uni_pagedir[2];
|
||||
|
||||
@@ -578,12 +578,14 @@ static void vgacon_deinit(struct vc_data *c)
|
||||
}
|
||||
|
||||
static u8 vgacon_build_attr(struct vc_data *c, u8 color, u8 intensity,
|
||||
u8 blink, u8 underline, u8 reverse)
|
||||
u8 blink, u8 underline, u8 reverse, u8 italic)
|
||||
{
|
||||
u8 attr = color;
|
||||
|
||||
if (vga_can_do_color) {
|
||||
if (underline)
|
||||
if (italic)
|
||||
attr = (attr & 0xF0) | c->vc_itcolor;
|
||||
else if (underline)
|
||||
attr = (attr & 0xf0) | c->vc_ulcolor;
|
||||
else if (intensity == 0)
|
||||
attr = (attr & 0xf0) | c->vc_halfcolor;
|
||||
@@ -597,7 +599,9 @@ static u8 vgacon_build_attr(struct vc_data *c, u8 color, u8 intensity,
|
||||
if (intensity == 2)
|
||||
attr ^= 0x08;
|
||||
if (!vga_can_do_color) {
|
||||
if (underline)
|
||||
if (italic)
|
||||
attr = (attr & 0xF8) | 0x02;
|
||||
else if (underline)
|
||||
attr = (attr & 0xf8) | 0x01;
|
||||
else if (intensity == 0)
|
||||
attr = (attr & 0xf0) | 0x08;
|
||||
|
||||
Reference in New Issue
Block a user