summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/dev/bwtwo.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/bwtwo.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/bwtwo.c')
-rw-r--r--sys/arch/sparc/dev/bwtwo.c30
1 files changed, 3 insertions, 27 deletions
diff --git a/sys/arch/sparc/dev/bwtwo.c b/sys/arch/sparc/dev/bwtwo.c
index 893142220a2..98cc95679bc 100644
--- a/sys/arch/sparc/dev/bwtwo.c
+++ b/sys/arch/sparc/dev/bwtwo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bwtwo.c,v 1.27 2003/06/28 17:05:33 miod Exp $ */
+/* $OpenBSD: bwtwo.c,v 1.28 2004/11/29 22:07:36 miod Exp $ */
/* $NetBSD: bwtwo.c,v 1.33 1997/05/24 20:16:02 pk Exp $ */
/*
@@ -93,19 +93,6 @@ struct bwtwo_softc {
int sc_nscreens;
};
-struct wsscreen_descr bwtwo_stdscreen = {
- "std",
-};
-
-const struct wsscreen_descr *bwtwo_scrlist[] = {
- &bwtwo_stdscreen,
-};
-
-struct wsscreen_list bwtwo_screenlist = {
- sizeof(bwtwo_scrlist) / sizeof(struct wsscreen_descr *),
- bwtwo_scrlist
-};
-
int bwtwo_ioctl(void *, u_long, caddr_t, int, struct proc *);
int bwtwo_alloc_screen(void *, const struct wsscreen_descr *, void **,
int *, int *, long *);
@@ -208,7 +195,6 @@ bwtwoattach(parent, self, args)
{
struct bwtwo_softc *sc = (struct bwtwo_softc *)self;
struct confargs *ca = args;
- struct wsemuldisplaydev_attach_args waa;
int node = ca->ca_ra.ra_node;
int isconsole = 0;
int sbus = 1;
@@ -308,14 +294,8 @@ obp_name:
sc->sc_sunfb.sf_ro.ri_hw = sc;
fbwscons_init(&sc->sc_sunfb, isconsole ? 0 : RI_CLEAR);
- bwtwo_stdscreen.capabilities = sc->sc_sunfb.sf_ro.ri_caps;
- bwtwo_stdscreen.nrows = sc->sc_sunfb.sf_ro.ri_rows;
- bwtwo_stdscreen.ncols = sc->sc_sunfb.sf_ro.ri_cols;
- bwtwo_stdscreen.textops = &sc->sc_sunfb.sf_ro.ri_ops;
-
if (isconsole) {
- fbwscons_console_init(&sc->sc_sunfb, &bwtwo_stdscreen, -1,
- bwtwo_burner);
+ fbwscons_console_init(&sc->sc_sunfb, -1, bwtwo_burner);
}
#if defined(SUN4C) || defined(SUN4M)
@@ -323,11 +303,7 @@ obp_name:
sbus_establish(&sc->sc_sd, &sc->sc_sunfb.sf_dev);
#endif
- waa.console = isconsole;
- waa.scrdata = &bwtwo_screenlist;
- waa.accessops = &bwtwo_accessops;
- waa.accesscookie = sc;
- config_found(self, &waa, wsemuldisplaydevprint);
+ fbwscons_attach(&sc->sc_sunfb, &bwtwo_accessops, isconsole);
}
int