summaryrefslogtreecommitdiff
path: root/sys/arch/sparc64/dev/vgafb.c
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2002-08-19 20:16:05 +0000
committerJason Wright <jason@cvs.openbsd.org>2002-08-19 20:16:05 +0000
commitb4d83f1109d682e5a806289bc2878a2fc4571bc9 (patch)
tree88f28c34026dd47224761af55f44bf93d193d787 /sys/arch/sparc64/dev/vgafb.c
parenta8f1e875558246527f7225e86ea65d9c3f076807 (diff)
Take advantage of rasops.updatecursor to keep the prom cursor up to date
Diffstat (limited to 'sys/arch/sparc64/dev/vgafb.c')
-rw-r--r--sys/arch/sparc64/dev/vgafb.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/sys/arch/sparc64/dev/vgafb.c b/sys/arch/sparc64/dev/vgafb.c
index 30710b36ecc..081b3be2a24 100644
--- a/sys/arch/sparc64/dev/vgafb.c
+++ b/sys/arch/sparc64/dev/vgafb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vgafb.c,v 1.25 2002/08/02 16:13:07 millert Exp $ */
+/* $OpenBSD: vgafb.c,v 1.26 2002/08/19 20:16:04 jason Exp $ */
/*
* Copyright (c) 2001 Jason L. Wright (jason@thought.net)
@@ -78,6 +78,7 @@ struct vgafb_softc {
u_int8_t sc_cmap_green[256];
u_int8_t sc_cmap_blue[256];
struct rasops_info sc_rasops;
+ int *sc_crowp, *sc_ccolp;
};
struct wsscreen_descr vgafb_stdscreen = {
@@ -111,7 +112,7 @@ int vgafb_getcmap(struct vgafb_softc *, struct wsdisplay_cmap *);
int vgafb_putcmap(struct vgafb_softc *, struct wsdisplay_cmap *);
void vgafb_setcolor(struct vgafb_softc *, unsigned int,
u_int8_t, u_int8_t, u_int8_t);
-
+void vgafb_updatecursor(struct rasops_info *ri);
static int a2int(char *, int);
struct wsdisplay_accessops vgafb_accessops = {
@@ -223,8 +224,6 @@ vgafbattach(parent, self, aux)
printf("\n");
if (sc->sc_console) {
- int *ccolp, *crowp;
-
sc->sc_ofhandle = OF_stdout();
if (sc->sc_depth == 8) {
@@ -239,12 +238,14 @@ vgafbattach(parent, self, aux)
vgafb_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 = vgafb_updatecursor;
+
wsdisplay_cnattach(&vgafb_stdscreen, &sc->sc_rasops,
sc->sc_rasops.ri_ccol, sc->sc_rasops.ri_crow, defattr);
}
@@ -547,3 +548,15 @@ fail:
bus_space_unmap(pa->pa_memt, sc->sc_mem_h, sc->sc_mem_size);
return (1);
}
+
+void
+vgafb_updatecursor(ri)
+ struct rasops_info *ri;
+{
+ struct vgafb_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;
+}