diff options
| author | nisimura <nisimura@NetBSD.org> | 2000-03-14 08:04:06 +0000 |
|---|---|---|
| committer | nisimura <nisimura@NetBSD.org> | 2000-03-14 08:04:06 +0000 |
| commit | 2eb68c00d2fa58eef15fa29f74abd8562bdd0b3b (patch) | |
| tree | a32a7ea7860b58287b247779df29fd50c5e1ec8f /sys/dev | |
| parent | 80c0893a8bf37923b9b131e9c98562af4862cbe2 (diff) | |
Respect video console colour designation by configration file.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/tc/cfb.c | 23 | ||||
| -rw-r--r-- | sys/dev/tc/tfb.c | 23 | ||||
| -rw-r--r-- | sys/dev/tc/xcfb.c | 20 |
3 files changed, 31 insertions, 35 deletions
diff --git a/sys/dev/tc/cfb.c b/sys/dev/tc/cfb.c index aa3f2d78384..d6acdddaa5c 100644 --- a/sys/dev/tc/cfb.c +++ b/sys/dev/tc/cfb.c @@ -1,4 +1,4 @@ -/* $NetBSD: cfb.c,v 1.18 2000/03/14 06:25:21 nisimura Exp $ */ +/* $NetBSD: cfb.c,v 1.19 2000/03/14 08:04:06 nisimura Exp $ */ /* * Copyright (c) 1998, 1999 Tohru Nishimura. All rights reserved. @@ -32,7 +32,7 @@ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: cfb.c,v 1.18 2000/03/14 06:25:21 nisimura Exp $"); +__KERNEL_RCSID(0, "$NetBSD: cfb.c,v 1.19 2000/03/14 08:04:06 nisimura Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -335,7 +335,6 @@ cfbattach(parent, self, aux) struct cfb_softc *sc = (struct cfb_softc *)self; struct tc_attach_args *ta = aux; struct wsemuldisplaydev_attach_args waa; - struct hwcmap256 *cm; int console; console = (ta->ta_addr == cfb_consaddr); @@ -351,9 +350,7 @@ cfbattach(parent, self, aux) printf(": %d x %d, %dbpp\n", sc->sc_dc->dc_wid, sc->sc_dc->dc_ht, sc->sc_dc->dc_depth); - cm = &sc->sc_cmap; - memset(cm, 255, sizeof(struct hwcmap256)); /* XXX */ - cm->r[0] = cm->g[0] = cm->b[0] = 0; /* XXX */ + memcpy(&sc->sc_cmap, rasops_cmap, sizeof(struct hwcmap256)); sc->sc_cursor.cc_magic.x = CX_MAGIC_X; sc->sc_cursor.cc_magic.y = CX_MAGIC_Y; @@ -632,13 +629,13 @@ cfbinit(dc) /* build sane colormap */ SELECT(vdac, 0); - REG(vdac, bt_cmap) = 0; tc_wmb(); - REG(vdac, bt_cmap) = 0; tc_wmb(); - REG(vdac, bt_cmap) = 0; tc_wmb(); - for (i = 1; i < CMAP_SIZE; i++) { - REG(vdac, bt_cmap) = 0xff; tc_wmb(); - REG(vdac, bt_cmap) = 0xff; tc_wmb(); - REG(vdac, bt_cmap) = 0xff; tc_wmb(); + for (i = 0; i < CMAP_SIZE; i++) { + REG(vdac, bt_cmap) = rasops_cmap[3 * i + 0]; + tc_wmb(); + REG(vdac, bt_cmap) = rasops_cmap[3 * i + 1]; + tc_wmb(); + REG(vdac, bt_cmap) = rasops_cmap[3 * i + 2]; + tc_wmb(); } /* clear out cursor image */ diff --git a/sys/dev/tc/tfb.c b/sys/dev/tc/tfb.c index 77d675bfad9..5b1dc25d847 100644 --- a/sys/dev/tc/tfb.c +++ b/sys/dev/tc/tfb.c @@ -1,4 +1,4 @@ -/* $NetBSD: tfb.c,v 1.22 2000/03/14 06:25:21 nisimura Exp $ */ +/* $NetBSD: tfb.c,v 1.23 2000/03/14 08:04:06 nisimura Exp $ */ /* * Copyright (c) 1998, 1999 Tohru Nishimura. All rights reserved. @@ -32,7 +32,7 @@ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: tfb.c,v 1.22 2000/03/14 06:25:21 nisimura Exp $"); +__KERNEL_RCSID(0, "$NetBSD: tfb.c,v 1.23 2000/03/14 08:04:06 nisimura Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -386,7 +386,6 @@ tfbattach(parent, self, aux) struct tfb_softc *sc = (struct tfb_softc *)self; struct tc_attach_args *ta = aux; struct wsemuldisplaydev_attach_args waa; - struct hwcmap256 *cm; int console; console = (ta->ta_addr == tfb_consaddr); @@ -401,9 +400,7 @@ tfbattach(parent, self, aux) } printf(": %d x %d, 8,24bpp\n", sc->sc_dc->dc_wid, sc->sc_dc->dc_ht); - cm = &sc->sc_cmap; - memset(cm, 255, sizeof(struct hwcmap256)); /* XXX */ - cm->r[0] = cm->g[0] = cm->b[0] = 0; /* XXX */ + memcpy(&sc->sc_cmap, rasops_cmap, sizeof(struct hwcmap256)); sc->sc_cursor.cc_magic.x = TX_MAGIC_X; sc->sc_cursor.cc_magic.y = TX_MAGIC_Y; @@ -699,13 +696,13 @@ tfbinit(dc) #endif SELECT463(vdac, BT463_IREG_CPALETTE_RAM); - BYTE(vdac, bt_cmap) = 0; tc_wmb(); - BYTE(vdac, bt_cmap) = 0; tc_wmb(); - BYTE(vdac, bt_cmap) = 0; tc_wmb(); - for (i = 1; i < 256; i++) { - BYTE(vdac, bt_cmap) = 0xff; tc_wmb(); - BYTE(vdac, bt_cmap) = 0xff; tc_wmb(); - BYTE(vdac, bt_cmap) = 0xff; tc_wmb(); + for (i = 0; i < 256; i++) { + BYTE(vdac, bt_cmap) = rasops_cmap[3 * i + 0]; + tc_wmb(); + BYTE(vdac, bt_cmap) = rasops_cmap[3 * i + 1]; + tc_wmb(); + BYTE(vdac, bt_cmap) = rasops_cmap[3 * i + 2]; + tc_wmb(); } /* !? Eeeh !? */ diff --git a/sys/dev/tc/xcfb.c b/sys/dev/tc/xcfb.c index 1dc25b145c1..45f1cedfe3d 100644 --- a/sys/dev/tc/xcfb.c +++ b/sys/dev/tc/xcfb.c @@ -1,4 +1,4 @@ -/* $NetBSD: xcfb.c,v 1.15 2000/03/14 06:25:21 nisimura Exp $ */ +/* $NetBSD: xcfb.c,v 1.16 2000/03/14 08:04:06 nisimura Exp $ */ /* * Copyright (c) 1998, 1999 Tohru Nishimura. All rights reserved. @@ -32,7 +32,7 @@ #include <sys/cdefs.h> /* RCS ID & Copyright macro defns */ -__KERNEL_RCSID(0, "$NetBSD: xcfb.c,v 1.15 2000/03/14 06:25:21 nisimura Exp $"); +__KERNEL_RCSID(0, "$NetBSD: xcfb.c,v 1.16 2000/03/14 08:04:06 nisimura Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -292,7 +292,6 @@ xcfbattach(parent, self, aux) struct xcfb_softc *sc = (struct xcfb_softc *)self; struct tc_attach_args *ta = aux; struct wsemuldisplaydev_attach_args waa; - struct hwcmap256 *cm; int console; console = (ta->ta_addr == xcfb_consaddr); @@ -308,9 +307,7 @@ xcfbattach(parent, self, aux) printf(": %d x %d, %dbpp\n", sc->sc_dc->dc_wid, sc->sc_dc->dc_ht, sc->sc_dc->dc_depth); - cm = &sc->sc_cmap; - memset(cm, 255, sizeof(struct hwcmap256)); /* XXX */ - cm->r[0] = cm->g[0] = cm->b[0] = 0; /* XXX */ + memcpy(&sc->sc_cmap, rasops_cmap, sizeof(struct hwcmap256)); sc->sc_csr = IMS332_BPP_8 | IMS332_CSR_A_VTG_ENABLE; @@ -373,9 +370,14 @@ xcfbinit(dc) IMS332_BPP_8|IMS332_CSR_A_VTG_ENABLE); /* build sane colormap */ - ims332_write_reg(IMS332_REG_LUT_BASE, 0); - for (i = 1; i < CMAP_SIZE; i++) - ims332_write_reg(IMS332_REG_LUT_BASE + i, 0xffffff); + for (i = 0; i < CMAP_SIZE; i++) { + const u_int8_t *p; + u_int32_t bgr; + + p = &rasops_cmap[3 * i]; + bgr = p[2] << 16 | p[1] << 8 | p[0]; + ims332_write_reg(IMS332_REG_LUT_BASE + i, bgr); + } /* clear out cursor image */ for (i = 0; i < 512; i++) |
