summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2001-05-25 05:48:55 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2001-05-25 05:48:55 +0000
commit4d2bee7d655308b12a9bfae817526ad71272c8bb (patch)
tree3e2b6f6e4d742499507ee25c4f10b223285090ff
parent8e39c002270a10a8dec4d27dc74f5d00c6c10894 (diff)
Fix color table initialization for powerpc with wscons.
Without this fix some systems could come up black on black.
-rw-r--r--sys/arch/powerpc/pci/vgafb.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/sys/arch/powerpc/pci/vgafb.c b/sys/arch/powerpc/pci/vgafb.c
index 580328c59bc..1d1ac5c30d0 100644
--- a/sys/arch/powerpc/pci/vgafb.c
+++ b/sys/arch/powerpc/pci/vgafb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vgafb.c,v 1.9 2001/02/28 19:12:40 drahn Exp $ */
+/* $OpenBSD: vgafb.c,v 1.10 2001/05/25 05:48:54 drahn Exp $ */
/* $NetBSD: vga.c,v 1.3 1996/12/02 22:24:54 cgd Exp $ */
/*
@@ -66,6 +66,7 @@ void vgafb_copyrows __P((void *, int, int, int));
void vgafb_eraserows __P((void *, int, int));
void vgafb_alloc_attr __P((void *c, int fg, int bg, int flags, long *));
+void vgafb_setcolor __P((unsigned int index, u_int8_t r, u_int8_t g, u_int8_t b));
static void drawChar ( struct vgafb_config *vc, char ch, int cx,
int cy, char at);
static void setPixel( struct vgafb_config *vc, int x, int y, int v);
@@ -503,9 +504,32 @@ vgafb_cnattach(iot, memt, pc, bus, device, function)
}
}
#endif
+ {
+ int i;
+ for (i = 0; i < 256; i++) {
+ vgafb_setcolor(i, 255,255,255);
+ }
+ }
+ vgafb_setcolor(WSCOL_BLACK, 0, 0, 0);
+ vgafb_setcolor(255, 255, 255, 255);
+ vgafb_setcolor(WSCOL_RED, 255, 0, 0);
+ vgafb_setcolor(WSCOL_GREEN, 0, 255, 0);
+ vgafb_setcolor(WSCOL_BROWN, 154, 85, 46);
+ vgafb_setcolor(WSCOL_BLUE, 0, 0, 255);
+ vgafb_setcolor(WSCOL_MAGENTA, 255, 255, 0);
+ vgafb_setcolor(WSCOL_CYAN, 0, 255, 255);
+ vgafb_setcolor(WSCOL_WHITE, 255, 255, 255);
wsdisplay_cnattach(&vgafb_stdscreen, ri, 0, 0, defattr);
}
+void
+vgafb_setcolor(index, r, g, b)
+ unsigned int index;
+ u_int8_t r, g, b;
+{
+ OF_call_method_1("color!", cons_display_ofh, 4, r, g, b, index);
+}
+
int
vgafb_getcmap(vc, cm)
struct vgafb_config *vc;