diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-07-25 21:23:33 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-07-25 21:23:33 +0000 |
commit | 18714f8a7b3ff37ea2c79d98f63cdaa23f920a81 (patch) | |
tree | 7f9f1458f0d218575d9c907d44ca48a79d3ab099 | |
parent | 495c71bb13aeb85b37821a81b3a1eaea9fa5a728 (diff) |
Do not bother reading the existing colormap on attach, since we will
override it with the rasops one.
-rw-r--r-- | sys/arch/sparc/dev/cgeight.c | 11 | ||||
-rw-r--r-- | sys/arch/sparc/dev/cgfour.c | 11 | ||||
-rw-r--r-- | sys/arch/sparc/dev/cgsix.c | 12 | ||||
-rw-r--r-- | sys/arch/sparc/dev/cgthree.c | 9 | ||||
-rw-r--r-- | sys/arch/sparc/dev/tcx.c | 10 | ||||
-rw-r--r-- | sys/dev/sbus/cgsix.c | 14 | ||||
-rw-r--r-- | sys/dev/sbus/cgthree.c | 9 |
7 files changed, 18 insertions, 58 deletions
diff --git a/sys/arch/sparc/dev/cgeight.c b/sys/arch/sparc/dev/cgeight.c index 3cb06994848..6420c2a6b06 100644 --- a/sys/arch/sparc/dev/cgeight.c +++ b/sys/arch/sparc/dev/cgeight.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cgeight.c,v 1.25 2005/03/23 17:16:34 miod Exp $ */ +/* $OpenBSD: cgeight.c,v 1.26 2006/07/25 21:23:30 miod Exp $ */ /* $NetBSD: cgeight.c,v 1.13 1997/05/24 20:16:04 pk Exp $ */ /* @@ -154,7 +154,7 @@ cgeightattach(struct device *parent, struct device *self, void *args) { struct cgeight_softc *sc = (struct cgeight_softc *)self; struct confargs *ca = args; - int node = 0, i; + int node = 0; volatile struct bt_regs *bt; int isconsole = 0; @@ -182,14 +182,9 @@ cgeightattach(struct device *parent, struct device *self, void *args) sc->sc_phys = ca->ca_ra.ra_reg[0]; - /* grab initial (current) color map */ - bt = &sc->sc_fbc->fbc_dac; - bt->bt_addr = 0; - for (i = 0; i < 256 * 3 / 4; i++) - sc->sc_cmap.cm_chip[i] = bt->bt_cmap; - /* enable video */ fb_pfour_burner(sc, 1, 0); + bt = &sc->sc_fbc->fbc_dac; BT_INIT(bt, 0); fb_setsize(&sc->sc_sunfb, 24, 1152, 900, node, ca->ca_bustype); diff --git a/sys/arch/sparc/dev/cgfour.c b/sys/arch/sparc/dev/cgfour.c index c263608affa..e1701d2d5fc 100644 --- a/sys/arch/sparc/dev/cgfour.c +++ b/sys/arch/sparc/dev/cgfour.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cgfour.c,v 1.25 2005/03/23 17:16:34 miod Exp $ */ +/* $OpenBSD: cgfour.c,v 1.26 2006/07/25 21:23:30 miod Exp $ */ /* $NetBSD: cgfour.c,v 1.13 1997/05/24 20:16:06 pk Exp $ */ /* @@ -151,7 +151,7 @@ cgfourattach(struct device *parent, struct device *self, void *args) { struct cgfour_softc *sc = (struct cgfour_softc *)self; struct confargs *ca = args; - int node = 0, i; + int node = 0; volatile struct bt_regs *bt; int isconsole = 0; @@ -183,14 +183,9 @@ cgfourattach(struct device *parent, struct device *self, void *args) sc->sc_phys = ca->ca_ra.ra_reg[0]; - /* grab initial (current) color map */ - bt = &sc->sc_fbc->fbc_dac; - bt->bt_addr = 0; - for (i = 0; i < 256 * 3 / 4; i++) - ((char *)&sc->sc_cmap)[i] = bt->bt_cmap >> 24; - /* enable video */ fb_pfour_burner(sc, 1, 0); + bt = &sc->sc_fbc->fbc_dac; BT_INIT(bt, 24); /* diff --git a/sys/arch/sparc/dev/cgsix.c b/sys/arch/sparc/dev/cgsix.c index 0243ee3b05c..8257445aacb 100644 --- a/sys/arch/sparc/dev/cgsix.c +++ b/sys/arch/sparc/dev/cgsix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cgsix.c,v 1.34 2006/06/02 20:00:54 miod Exp $ */ +/* $OpenBSD: cgsix.c,v 1.35 2006/07/25 21:23:30 miod Exp $ */ /* $NetBSD: cgsix.c,v 1.33 1997/08/07 19:12:30 pk Exp $ */ /* @@ -209,8 +209,7 @@ cgsixattach(struct device *parent, struct device *self, void *args) { struct cgsix_softc *sc = (struct cgsix_softc *)self; struct confargs *ca = args; - int node = 0, i; - volatile struct bt_regs *bt; + int node = 0; int isconsole = 0, sbus = 1; char *nam = NULL; u_int fhcrev; @@ -221,7 +220,7 @@ cgsixattach(struct device *parent, struct device *self, void *args) * Map just BT, FHC, FBC, THC, and video RAM. */ sc->sc_phys = ca->ca_ra.ra_reg[0]; - sc->sc_bt = bt = (volatile struct bt_regs *) + sc->sc_bt = (volatile struct bt_regs *) mapiodev(ca->ca_ra.ra_reg, CGSIX_BT_OFFSET, CGSIX_BT_SIZE); sc->sc_fhc = (volatile int *) mapiodev(ca->ca_ra.ra_reg, CGSIX_FHC_OFFSET, CGSIX_FHC_SIZE); @@ -295,11 +294,6 @@ cgsixattach(struct device *parent, struct device *self, void *args) /* reset cursor & frame buffer controls */ cgsix_reset(sc, fhcrev); - /* grab initial (current) color map */ - bt->bt_addr = 0; - for (i = 0; i < 256 * 3; i++) - ((char *)&sc->sc_cmap)[i] = bt->bt_cmap >> 24; - /* enable video */ cgsix_burner(sc, 1, 0); diff --git a/sys/arch/sparc/dev/cgthree.c b/sys/arch/sparc/dev/cgthree.c index 225eba75afd..2bf62f66ce0 100644 --- a/sys/arch/sparc/dev/cgthree.c +++ b/sys/arch/sparc/dev/cgthree.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cgthree.c,v 1.30 2006/06/02 20:00:54 miod Exp $ */ +/* $OpenBSD: cgthree.c,v 1.31 2006/07/25 21:23:30 miod Exp $ */ /* $NetBSD: cgthree.c,v 1.33 1997/05/24 20:16:11 pk Exp $ */ /* @@ -259,14 +259,9 @@ cgthreeattach(struct device *parent, struct device *self, void *args) intr_establish(ca->ca_ra.ra_intr[0].int_pri, &sc->sc_ih, IPL_FB, self->dv_xname); - /* grab initial (current) color map */ - bt = &sc->sc_fbc->fbc_dac; - bt->bt_addr = 0; - for (i = 0; i < 256 * 3 / 4; i++) - sc->sc_cmap.cm_chip[i] = bt->bt_cmap; - /* enable video */ cgthree_burner(sc, 1, 0); + bt = &sc->sc_fbc->fbc_dac; BT_INIT(bt, 0); fb_setsize(&sc->sc_sunfb, 8, 1152, 900, node, ca->ca_bustype); diff --git a/sys/arch/sparc/dev/tcx.c b/sys/arch/sparc/dev/tcx.c index 55fd3dd4d1b..ded77838864 100644 --- a/sys/arch/sparc/dev/tcx.c +++ b/sys/arch/sparc/dev/tcx.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tcx.c,v 1.27 2006/06/02 20:00:54 miod Exp $ */ +/* $OpenBSD: tcx.c,v 1.28 2006/07/25 21:23:30 miod Exp $ */ /* $NetBSD: tcx.c,v 1.8 1997/07/29 09:58:14 fair Exp $ */ /* @@ -177,7 +177,6 @@ tcxattach(struct device *parent, struct device *self, void *args) struct tcx_softc *sc = (struct tcx_softc *)self; struct confargs *ca = args; int node = 0, i; - volatile struct bt_regs *bt; int isconsole = 0; char *nam = NULL; @@ -193,7 +192,7 @@ tcxattach(struct device *parent, struct device *self, void *args) for (i = 0; i < TCX_NREG; i++) sc->sc_phys[i] = ca->ca_ra.ra_reg[i]; - sc->sc_bt = bt = (volatile struct bt_regs *) + sc->sc_bt = (volatile struct bt_regs *) mapiodev(&ca->ca_ra.ra_reg[TCX_REG_CMAP], 0, sizeof *sc->sc_bt); sc->sc_thc = (volatile struct tcx_thc *) mapiodev(&ca->ca_ra.ra_reg[TCX_REG_THC], @@ -222,11 +221,6 @@ tcxattach(struct device *parent, struct device *self, void *args) sc->sc_sunfb.sf_depth = 0; /* force action */ tcx_reset(sc, 8); - /* grab initial (current) color map */ - bt->bt_addr = 0; - for (i = 0; i < 256 * 3; i++) - ((char *)&sc->sc_cmap)[i] = bt->bt_cmap >> 24; - /* enable video */ tcx_burner(sc, 1, 0); diff --git a/sys/dev/sbus/cgsix.c b/sys/dev/sbus/cgsix.c index 3821e8979c1..6480897f328 100644 --- a/sys/dev/sbus/cgsix.c +++ b/sys/dev/sbus/cgsix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cgsix.c,v 1.53 2006/06/02 20:00:56 miod Exp $ */ +/* $OpenBSD: cgsix.c,v 1.54 2006/07/25 21:23:32 miod Exp $ */ /* * Copyright (c) 2001 Jason L. Wright (jason@thought.net) @@ -116,7 +116,7 @@ cgsixattach(struct device *parent, struct device *self, void *aux) { struct cgsix_softc *sc = (struct cgsix_softc *)self; struct sbus_attach_args *sa = aux; - int node, console, i; + int node, console; u_int32_t fhc, rev; const char *nam; @@ -198,14 +198,6 @@ cgsixattach(struct device *parent, struct device *self, void *aux) rev = (fhc & FHC_REV_MASK) >> FHC_REV_SHIFT; cgsix_reset(sc, rev); - /* grab the current palette */ - BT_WRITE(sc, BT_ADDR, 0); - for (i = 0; i < 256; i++) { - sc->sc_cmap.cm_map[i][0] = BT_READ(sc, BT_CMAP) >> 24; - sc->sc_cmap.cm_map[i][1] = BT_READ(sc, BT_CMAP) >> 24; - sc->sc_cmap.cm_map[i][2] = BT_READ(sc, BT_CMAP) >> 24; - } - cgsix_burner(sc, 1, 0); sc->sc_sunfb.sf_ro.ri_bits = (void *)bus_space_vaddr(sc->sc_bustag, @@ -257,7 +249,7 @@ fail_fhc: bus_space_unmap(sa->sa_bustag, sc->sc_bt_regs, CGSIX_BT_SIZE); fail_bt: fail: -; + return; } int diff --git a/sys/dev/sbus/cgthree.c b/sys/dev/sbus/cgthree.c index 9f623915573..0d387f639d7 100644 --- a/sys/dev/sbus/cgthree.c +++ b/sys/dev/sbus/cgthree.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cgthree.c,v 1.41 2006/06/02 20:00:56 miod Exp $ */ +/* $OpenBSD: cgthree.c,v 1.42 2006/07/25 21:23:32 miod Exp $ */ /* * Copyright (c) 2001 Jason L. Wright (jason@thought.net) @@ -209,7 +209,7 @@ cgthreeattach(struct device *parent, struct device *self, void *aux) { struct cgthree_softc *sc = (struct cgthree_softc *)self; struct sbus_attach_args *sa = aux; - int node, console, i; + int node, console; const char *nam; node = sa->sa_node; @@ -249,11 +249,6 @@ cgthreeattach(struct device *parent, struct device *self, void *aux) console = cgthree_is_console(node); cgthree_reset(sc); - - BT_WRITE(sc, BT_ADDR, 0); - for (i = 0; i < 256 * 3 / 4; i++) - sc->sc_cmap.cm_chip[i] = BT_READ(sc, BT_CMAP); - cgthree_burner(sc, 1, 0); sc->sc_sunfb.sf_ro.ri_bits = (void *)bus_space_vaddr(sc->sc_bustag, |