summaryrefslogtreecommitdiff
path: root/sys
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
parenta8f1e875558246527f7225e86ea65d9c3f076807 (diff)
Take advantage of rasops.updatecursor to keep the prom cursor up to date
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/sparc64/dev/creator.c32
-rw-r--r--sys/arch/sparc64/dev/creatorvar.h3
-rw-r--r--sys/arch/sparc64/dev/vgafb.c33
3 files changed, 48 insertions, 20 deletions
diff --git a/sys/arch/sparc64/dev/creator.c b/sys/arch/sparc64/dev/creator.c
index 6b912fe8528..993938b4019 100644
--- a/sys/arch/sparc64/dev/creator.c
+++ b/sys/arch/sparc64/dev/creator.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: creator.c,v 1.20 2002/07/30 19:48:15 jason Exp $ */
+/* $OpenBSD: creator.c,v 1.21 2002/08/19 20:16:04 jason Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -83,9 +83,10 @@ void creator_ras_init(struct creator_softc *);
void creator_ras_copyrows(void *, int, int, int);
void creator_ras_erasecols(void *, int, int, int, long int);
void creator_ras_eraserows(void *, int, int, long int);
-void creator_ras_do_cursor(struct rasops_info *);
+void creator_ras_updatecursor(struct rasops_info *);
void creator_ras_fill(struct creator_softc *);
void creator_ras_setfg(struct creator_softc *, int32_t);
+void creator_ras_updatecursor(struct rasops_info *);
struct wsdisplay_accessops creator_accessops = {
creator_ioctl,
@@ -159,15 +160,14 @@ creator_attach(struct creator_softc *sc)
creator_stdscreen.textops = &sc->sc_rasops.ri_ops;
if (sc->sc_console) {
- int *ccolp, *crowp;
long defattr;
- 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;
/* fix color choice */
wscol_white = 0;
@@ -177,6 +177,8 @@ creator_attach(struct creator_softc *sc)
sc->sc_rasops.ri_ops.alloc_attr(&sc->sc_rasops,
0, 0, 0, &defattr);
+ sc->sc_rasops.ri_updatecursor = creator_ras_updatecursor;
+
wsdisplay_cnattach(&creator_stdscreen, &sc->sc_rasops,
sc->sc_rasops.ri_ccol, sc->sc_rasops.ri_crow, defattr);
}
@@ -510,3 +512,15 @@ creator_ras_setfg(sc, fg)
FBC_WRITE(sc, FFB_FBC_FG, fg);
creator_ras_wait(sc);
}
+
+void
+creator_ras_updatecursor(ri)
+ struct rasops_info *ri;
+{
+ struct creator_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/arch/sparc64/dev/creatorvar.h b/sys/arch/sparc64/dev/creatorvar.h
index dca89ea09a6..b3c9ce031c9 100644
--- a/sys/arch/sparc64/dev/creatorvar.h
+++ b/sys/arch/sparc64/dev/creatorvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: creatorvar.h,v 1.6 2002/07/30 19:48:15 jason Exp $ */
+/* $OpenBSD: creatorvar.h,v 1.7 2002/08/19 20:16:04 jason Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net),
@@ -52,6 +52,7 @@ struct creator_softc {
u_int sc_mode;
struct rasops_info sc_rasops;
int32_t sc_fifo_cache, sc_fg_cache;
+ int *sc_crowp, *sc_ccolp;
};
#define FBC_WRITE(sc,r,v) \
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;
+}