linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* monochrome display fix.
@ 2004-01-26 22:13 James Simmons
  2004-01-26 22:48 ` Linus Torvalds
  0 siblings, 1 reply; 4+ messages in thread
From: James Simmons @ 2004-01-26 22:13 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux Fbdev development list, Linux Kernel Mailing List


[CONSOLE] Don't let a monochrome display stomp all over the console color 
values.

--- linus-2.6/drivers/char/vt.c	2004-01-26 13:34:39.000000000 -0800
+++ fbdev-2.5/drivers/char/vt.c	2004-01-21 17:36:26.000000000 -0800
@@ -1062,7 +1062,8 @@
 	underline = 0;
 	reverse = 0;
 	blink = 0;
-	color = def_color;
+	if (can_do_color)
+		color = def_color;
 }
 
 /* console_sem is held */
@@ -1135,7 +1136,8 @@
 				  * with white underscore (Linux - use
 				  * default foreground).
 				  */
-				color = (def_color & 0x0f) | background;
+				if (can_do_color)
+					color = (def_color & 0x0f) | background;
 				underline = 1;
 				break;
 			case 39: /* ANSI X3.64-1979 (SCO-ish?)
@@ -1143,19 +1145,23 @@
 				  * Reset colour to default? It did this
 				  * before...
 				  */
-				color = (def_color & 0x0f) | background;
+				if (can_do_color)
+					color = (def_color & 0x0f) | background;
 				underline = 0;
 				break;
 			case 49:
-				color = (def_color & 0xf0) | foreground;
+				if (can_do_color)
+					color = (def_color & 0xf0) | foreground;
 				break;
 			default:
-				if (par[i] >= 30 && par[i] <= 37)
-					color = color_table[par[i]-30]
-						| background;
-				else if (par[i] >= 40 && par[i] <= 47)
-					color = (color_table[par[i]-40]<<4)
-						| foreground;
+				if (can_do_color) {
+					if (par[i] >= 30 && par[i] <= 37)
+						color = color_table[par[i]-30]
+							| background;
+					else if (par[i] >= 40 && par[i] <= 47)
+						color = (color_table[par[i]-40]<<4)
+							| foreground;
+				}
 				break;
 		}
 	update_attr(currcons);
@@ -1290,9 +1296,11 @@
 			}
 			break;
 		case 8:	/* store colors as defaults */
-			def_color = attr;
-			if (hi_font_mask == 0x100)
-				def_color >>= 1;
+			if (can_do_color) {
+				def_color = attr;
+				if (hi_font_mask == 0x100)
+					def_color >>= 1;
+			}	
 			default_attr(currcons);
 			update_attr(currcons);
 			break;

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-01-27 10:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-26 22:13 monochrome display fix James Simmons
2004-01-26 22:48 ` Linus Torvalds
2004-01-27  7:40   ` [Linux-fbdev-devel] " Thiemo Seufer
2004-01-27 10:19     ` Benjamin Herrenschmidt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).