diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2005-03-15 18:40:18 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2005-03-15 18:40:18 +0000 |
commit | 9ff521fa82ed0cb58d169bbe3cdc21b0ba9051c4 (patch) | |
tree | 8627b05f1227caa70f0203386bf67205eacd8d55 | |
parent | 21a609c63ad15a12cd0ec640ee378bf1529aeb42 (diff) |
Take care of updating the PROMs view of the cursor position in the common fb
code, rather than doing this in only a subset of the fb drivers.
-rw-r--r-- | sys/arch/sparc/dev/fb.c | 22 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/creator.c | 16 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/fb.c | 28 | ||||
-rw-r--r-- | sys/arch/sparc64/dev/vgafb.c | 16 | ||||
-rw-r--r-- | sys/dev/sbus/bwtwo.c | 16 | ||||
-rw-r--r-- | sys/dev/sbus/cgsix.c | 15 | ||||
-rw-r--r-- | sys/dev/sbus/cgthree.c | 15 |
7 files changed, 48 insertions, 80 deletions
diff --git a/sys/arch/sparc/dev/fb.c b/sys/arch/sparc/dev/fb.c index 306a6e3b36a..c323338b8a2 100644 --- a/sys/arch/sparc/dev/fb.c +++ b/sys/arch/sparc/dev/fb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fb.c,v 1.32 2005/03/07 16:44:50 miod Exp $ */ +/* $OpenBSD: fb.c,v 1.33 2005/03/15 18:40:12 miod Exp $ */ /* $NetBSD: fb.c,v 1.23 1997/07/07 23:30:22 pk Exp $ */ /* @@ -84,7 +84,6 @@ #endif #include <dev/wscons/wsdisplayvar.h> -#include <dev/wscons/wscons_raster.h> #include <dev/rasops/rasops.h> #include <machine/fbvar.h> @@ -111,6 +110,7 @@ fb_unblank() static int a2int(char *, int); #endif static void fb_initwsd(struct sunfb *); +static void fb_updatecursor(struct rasops_info *); void fb_setsize(struct sunfb *sf, int def_depth, int def_width, int def_height, @@ -311,6 +311,17 @@ fb_initwsd(struct sunfb *sf) sf->sf_wsd.textops = &sf->sf_ro.ri_ops; } +static void +fb_updatecursor(struct rasops_info *ri) +{ + struct sunfb *sf = (struct sunfb *)ri->ri_hw; + + if (sf->sf_crowp != NULL) + *sf->sf_crowp = ri->ri_crow; + if (sf->sf_ccolp != NULL) + *sf->sf_ccolp = ri->ri_ccol; +} + void fbwscons_init(struct sunfb *sf, int flags) { @@ -389,6 +400,13 @@ fbwscons_console_init(struct sunfb *sf, int row) sf->sf_ro.ri_ccol = sf->sf_ro.ri_cols - 1; /* + * Take care of updating the PROM cursor position as well if we can. + */ + if (sf->sf_ro.ri_updatecursor == NULL && + (sf->sf_ccolp != NULL || sf->sf_crowp != NULL)) + sf->sf_ro.ri_updatecursor = fb_updatecursor; + + /* * Select appropriate color settings to mimic a * black on white Sun console. */ diff --git a/sys/arch/sparc64/dev/creator.c b/sys/arch/sparc64/dev/creator.c index aa234a112ae..03172058173 100644 --- a/sys/arch/sparc64/dev/creator.c +++ b/sys/arch/sparc64/dev/creator.c @@ -1,4 +1,4 @@ -/* $OpenBSD: creator.c,v 1.32 2005/03/07 16:44:52 miod Exp $ */ +/* $OpenBSD: creator.c,v 1.33 2005/03/15 18:40:15 miod Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -60,7 +60,6 @@ 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_updatecursor(struct rasops_info *); void creator_ras_fill(struct creator_softc *); void creator_ras_setfg(struct creator_softc *, int32_t); int creator_setcursor(struct creator_softc *, struct wsdisplay_cursor *); @@ -137,7 +136,6 @@ creator_attach(struct creator_softc *sc) } if (sc->sc_console) { - sc->sc_sunfb.sf_ro.ri_updatecursor = creator_ras_updatecursor; fbwscons_console_init(&sc->sc_sunfb, -1); } @@ -674,15 +672,3 @@ 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_sunfb.sf_crowp != NULL) - *sc->sc_sunfb.sf_crowp = ri->ri_crow; - if (sc->sc_sunfb.sf_ccolp != NULL) - *sc->sc_sunfb.sf_ccolp = ri->ri_ccol; -} diff --git a/sys/arch/sparc64/dev/fb.c b/sys/arch/sparc64/dev/fb.c index 90bd0f806f7..5601b299f85 100644 --- a/sys/arch/sparc64/dev/fb.c +++ b/sys/arch/sparc64/dev/fb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fb.c,v 1.7 2005/03/07 16:44:52 miod Exp $ */ +/* $OpenBSD: fb.c,v 1.8 2005/03/15 18:40:15 miod Exp $ */ /* $NetBSD: fb.c,v 1.23 1997/07/07 23:30:22 pk Exp $ */ /* @@ -80,15 +80,11 @@ #include <machine/conf.h> #include <dev/wscons/wsdisplayvar.h> -#include <dev/wscons/wscons_raster.h> #include <dev/rasops/rasops.h> #include <machine/fbvar.h> #include "wsdisplay.h" -static int a2int(char *, int); -static void fb_initwsd(struct sunfb *); - /* * emergency unblank code * XXX should be somewhat moved to wscons MI code @@ -106,6 +102,10 @@ fb_unblank() #if NWSDISPLAY > 0 +static int a2int(char *, int); +static void fb_initwsd(struct sunfb *); +static void fb_updatecursor(struct rasops_info *); + void fb_setsize(struct sunfb *sf, int def_depth, int def_width, int def_height, int node, int unused) @@ -155,6 +155,17 @@ fb_initwsd(struct sunfb *sf) sf->sf_wsd.textops = &sf->sf_ro.ri_ops; } +static void +fb_updatecursor(struct rasops_info *ri) +{ + struct sunfb *sf = (struct sunfb *)ri->ri_hw; + + if (sf->sf_crowp != NULL) + *sf->sf_crowp = ri->ri_crow; + if (sf->sf_ccolp != NULL) + *sf->sf_ccolp = ri->ri_ccol; +} + void fbwscons_init(struct sunfb *sf, int flags) { @@ -211,6 +222,13 @@ fbwscons_console_init(struct sunfb *sf, int row) sf->sf_ro.ri_ccol = sf->sf_ro.ri_cols - 1; /* + * Take care of updating the PROM cursor position as weel if we can. + */ + if (sf->sf_ro.ri_updatecursor != NULL && + (sf->sf_ccolp != NULL || sf->sf_crowp != NULL)) + sf->sf_ro.ri_updatecursor = fb_updatecursor; + + /* * Select appropriate color settings to mimic a * black on white Sun console. */ diff --git a/sys/arch/sparc64/dev/vgafb.c b/sys/arch/sparc64/dev/vgafb.c index 6bc930a5d84..4d560d3f6d7 100644 --- a/sys/arch/sparc64/dev/vgafb.c +++ b/sys/arch/sparc64/dev/vgafb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vgafb.c,v 1.39 2005/03/07 16:44:52 miod Exp $ */ +/* $OpenBSD: vgafb.c,v 1.40 2005/03/15 18:40:15 miod Exp $ */ /* * Copyright (c) 2001 Jason L. Wright (jason@thought.net) @@ -88,7 +88,6 @@ int vgafb_is_console(int); int vgafb_getcmap(struct vgafb_softc *, struct wsdisplay_cmap *); int vgafb_putcmap(struct vgafb_softc *, struct wsdisplay_cmap *); void vgafb_setcolor(void *, u_int, u_int8_t, u_int8_t, u_int8_t); -void vgafb_updatecursor(struct rasops_info *ri); struct wsdisplay_accessops vgafb_accessops = { vgafb_ioctl, @@ -171,7 +170,6 @@ vgafbattach(parent, self, aux) if (sc->sc_console) { sc->sc_ofhandle = OF_stdout(); fbwscons_setcolormap(&sc->sc_sunfb, vgafb_setcolor); - sc->sc_sunfb.sf_ro.ri_updatecursor = vgafb_updatecursor; fbwscons_console_init(&sc->sc_sunfb, -1); } else { /* sc->sc_ofhandle = XXX */ @@ -465,15 +463,3 @@ 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; -} diff --git a/sys/dev/sbus/bwtwo.c b/sys/dev/sbus/bwtwo.c index a8cd63d6b39..70d4843318c 100644 --- a/sys/dev/sbus/bwtwo.c +++ b/sys/dev/sbus/bwtwo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bwtwo.c,v 1.14 2005/03/07 16:44:52 miod Exp $ */ +/* $OpenBSD: bwtwo.c,v 1.15 2005/03/15 18:40:16 miod Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -114,7 +114,6 @@ 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 *); struct wsdisplay_accessops bwtwo_accessops = { bwtwo_ioctl, @@ -208,7 +207,6 @@ bwtwoattach(parent, self, aux) fbwscons_init(&sc->sc_sunfb, console ? 0 : RI_CLEAR); if (console) { - sc->sc_sunfb.sf_ro.ri_updatecursor = bwtwo_updatecursor; fbwscons_console_init(&sc->sc_sunfb, -1); } @@ -363,15 +361,3 @@ 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_sunfb.sf_crowp != NULL) - *sc->sc_sunfb.sf_crowp = ri->ri_crow; - if (sc->sc_sunfb.sf_ccolp != NULL) - *sc->sc_sunfb.sf_ccolp = ri->ri_ccol; -} diff --git a/sys/dev/sbus/cgsix.c b/sys/dev/sbus/cgsix.c index b437e1df9ac..b9feb0f2e93 100644 --- a/sys/dev/sbus/cgsix.c +++ b/sys/dev/sbus/cgsix.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cgsix.c,v 1.51 2005/03/08 21:35:03 miod Exp $ */ +/* $OpenBSD: cgsix.c,v 1.52 2005/03/15 18:40:16 miod Exp $ */ /* * Copyright (c) 2001 Jason L. Wright (jason@thought.net) @@ -76,7 +76,6 @@ 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 *); int cgsix_setcursor(struct cgsix_softc *, struct wsdisplay_cursor *); int cgsix_updatecursor(struct cgsix_softc *, u_int); @@ -241,7 +240,6 @@ cgsixattach(struct device *parent, struct device *self, void *aux) fbwscons_setcolormap(&sc->sc_sunfb, cgsix_setcolor); if (console) { - sc->sc_sunfb.sf_ro.ri_updatecursor = cgsix_ras_updatecursor; fbwscons_console_init(&sc->sc_sunfb, -1); } @@ -1053,14 +1051,3 @@ cgsix_ras_do_cursor(struct rasops_info *ri) CG6_DRAW_WAIT(sc); CG6_DRAIN(sc); } - -void -cgsix_ras_updatecursor(struct rasops_info *ri) -{ - struct cgsix_softc *sc = ri->ri_hw; - - if (sc->sc_sunfb.sf_crowp != NULL) - *sc->sc_sunfb.sf_crowp = ri->ri_crow; - if (sc->sc_sunfb.sf_ccolp != NULL) - *sc->sc_sunfb.sf_ccolp = ri->ri_ccol; -} diff --git a/sys/dev/sbus/cgthree.c b/sys/dev/sbus/cgthree.c index 7af2d121778..b94fcc4ab53 100644 --- a/sys/dev/sbus/cgthree.c +++ b/sys/dev/sbus/cgthree.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cgthree.c,v 1.39 2005/03/07 16:44:52 miod Exp $ */ +/* $OpenBSD: cgthree.c,v 1.40 2005/03/15 18:40:17 miod Exp $ */ /* * Copyright (c) 2001 Jason L. Wright (jason@thought.net) @@ -143,7 +143,6 @@ int cg3_bt_getcmap(union bt_cmap *, struct wsdisplay_cmap *); void cgthree_setcolor(void *, 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 *); struct wsdisplay_accessops cgthree_accessops = { cgthree_ioctl, @@ -284,7 +283,6 @@ cgthreeattach(struct device *parent, struct device *self, void *aux) fbwscons_setcolormap(&sc->sc_sunfb, cgthree_setcolor); if (console) { - sc->sc_sunfb.sf_ro.ri_updatecursor = cgthree_updatecursor; fbwscons_console_init(&sc->sc_sunfb, sc->sc_sunfb.sf_width >= 1024 ? -1 : 0); } @@ -579,14 +577,3 @@ cgthree_burner(void *vsc, u_int on, u_int flags) FBC_WRITE(sc, CG3_FBC_CTRL, fbc); splx(s); } - -void -cgthree_updatecursor(struct rasops_info *ri) -{ - struct cgthree_softc *sc = ri->ri_hw; - - if (sc->sc_sunfb.sf_crowp != NULL) - *sc->sc_sunfb.sf_crowp = ri->ri_crow; - if (sc->sc_sunfb.sf_ccolp != NULL) - *sc->sc_sunfb.sf_ccolp = ri->ri_ccol; -} |