Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/tc Respect video console colour designation by confi...
details: https://anonhg.NetBSD.org/src/rev/ea1c412321c2
branches: trunk
changeset: 483613:ea1c412321c2
user: nisimura <nisimura%NetBSD.org@localhost>
date: Tue Mar 14 08:04:06 2000 +0000
description:
Respect video console colour designation by configration file.
diffstat:
sys/dev/tc/cfb.c | 23 ++++++++++-------------
sys/dev/tc/tfb.c | 23 ++++++++++-------------
sys/dev/tc/xcfb.c | 20 +++++++++++---------
3 files changed, 31 insertions(+), 35 deletions(-)
diffs (171 lines):
diff -r ea59735b8282 -r ea1c412321c2 sys/dev/tc/cfb.c
--- a/sys/dev/tc/cfb.c Tue Mar 14 06:25:21 2000 +0000
+++ b/sys/dev/tc/cfb.c Tue Mar 14 08:04:06 2000 +0000
@@ -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 @@
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 @@
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 @@
/* 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 -r ea59735b8282 -r ea1c412321c2 sys/dev/tc/tfb.c
--- a/sys/dev/tc/tfb.c Tue Mar 14 06:25:21 2000 +0000
+++ b/sys/dev/tc/tfb.c Tue Mar 14 08:04:06 2000 +0000
@@ -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 @@
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 @@
}
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 @@
#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 -r ea59735b8282 -r ea1c412321c2 sys/dev/tc/xcfb.c
--- a/sys/dev/tc/xcfb.c Tue Mar 14 06:25:21 2000 +0000
+++ b/sys/dev/tc/xcfb.c Tue Mar 14 08:04:06 2000 +0000
@@ -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 @@
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 @@
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 @@
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++)
Home |
Main Index |
Thread Index |
Old Index