- don't mess with more than 256 colour map entries

- don't assume that wscons assumes BGR
- while there enable alpha
This commit is contained in:
macallan 2012-04-12 19:11:49 +00:00
parent c6ba58b388
commit 7111124bac
1 changed files with 12 additions and 4 deletions

View File

@ -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 self, void *aux)
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 vcons_screen *scr,
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 vcons_screen *scr,
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;