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 /sys/arch/sparc64/dev/fb.c | |
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.
Diffstat (limited to 'sys/arch/sparc64/dev/fb.c')
-rw-r--r-- | sys/arch/sparc64/dev/fb.c | 28 |
1 files changed, 23 insertions, 5 deletions
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. */ |