Subject: Re: CVS commit: src/sys/dev/wscons
To: Matthias Drochner <M.Drochner@fz-juelich.de>
From: Martin Husemann <martin@duskware.de>
List: tech-kern
Date: 05/24/2005 21:02:38
--SLDf9lqlvOQaIe6s
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

[moved from source-changes to tech-kern]

On Tue, May 24, 2005 at 08:37:24PM +0200, Matthias Drochner wrote:
> So the driver (or rasops) could use the whitest white colormap entry
> if WSCOL_WHITE is requested as background. And still something dimmer
> if used as foreground.

Sure, that would be a complicated way to get a subset of the functionality
we have now - I don't realy see a problem with the current definitions
(and their use in arch/sparc64/conf/GENERIC32).

Something else:
To make it realy work, I'd like to suggest the attached patch - most drivers
(all rasops based ones at least) seem to advertise (and properly implement)
WSATTR_REVERSE even for colour displays. So I'd suggest to try that first,
since it will use the (swapped) default colours - instead of relying
on white-on-black normal display.

Martin

--SLDf9lqlvOQaIe6s
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="wsemul_sun.c.patch"

Index: wsemul_sun.c
===================================================================
RCS file: /cvsroot/src/sys/dev/wscons/wsemul_sun.c,v
retrieving revision 1.19
diff -u -r1.19 wsemul_sun.c
--- wsemul_sun.c	3 Aug 2004 11:16:30 -0000	1.19
+++ wsemul_sun.c	24 May 2005 18:57:37 -0000
@@ -197,15 +197,14 @@
 
 	edp->cbcookie = cbcookie;
 
-	/* XXX This assumes that the default attribute is wob. */
-	if ((!(edp->scrcapabilities & WSSCREEN_WSCOLORS) ||
+	if ((!(edp->scrcapabilities & WSSCREEN_REVERSE) ||
+		(*edp->emulops->allocattr)(edp->emulcookie, 0, 0,
+					   WSATTR_REVERSE,
+					   &edp->bowattr)) &&
+	    (!(edp->scrcapabilities & WSSCREEN_WSCOLORS) ||
 		(*edp->emulops->allocattr)(edp->emulcookie,
 					   WSCOL_BLACK, WSCOL_WHITE,
 					   WSATTR_WSCOLORS,
-					   &edp->bowattr)) &&
-	    (!(edp->scrcapabilities & WSSCREEN_REVERSE) ||
-		(*edp->emulops->allocattr)(edp->emulcookie, 0, 0,
-					   WSATTR_REVERSE,
 					   &edp->bowattr)))
 		edp->bowattr = edp->defattr;
 

--SLDf9lqlvOQaIe6s--