monochrome display fix.

4 messages, 4 authors, 2004-01-27 · open the first message on its own page

monochrome display fix.

From: James Simmons <hidden>
Date: 2004-01-26 22:13:32

[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;

Re: monochrome display fix.

From: Linus Torvalds <torvalds@osdl.org>
Date: 2004-01-26 22:49:01


On Mon, 26 Jan 2004, James Simmons wrote:
[CONSOLE] Don't let a monochrome display stomp all over the console color 
values.
Why is this ugly patch required? If something can't do color, why does it 
care about "color" in the first place? We've never needed this patch 
before, it looks like something broke somewhere _else_ that causes this
to be relevant.

		Linus

Re: [Linux-fbdev-devel] Re: monochrome display fix.

From: Thiemo Seufer <hidden>
Date: 2004-01-27 07:40:51

Linus Torvalds wrote:

On Mon, 26 Jan 2004, James Simmons wrote:
quoted
[CONSOLE] Don't let a monochrome display stomp all over the console color 
values.
Why is this ugly patch required? If something can't do color, why does it 
care about "color" in the first place?
Because it stores some text attributes in that place.
We've never needed this patch 
before, it looks like something broke somewhere _else_ that causes this
to be relevant.
It was always broken. This went unnoticed, apparently nobody tried to use
a kernel which supports mono and colour framebuffers at the same time.


Thiemo

Re: [Linux-fbdev-devel] Re: monochrome display fix.

From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Date: 2004-01-27 10:22:27

It was always broken. This went unnoticed, apparently nobody tried to use
a kernel which supports mono and colour framebuffers at the same time.
Still, the patch is ugly.. I'd rather just calculate the colour
normally, and only conditionally store it once in the end...

Ben.




-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help