summaryrefslogtreecommitdiff
path: root/sys/dev/sbus
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2002-08-12 16:19:00 +0000
committerJason Wright <jason@cvs.openbsd.org>2002-08-12 16:19:00 +0000
commit02a6c13f774ba2ca2a2611c08d8bc7da06ae8d8f (patch)
treecf13ae45cdc5b93e61273f22bdddc89757f1c558 /sys/dev/sbus
parent5c0d21284ecf3adc579619a2f4fa5a7a1feafa68 (diff)
Update rom cursor position if we're the console framebuffer
Diffstat (limited to 'sys/dev/sbus')
-rw-r--r--sys/dev/sbus/bwtwo.c33
-rw-r--r--sys/dev/sbus/cgsix.c32
-rw-r--r--sys/dev/sbus/cgsixreg.h3
-rw-r--r--sys/dev/sbus/cgthree.c32
4 files changed, 70 insertions, 30 deletions
diff --git a/sys/dev/sbus/bwtwo.c b/sys/dev/sbus/bwtwo.c
index 9ab07a76d29..b15bedee7bd 100644
--- a/sys/dev/sbus/bwtwo.c
+++ b/sys/dev/sbus/bwtwo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bwtwo.c,v 1.3 2002/08/06 03:48:45 jason Exp $ */
+/* $OpenBSD: bwtwo.c,v 1.4 2002/08/12 16:18:59 jason Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -130,6 +130,7 @@ struct bwtwo_softc {
int sc_width, sc_height, sc_depth, sc_linebytes;
union bt_cmap sc_cmap;
struct rasops_info sc_rasops;
+ int *sc_crowp, *sc_ccolp;
};
struct wsscreen_descr bwtwo_stdscreen = {
@@ -158,6 +159,7 @@ int bwtwo_show_screen(void *, void *, int, void (*cb)(void *, int, int),
paddr_t bwtwo_mmap(void *, off_t, int);
int bwtwo_is_console(int);
void bwtwo_burner(void *, u_int, u_int);
+void bwtwo_updatecursor(struct rasops_info *);
static int a2int(char *, int);
struct wsdisplay_accessops bwtwo_accessops = {
@@ -252,7 +254,7 @@ bwtwoattach(parent, self, aux)
sc->sc_rasops.ri_width = sc->sc_width;
sc->sc_rasops.ri_height = sc->sc_height;
sc->sc_rasops.ri_hw = sc;
-
+
rasops_init(&sc->sc_rasops,
a2int(getpropstring(optionsnode, "screen-#rows"), 34),
a2int(getpropstring(optionsnode, "screen-#columns"), 80));
@@ -265,14 +267,13 @@ bwtwoattach(parent, self, aux)
printf("\n");
if (console) {
- int *ccolp, *crowp;
-
- if (romgetcursoraddr(&crowp, &ccolp))
- ccolp = crowp = NULL;
- if (ccolp != NULL)
- sc->sc_rasops.ri_ccol = *ccolp;
- if (crowp != NULL)
- sc->sc_rasops.ri_crow = *crowp;
+ if (romgetcursoraddr(&sc->sc_crowp, &sc->sc_ccolp))
+ sc->sc_ccolp = sc->sc_crowp = NULL;
+ if (sc->sc_ccolp != NULL)
+ sc->sc_rasops.ri_ccol = *sc->sc_ccolp;
+ if (sc->sc_crowp != NULL)
+ sc->sc_rasops.ri_crow = *sc->sc_crowp;
+ sc->sc_rasops.ri_updatecursor = bwtwo_updatecursor;
wsdisplay_cnattach(&bwtwo_stdscreen, &sc->sc_rasops,
sc->sc_rasops.ri_ccol, sc->sc_rasops.ri_crow, defattr);
@@ -441,3 +442,15 @@ bwtwo_burner(vsc, on, flags)
FBC_WRITE(sc, FBC_CTRL, fbc);
splx(s);
}
+
+void
+bwtwo_updatecursor(ri)
+ struct rasops_info *ri;
+{
+ struct bwtwo_softc *sc = ri->ri_hw;
+
+ if (sc->sc_crowp != NULL)
+ *sc->sc_crowp = ri->ri_crow;
+ if (sc->sc_ccolp != NULL)
+ *sc->sc_ccolp = ri->ri_ccol;
+}
diff --git a/sys/dev/sbus/cgsix.c b/sys/dev/sbus/cgsix.c
index 4417b5f93f7..6bb853b73e6 100644
--- a/sys/dev/sbus/cgsix.c
+++ b/sys/dev/sbus/cgsix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgsix.c,v 1.29 2002/08/06 03:48:45 jason Exp $ */
+/* $OpenBSD: cgsix.c,v 1.30 2002/08/12 16:18:59 jason Exp $ */
/*
* Copyright (c) 2001 Jason L. Wright (jason@thought.net)
@@ -98,6 +98,7 @@ void cgsix_ras_copycols(void *, int, int, int, int);
void cgsix_ras_erasecols(void *, int, int, int, long int);
void cgsix_ras_eraserows(void *, int, int, long int);
void cgsix_ras_do_cursor(struct rasops_info *);
+void cgsix_ras_updatecursor(struct rasops_info *);
struct wsdisplay_accessops cgsix_accessops = {
cgsix_ioctl,
@@ -244,6 +245,7 @@ cgsixattach(parent, self, aux)
rasops_init(&sc->sc_rasops,
a2int(getpropstring(optionsnode, "screen-#rows"), 34),
a2int(getpropstring(optionsnode, "screen-#columns"), 80));
+ sc->sc_rasops.ri_hw = sc;
/*
* Old rev. cg6 cards do not like the current acceleration code.
@@ -255,7 +257,6 @@ cgsixattach(parent, self, aux)
sc->sc_dev.dv_cfdata->cf_flags &= ~CG6_CFFLAG_NOACCEL;
if ((sc->sc_dev.dv_cfdata->cf_flags & CG6_CFFLAG_NOACCEL) == 0) {
- sc->sc_rasops.ri_hw = sc;
sc->sc_rasops.ri_ops.copyrows = cgsix_ras_copyrows;
sc->sc_rasops.ri_ops.copycols = cgsix_ras_copycols;
sc->sc_rasops.ri_ops.eraserows = cgsix_ras_eraserows;
@@ -273,8 +274,6 @@ cgsixattach(parent, self, aux)
printf("\n");
if (console) {
- int *ccolp, *crowp;
-
cgsix_setcolor(sc, WSCOL_BLACK, 0, 0, 0);
cgsix_setcolor(sc, 255, 0, 0, 0);
cgsix_setcolor(sc, WSCOL_RED, 255, 0, 0);
@@ -285,12 +284,13 @@ cgsixattach(parent, self, aux)
cgsix_setcolor(sc, WSCOL_CYAN, 0, 255, 255);
cgsix_setcolor(sc, WSCOL_WHITE, 255, 255, 255);
- if (romgetcursoraddr(&crowp, &ccolp))
- ccolp = crowp = NULL;
- if (ccolp != NULL)
- sc->sc_rasops.ri_ccol = *ccolp;
- if (crowp != NULL)
- sc->sc_rasops.ri_crow = *crowp;
+ if (romgetcursoraddr(&sc->sc_crowp, &sc->sc_ccolp))
+ sc->sc_crowp = sc->sc_ccolp = NULL;
+ if (sc->sc_ccolp != NULL)
+ sc->sc_rasops.ri_ccol = *sc->sc_ccolp;
+ if (sc->sc_crowp != NULL)
+ sc->sc_rasops.ri_crow = *sc->sc_crowp;
+ sc->sc_rasops.ri_updatecursor = cgsix_ras_updatecursor;
wsdisplay_cnattach(&cgsix_stdscreen, &sc->sc_rasops,
sc->sc_rasops.ri_ccol, sc->sc_rasops.ri_crow, defattr);
@@ -973,3 +973,15 @@ cgsix_ras_do_cursor(ri)
CG6_DRAW_WAIT(sc);
CG6_DRAIN(sc);
}
+
+void
+cgsix_ras_updatecursor(ri)
+ struct rasops_info *ri;
+{
+ struct cgsix_softc *sc = ri->ri_hw;
+
+ if (sc->sc_crowp != NULL)
+ *sc->sc_crowp = ri->ri_crow;
+ if (sc->sc_ccolp != NULL)
+ *sc->sc_ccolp = ri->ri_ccol;
+}
diff --git a/sys/dev/sbus/cgsixreg.h b/sys/dev/sbus/cgsixreg.h
index 226b9e196bc..1e415cc1f40 100644
--- a/sys/dev/sbus/cgsixreg.h
+++ b/sys/dev/sbus/cgsixreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgsixreg.h,v 1.3 2002/07/30 23:03:30 jason Exp $ */
+/* $OpenBSD: cgsixreg.h,v 1.4 2002/08/12 16:18:59 jason Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -221,6 +221,7 @@ struct cgsix_softc {
union bt_cmap sc_cmap;
void *sc_ih;
u_int sc_mode;
+ int *sc_crowp, *sc_ccolp;
};
#define CG6_USER_FBC 0x70000000
diff --git a/sys/dev/sbus/cgthree.c b/sys/dev/sbus/cgthree.c
index 00dc7cfbd0e..991e6ee9ece 100644
--- a/sys/dev/sbus/cgthree.c
+++ b/sys/dev/sbus/cgthree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgthree.c,v 1.22 2002/08/06 03:48:45 jason Exp $ */
+/* $OpenBSD: cgthree.c,v 1.23 2002/08/12 16:18:59 jason Exp $ */
/*
* Copyright (c) 2001 Jason L. Wright (jason@thought.net)
@@ -131,6 +131,7 @@ struct cgthree_softc {
union bt_cmap sc_cmap;
struct rasops_info sc_rasops;
u_int sc_mode;
+ int *sc_crowp, *sc_ccolp;
};
struct wsscreen_descr cgthree_stdscreen = {
@@ -165,6 +166,7 @@ void cgthree_setcolor(struct cgthree_softc *, u_int,
u_int8_t, u_int8_t, u_int8_t);
void cgthree_burner(void *, u_int, u_int);
void cgthree_reset(struct cgthree_softc *);
+void cgthree_updatecursor(struct rasops_info *);
static int a2int(char *, int);
struct wsdisplay_accessops cgthree_accessops = {
@@ -304,12 +306,11 @@ cgthreeattach(parent, self, aux)
cgthree_stdscreen.textops = &sc->sc_rasops.ri_ops;
sc->sc_rasops.ri_ops.alloc_attr(&sc->sc_rasops,
WSCOL_BLACK, WSCOL_WHITE, WSATTR_WSCOLORS, &defattr);
+ sc->sc_rasops.ri_hw = sc;
printf("\n");
if (console) {
- int *ccolp, *crowp;
-
cgthree_setcolor(sc, WSCOL_BLACK, 0, 0, 0);
cgthree_setcolor(sc, 255, 0, 0, 0);
cgthree_setcolor(sc, WSCOL_RED, 255, 0, 0);
@@ -320,12 +321,13 @@ cgthreeattach(parent, self, aux)
cgthree_setcolor(sc, WSCOL_CYAN, 0, 255, 255);
cgthree_setcolor(sc, WSCOL_WHITE, 255, 255, 255);
- if (romgetcursoraddr(&crowp, &ccolp))
- ccolp = crowp = NULL;
- if (ccolp != NULL)
- sc->sc_rasops.ri_ccol = *ccolp;
- if (crowp != NULL)
- sc->sc_rasops.ri_crow = *crowp;
+ if (romgetcursoraddr(&sc->sc_crowp, &sc->sc_ccolp))
+ sc->sc_ccolp = sc->sc_crowp = NULL;
+ if (sc->sc_ccolp != NULL)
+ sc->sc_rasops.ri_ccol = *sc->sc_ccolp;
+ if (sc->sc_crowp != NULL)
+ sc->sc_rasops.ri_crow = *sc->sc_crowp;
+ sc->sc_rasops.ri_updatecursor = cgthree_updatecursor;
wsdisplay_cnattach(&cgthree_stdscreen, &sc->sc_rasops,
sc->sc_rasops.ri_ccol, sc->sc_rasops.ri_crow, defattr);
@@ -656,3 +658,15 @@ cgthree_burner(vsc, on, flags)
FBC_WRITE(sc, CG3_FBC_CTRL, fbc);
splx(s);
}
+
+void
+cgthree_updatecursor(ri)
+ struct rasops_info *ri;
+{
+ struct cgthree_softc *sc = ri->ri_hw;
+
+ if (sc->sc_crowp != NULL)
+ *sc->sc_crowp = ri->ri_crow;
+ if (sc->sc_ccolp != NULL)
+ *sc->sc_ccolp = ri->ri_ccol;
+}