Module Name:    src
Committed By:   macallan
Date:           Thu Apr 12 19:11:49 UTC 2012

Modified Files:
        src/sys/arch/sparc64/dev: gfb.c

Log Message:
- don't mess with more than 256 colour map entries
- don't assume that wscons assumes BGR
- while there enable alpha


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/sparc64/dev/gfb.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/sparc64/dev/gfb.c
diff -u src/sys/arch/sparc64/dev/gfb.c:1.6 src/sys/arch/sparc64/dev/gfb.c:1.7
--- src/sys/arch/sparc64/dev/gfb.c:1.6	Tue Mar 13 18:40:29 2012
+++ src/sys/arch/sparc64/dev/gfb.c	Thu Apr 12 19:11:49 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: gfb.c,v 1.6 2012/03/13 18:40:29 elad Exp $	*/
+/*	$NetBSD: gfb.c,v 1.7 2012/04/12 19:11:49 macallan Exp $	*/
 
 /*
  * Copyright (c) 2009 Michael Lorenz
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: gfb.c,v 1.6 2012/03/13 18:40:29 elad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: gfb.c,v 1.7 2012/04/12 19:11:49 macallan Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -189,7 +189,7 @@ gfb_attach(device_t parent, device_t sel
 	ri = &sc->sc_console_screen.scr_ri;
 
 	j = 0;
-	for (i = 0; i < (1 << sc->sc_depth); i++) {
+	for (i = 0; i < 256; i++) {
 
 		sc->sc_cmap_red[i] = rasops_cmap[j];
 		sc->sc_cmap_green[i] = rasops_cmap[j + 1];
@@ -348,7 +348,7 @@ gfb_init_screen(void *cookie, struct vco
 	ri->ri_width = sc->sc_width;
 	ri->ri_height = sc->sc_height;
 	ri->ri_stride = sc->sc_stride;
-	ri->ri_flg = RI_CENTER | RI_FULLCLEAR;
+	ri->ri_flg = RI_CENTER | RI_FULLCLEAR | RI_ENABLE_ALPHA;
 
 	ri->ri_bits = (char *)sc->sc_fbaddr;
 	scr->scr_flags |= VCONS_DONT_READ;
@@ -357,6 +357,14 @@ gfb_init_screen(void *cookie, struct vco
 		ri->ri_flg |= RI_CLEAR;
 	}
 
+	/* explicitly request BGR in case the default changes */
+	ri->ri_rnum = 8;
+	ri->ri_gnum = 8;
+	ri->ri_bnum = 8;
+	ri->ri_rpos = 0;
+	ri->ri_gpos = 8;
+	ri->ri_bpos = 16;
+
 	rasops_init(ri, 0, 0);
 	ri->ri_caps = WSSCREEN_WSCOLORS;
 

Reply via email to