diff options
author | Jan Engelhardt <jengelh@linux01.gwdg.de> | 2007-05-08 03:38:04 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 14:15:27 -0400 |
commit | fa6ce9ab5fbcb4c276c48861584b70d387e787b3 (patch) | |
tree | 71b6295410513d17226a57be542f0a761db97841 /drivers/video/console | |
parent | 1c2bbe6a11ec7d1de114acfc8a6bf2821b0224a5 (diff) |
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>
Diffstat (limited to 'drivers/video/console')
-rw-r--r-- | drivers/video/console/mdacon.c | 3 | ||||
-rw-r--r-- | drivers/video/console/promcon.c | 3 | ||||
-rw-r--r-- | drivers/video/console/sticon.c | 2 | ||||
-rw-r--r-- | drivers/video/console/vgacon.c | 12 |
4 files changed, 13 insertions, 7 deletions
diff --git a/drivers/video/console/mdacon.c b/drivers/video/console/mdacon.c index 124ecbe6f88c..bd8d995fe25d 100644 --- a/drivers/video/console/mdacon.c +++ b/drivers/video/console/mdacon.c | |||
@@ -384,7 +384,7 @@ static inline u16 mda_convert_attr(u16 ch) | |||
384 | } | 384 | } |
385 | 385 | ||
386 | static u8 mdacon_build_attr(struct vc_data *c, u8 color, u8 intensity, | 386 | static u8 mdacon_build_attr(struct vc_data *c, u8 color, u8 intensity, |
387 | u8 blink, u8 underline, u8 reverse) | 387 | u8 blink, u8 underline, u8 reverse, u8 italic) |
388 | { | 388 | { |
389 | /* The attribute is just a bit vector: | 389 | /* The attribute is just a bit vector: |
390 | * | 390 | * |
@@ -397,6 +397,7 @@ static u8 mdacon_build_attr(struct vc_data *c, u8 color, u8 intensity, | |||
397 | return (intensity & 3) | | 397 | return (intensity & 3) | |
398 | ((underline & 1) << 2) | | 398 | ((underline & 1) << 2) | |
399 | ((reverse & 1) << 3) | | 399 | ((reverse & 1) << 3) | |
400 | (!!italic << 4) | | ||
400 | ((blink & 1) << 7); | 401 | ((blink & 1) << 7); |
401 | } | 402 | } |
402 | 403 | ||
diff --git a/drivers/video/console/promcon.c b/drivers/video/console/promcon.c index b78eac63459f..ae02e4eb18e7 100644 --- a/drivers/video/console/promcon.c +++ b/drivers/video/console/promcon.c | |||
@@ -548,7 +548,8 @@ promcon_scroll(struct vc_data *conp, int t, int b, int dir, int count) | |||
548 | } | 548 | } |
549 | 549 | ||
550 | #if !(PROMCON_COLOR) | 550 | #if !(PROMCON_COLOR) |
551 | static u8 promcon_build_attr(struct vc_data *conp, u8 _color, u8 _intensity, u8 _blink, u8 _underline, u8 _reverse) | 551 | static u8 promcon_build_attr(struct vc_data *conp, u8 _color, u8 _intensity, |
552 | u8 _blink, u8 _underline, u8 _reverse, u8 _italic) | ||
552 | { | 553 | { |
553 | return (_reverse) ? 0xf : 0x7; | 554 | return (_reverse) ? 0xf : 0x7; |
554 | } | 555 | } |
diff --git a/drivers/video/console/sticon.c b/drivers/video/console/sticon.c index 57b21e533036..67a682d6cc7b 100644 --- a/drivers/video/console/sticon.c +++ b/drivers/video/console/sticon.c | |||
@@ -314,7 +314,7 @@ static unsigned long sticon_getxy(struct vc_data *conp, unsigned long pos, | |||
314 | } | 314 | } |
315 | 315 | ||
316 | static u8 sticon_build_attr(struct vc_data *conp, u8 color, u8 intens, | 316 | static u8 sticon_build_attr(struct vc_data *conp, u8 color, u8 intens, |
317 | u8 blink, u8 underline, u8 reverse) | 317 | u8 blink, u8 underline, u8 reverse, u8 italic) |
318 | { | 318 | { |
319 | u8 attr = ((color & 0x70) >> 1) | ((color & 7)); | 319 | u8 attr = ((color & 0x70) >> 1) | ((color & 7)); |
320 | 320 | ||
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index 3e67c34df9a5..53c22197b631 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c | |||
@@ -87,7 +87,7 @@ static void vgacon_save_screen(struct vc_data *c); | |||
87 | static int vgacon_scroll(struct vc_data *c, int t, int b, int dir, | 87 | static int vgacon_scroll(struct vc_data *c, int t, int b, int dir, |
88 | int lines); | 88 | int lines); |
89 | static u8 vgacon_build_attr(struct vc_data *c, u8 color, u8 intensity, | 89 | static u8 vgacon_build_attr(struct vc_data *c, u8 color, u8 intensity, |
90 | u8 blink, u8 underline, u8 reverse); | 90 | u8 blink, u8 underline, u8 reverse, u8); |
91 | static void vgacon_invert_region(struct vc_data *c, u16 * p, int count); | 91 | static void vgacon_invert_region(struct vc_data *c, u16 * p, int count); |
92 | static unsigned long vgacon_uni_pagedir[2]; | 92 | static unsigned long vgacon_uni_pagedir[2]; |
93 | 93 | ||
@@ -578,12 +578,14 @@ static void vgacon_deinit(struct vc_data *c) | |||
578 | } | 578 | } |
579 | 579 | ||
580 | static u8 vgacon_build_attr(struct vc_data *c, u8 color, u8 intensity, | 580 | static u8 vgacon_build_attr(struct vc_data *c, u8 color, u8 intensity, |
581 | u8 blink, u8 underline, u8 reverse) | 581 | u8 blink, u8 underline, u8 reverse, u8 italic) |
582 | { | 582 | { |
583 | u8 attr = color; | 583 | u8 attr = color; |
584 | 584 | ||
585 | if (vga_can_do_color) { | 585 | if (vga_can_do_color) { |
586 | if (underline) | 586 | if (italic) |
587 | attr = (attr & 0xF0) | c->vc_itcolor; | ||
588 | else if (underline) | ||
587 | attr = (attr & 0xf0) | c->vc_ulcolor; | 589 | attr = (attr & 0xf0) | c->vc_ulcolor; |
588 | else if (intensity == 0) | 590 | else if (intensity == 0) |
589 | attr = (attr & 0xf0) | c->vc_halfcolor; | 591 | attr = (attr & 0xf0) | c->vc_halfcolor; |
@@ -597,7 +599,9 @@ static u8 vgacon_build_attr(struct vc_data *c, u8 color, u8 intensity, | |||
597 | if (intensity == 2) | 599 | if (intensity == 2) |
598 | attr ^= 0x08; | 600 | attr ^= 0x08; |
599 | if (!vga_can_do_color) { | 601 | if (!vga_can_do_color) { |
600 | if (underline) | 602 | if (italic) |
603 | attr = (attr & 0xF8) | 0x02; | ||
604 | else if (underline) | ||
601 | attr = (attr & 0xf8) | 0x01; | 605 | attr = (attr & 0xf8) | 0x01; |
602 | else if (intensity == 0) | 606 | else if (intensity == 0) |
603 | attr = (attr & 0xf0) | 0x08; | 607 | attr = (attr & 0xf0) | 0x08; |