summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2002-02-23 05:47:51 +0000
committerJason Wright <jason@cvs.openbsd.org>2002-02-23 05:47:51 +0000
commitb3bce9ac7b592613c0472f2f54c657dc9b79ba53 (patch)
tree37fa44c666f5abb96bd42a1720d44d1b452d87dd
parent074e26c28bf9181c2db6d1974d743d225bef9798 (diff)
Add burner function so wscons can blank the fb
-rw-r--r--sys/dev/sbus/cgsix.c28
-rw-r--r--sys/dev/sbus/cgthree.c24
2 files changed, 31 insertions, 21 deletions
diff --git a/sys/dev/sbus/cgsix.c b/sys/dev/sbus/cgsix.c
index 26cd400f33a..5323c2f709b 100644
--- a/sys/dev/sbus/cgsix.c
+++ b/sys/dev/sbus/cgsix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgsix.c,v 1.11 2002/02/07 16:39:48 jason Exp $ */
+/* $OpenBSD: cgsix.c,v 1.12 2002/02/23 05:47:50 jason Exp $ */
/*
* Copyright (c) 2001 Jason L. Wright (jason@thought.net)
@@ -233,8 +233,7 @@ void cgsix_setcolor __P((struct cgsix_softc *, u_int,
u_int8_t, u_int8_t, u_int8_t));
void cgsix_reset __P((struct cgsix_softc *));
void cgsix_hardreset __P((struct cgsix_softc *));
-void cgsix_blank __P((struct cgsix_softc *, int));
-
+void cgsix_burner __P((void *, u_int, u_int));
static int a2int __P((char *, int));
struct wsdisplay_accessops cgsix_accessops = {
@@ -243,7 +242,10 @@ struct wsdisplay_accessops cgsix_accessops = {
cgsix_alloc_screen,
cgsix_free_screen,
cgsix_show_screen,
- 0 /* load_font */
+ NULL, /* load_font */
+ NULL, /* scrollback */
+ NULL, /* getchar */
+ cgsix_burner,
};
int cgsixmatch __P((struct device *, void *, void *));
@@ -341,7 +343,7 @@ cgsixattach(parent, self, aux)
sc->sc_cmap.cm_map[i][2] = BT_READ(sc, BT_CMAP) >> 24;
}
- cgsix_blank(sc, 0);
+ cgsix_burner(sc, 0, 0);
sc->sc_depth = getpropint(sa->sa_node, "depth", 8);
sc->sc_linebytes = getpropint(sa->sa_node, "linebytes", 1152);
@@ -730,19 +732,23 @@ cgsix_hardreset(sc)
}
void
-cgsix_blank(sc, blank)
- struct cgsix_softc *sc;
- int blank;
+cgsix_burner(vsc, on, flags)
+ void *vsc;
+ u_int on, flags;
{
+ struct cgsix_softc *sc = vsc;
int s;
u_int32_t thcm;
s = splhigh();
thcm = THC_READ(sc, CG6_THC_MISC);
- if (blank)
- thcm &= ~(THC_MISC_VIDEN | THC_MISC_SYNCEN);
- else
+ if (!on)
thcm |= THC_MISC_VIDEN | THC_MISC_SYNCEN;
+ else {
+ thcm &= ~THC_MISC_VIDEN;
+ if (flags & WSDISPLAY_BURN_VBLANK)
+ thcm &= ~THC_MISC_SYNCEN;
+ }
THC_WRITE(sc, CG6_THC_MISC, thcm);
splx(s);
}
diff --git a/sys/dev/sbus/cgthree.c b/sys/dev/sbus/cgthree.c
index c1ec4d7f772..86945ff20b7 100644
--- a/sys/dev/sbus/cgthree.c
+++ b/sys/dev/sbus/cgthree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgthree.c,v 1.8 2002/02/07 04:48:15 jason Exp $ */
+/* $OpenBSD: cgthree.c,v 1.9 2002/02/23 05:47:50 jason Exp $ */
/*
* Copyright (c) 2001 Jason L. Wright (jason@thought.net)
@@ -169,7 +169,7 @@ int cg3_bt_putcmap __P((union bt_cmap *, struct wsdisplay_cmap *));
int cg3_bt_getcmap __P((union bt_cmap *, struct wsdisplay_cmap *));
void cgthree_setcolor __P((struct cgthree_softc *, u_int,
u_int8_t, u_int8_t, u_int8_t));
-void cgthree_blank __P((struct cgthree_softc *, int));
+void cgthree_burner __P((void *, u_int, u_int));
void cgthree_reset __P((struct cgthree_softc *));
static int a2int __P((char *, int));
@@ -179,7 +179,10 @@ struct wsdisplay_accessops cgthree_accessops = {
cgthree_alloc_screen,
cgthree_free_screen,
cgthree_show_screen,
- 0 /* load_font */
+ NULL, /* load_font */
+ NULL, /* scrollback */
+ NULL, /* getchar */
+ cgthree_burner,
};
int cgthreematch __P((struct device *, void *, void *));
@@ -286,7 +289,7 @@ cgthreeattach(parent, self, aux)
for (i = 0; i < 256 * 3 / 4; i++)
sc->sc_cmap.cm_chip[i] = BT_READ(sc, BT_CMAP);
- cgthree_blank(sc, 0);
+ cgthree_burner(sc, 0, 0);
sc->sc_rcons.rc_sp = &sc->sc_raster;
sc->sc_raster.width = sc->sc_width;
@@ -620,19 +623,20 @@ cgthree_reset(sc)
}
void
-cgthree_blank(sc, blank)
- struct cgthree_softc *sc;
- int blank;
+cgthree_burner(vsc, on, flags)
+ void *vsc;
+ u_int on, flags;
{
+ struct cgthree_softc *sc = vsc;
int s;
u_int32_t fbc;
s = splhigh();
fbc = FBC_READ(sc, CG3_FBC_CTRL);
- if (blank)
- fbc &= ~FBC_CTRL_VENAB;
- else
+ if (!on)
fbc |= FBC_CTRL_VENAB;
+ else
+ fbc &= ~FBC_CTRL_VENAB;
FBC_WRITE(sc, CG3_FBC_CTRL, fbc);
splx(s);
}