summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/dev/cgfour.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/cgfour.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/cgfour.c')
-rw-r--r--sys/arch/sparc/dev/cgfour.c30
1 files changed, 3 insertions, 27 deletions
diff --git a/sys/arch/sparc/dev/cgfour.c b/sys/arch/sparc/dev/cgfour.c
index fcad25130ac..e1e13cf87f9 100644
--- a/sys/arch/sparc/dev/cgfour.c
+++ b/sys/arch/sparc/dev/cgfour.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgfour.c,v 1.21 2003/06/28 17:05:33 miod Exp $ */
+/* $OpenBSD: cgfour.c,v 1.22 2004/11/29 22:07:36 miod Exp $ */
/* $NetBSD: cgfour.c,v 1.13 1997/05/24 20:16:06 pk Exp $ */
/*
@@ -88,19 +88,6 @@ struct cgfour_softc {
int sc_nscreens;
};
-struct wsscreen_descr cgfour_stdscreen = {
- "std",
-};
-
-const struct wsscreen_descr *cgfour_scrlist[] = {
- &cgfour_stdscreen,
-};
-
-struct wsscreen_list cgfour_screenlist = {
- sizeof(cgfour_scrlist) / sizeof(struct wsscreen_descr *),
- cgfour_scrlist
-};
-
int cgfour_ioctl(void *, u_long, caddr_t, int, struct proc *);
int cgfour_alloc_screen(void *, const struct wsscreen_descr *, void **,
int *, int *, long *);
@@ -181,7 +168,6 @@ cgfourattach(parent, self, args)
{
struct cgfour_softc *sc = (struct cgfour_softc *)self;
struct confargs *ca = args;
- struct wsemuldisplaydev_attach_args waa;
int node = 0, i;
volatile struct bt_regs *bt;
int isconsole = 0;
@@ -240,23 +226,13 @@ cgfourattach(parent, self, args)
fbwscons_init(&sc->sc_sunfb, isconsole ? 0 : RI_CLEAR);
fbwscons_setcolormap(&sc->sc_sunfb, cgfour_setcolor);
- cgfour_stdscreen.capabilities = sc->sc_sunfb.sf_ro.ri_caps;
- cgfour_stdscreen.nrows = sc->sc_sunfb.sf_ro.ri_rows;
- cgfour_stdscreen.ncols = sc->sc_sunfb.sf_ro.ri_cols;
- cgfour_stdscreen.textops = &sc->sc_sunfb.sf_ro.ri_ops;
-
printf(", %dx%d\n", sc->sc_sunfb.sf_width, sc->sc_sunfb.sf_height);
if (isconsole) {
- fbwscons_console_init(&sc->sc_sunfb, &cgfour_stdscreen, -1,
- cgfour_burner);
+ fbwscons_console_init(&sc->sc_sunfb, -1, cgfour_burner);
}
- waa.console = isconsole;
- waa.scrdata = &cgfour_screenlist;
- waa.accessops = &cgfour_accessops;
- waa.accesscookie = sc;
- config_found(self, &waa, wsemuldisplaydevprint);
+ fbwscons_attach(&sc->sc_sunfb, &cgfour_accessops, isconsole);
}
int