diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2002-11-06 21:06:23 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2002-11-06 21:06:23 +0000 |
commit | 3db638110f445fdee0af026ba42b338baa48ae85 (patch) | |
tree | cdce3c99d6438633abf2f3fb6fda1f5cf804395e /sys/arch/sparc/dev/fb.c | |
parent | 60735805896012b6000a99f7de1678fd7cbfa3b6 (diff) |
- always initialize colormaps, even if the frame buffer is non console; this
helps if the ramdac does not get initialized (idea from jason@)
- only register a shutdown hook for the frame buffers which need it, if this
is the console frame buffer. Otherwise this is just a waste of time.
Diffstat (limited to 'sys/arch/sparc/dev/fb.c')
-rw-r--r-- | sys/arch/sparc/dev/fb.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/sys/arch/sparc/dev/fb.c b/sys/arch/sparc/dev/fb.c index ccc6da4839a..e9d8b05315c 100644 --- a/sys/arch/sparc/dev/fb.c +++ b/sys/arch/sparc/dev/fb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fb.c,v 1.21 2002/09/05 09:31:20 miod Exp $ */ +/* $OpenBSD: fb.c,v 1.22 2002/11/06 21:06:20 miod Exp $ */ /* $NetBSD: fb.c,v 1.23 1997/07/07 23:30:22 pk Exp $ */ /* @@ -350,11 +350,10 @@ fbwscons_init(sf, isconsole) } void -fbwscons_console_init(sf, wsc, row, setcolor, burner) +fbwscons_console_init(sf, wsc, row, burner) struct sunfb *sf; struct wsscreen_descr *wsc; int row; - void (*setcolor)(void *, u_int, u_int8_t, u_int8_t, u_int8_t); void (*burner)(void *, u_int, u_int); { long defattr; @@ -387,17 +386,7 @@ fbwscons_console_init(sf, wsc, row, setcolor, burner) * Select appropriate color settings to mimic a * black on white Sun console. */ - if (sf->sf_depth == 8 && setcolor != NULL) { - setcolor(sf, WSCOL_BLACK, 0, 0, 0); - setcolor(sf, 255, 0, 0, 0); - setcolor(sf, WSCOL_RED, 255, 0, 0); - setcolor(sf, WSCOL_GREEN, 0, 255, 0); - setcolor(sf, WSCOL_BROWN, 154, 85, 46); - setcolor(sf, WSCOL_BLUE, 0, 0, 255); - setcolor(sf, WSCOL_MAGENTA, 255, 255, 0); - setcolor(sf, WSCOL_CYAN, 0, 255, 255); - setcolor(sf, WSCOL_WHITE, 255, 255, 255); - } else if (sf->sf_depth > 8) { + if (sf->sf_depth > 8) { wscol_white = 0; wscol_black = 255; wskernel_bg = 0; @@ -420,6 +409,24 @@ fbwscons_console_init(sf, wsc, row, setcolor, burner) fb_cookie = sf; } +void +fbwscons_setcolormap(sf, setcolor) + struct sunfb *sf; + void (*setcolor)(void *, u_int, u_int8_t, u_int8_t, u_int8_t); +{ + if (sf->sf_depth <= 8 && setcolor != NULL) { + setcolor(sf, WSCOL_BLACK, 0, 0, 0); + setcolor(sf, 255, 0, 0, 0); + setcolor(sf, WSCOL_RED, 255, 0, 0); + setcolor(sf, WSCOL_GREEN, 0, 255, 0); + setcolor(sf, WSCOL_BROWN, 154, 85, 46); + setcolor(sf, WSCOL_BLUE, 0, 0, 255); + setcolor(sf, WSCOL_MAGENTA, 255, 255, 0); + setcolor(sf, WSCOL_CYAN, 0, 255, 255); + setcolor(sf, WSCOL_WHITE, 255, 255, 255); + } +} + #if defined(SUN4) /* * Support routines for pfour framebuffers. |