summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/dev/zx.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-11-29 22:07:42 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-11-29 22:07:42 +0000
commitcefdf5e62eae54a4c575c27947ca681a438ade33 (patch)
treef6057fe704b1e777395bda6ae431013303d9ffe7 /sys/arch/sparc/dev/zx.c
parent0ade68e7821ecaff132d0ec95dd118093bff8605 (diff)
Move the struct wsscreen_descr from a per-driver global to a per-instance
field of the sunfb structure. This allows multiple instances of the same driver, but with different resolutions (such as a couple of vigra or a TGX cgsix and a TGX+ cgsix) to use distinct wsscreen_descr structures featuring different resolution information. Doing this allows more wsscreen_descr fiddling inside the sparc* fb api, and results in some code shrinkage (about 4KB on sparc GENERIC).
Diffstat (limited to 'sys/arch/sparc/dev/zx.c')
-rw-r--r--sys/arch/sparc/dev/zx.c30
1 files changed, 3 insertions, 27 deletions
diff --git a/sys/arch/sparc/dev/zx.c b/sys/arch/sparc/dev/zx.c
index 362f34a502d..8f5a3e3c5ab 100644
--- a/sys/arch/sparc/dev/zx.c
+++ b/sys/arch/sparc/dev/zx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zx.c,v 1.7 2004/07/26 13:26:38 miod Exp $ */
+/* $OpenBSD: zx.c,v 1.8 2004/11/29 22:07:37 miod Exp $ */
/* $NetBSD: zx.c,v 1.5 2002/10/02 16:52:46 thorpej Exp $ */
/*
@@ -126,19 +126,6 @@ struct zx_softc {
int sc_nscreens;
};
-struct wsscreen_descr zx_stdscreen = {
- "std"
-};
-
-const struct wsscreen_descr *zx_scrlist[] = {
- &zx_stdscreen
-};
-
-struct wsscreen_list zx_screenlist = {
- sizeof(zx_scrlist) / sizeof(struct wsscreen_descr *),
- zx_scrlist
-};
-
int zx_ioctl(void *, u_long, caddr_t, int, struct proc *);
int zx_alloc_screen(void *, const struct wsscreen_descr *, void **,
int *, int *, long *);
@@ -216,7 +203,6 @@ zx_attach(struct device *parent, struct device *self, void *args)
struct zx_softc *sc = (struct zx_softc *)self;
struct confargs *ca = args;
struct rasops_info *ri;
- struct wsemuldisplaydev_attach_args waa;
int node, isconsole = 0;
const char *nam;
@@ -290,15 +276,9 @@ zx_attach(struct device *parent, struct device *self, void *args)
ri->ri_ops.putchar = zx_putchar;
ri->ri_do_cursor = zx_do_cursor;
- zx_stdscreen.capabilities = ri->ri_caps;
- zx_stdscreen.nrows = ri->ri_rows;
- zx_stdscreen.ncols = ri->ri_cols;
- zx_stdscreen.textops = &ri->ri_ops;
-
if (isconsole) {
/* zx_reset() below will clear screen, so restart at 1st row */
- fbwscons_console_init(&sc->sc_sunfb, &zx_stdscreen, 0,
- zx_burner);
+ fbwscons_console_init(&sc->sc_sunfb, 0, zx_burner);
}
/* reset cursor & frame buffer controls */
@@ -309,11 +289,7 @@ zx_attach(struct device *parent, struct device *self, void *args)
sbus_establish(&sc->sc_sd, &sc->sc_sunfb.sf_dev);
- waa.console = isconsole;
- waa.scrdata = &zx_screenlist;
- waa.accessops = &zx_accessops;
- waa.accesscookie = sc;
- config_found(self, &waa, wsemuldisplaydevprint);
+ fbwscons_attach(&sc->sc_sunfb, &zx_accessops, isconsole);
}
int