summaryrefslogtreecommitdiff
path: root/sys/dev/sbus
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/dev/sbus
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/dev/sbus')
-rw-r--r--sys/dev/sbus/agten.c29
-rw-r--r--sys/dev/sbus/bwtwo.c30
-rw-r--r--sys/dev/sbus/cgsix.c30
-rw-r--r--sys/dev/sbus/cgthree.c29
-rw-r--r--sys/dev/sbus/mgx.c30
-rw-r--r--sys/dev/sbus/rfx.c30
-rw-r--r--sys/dev/sbus/tvtwo.c30
-rw-r--r--sys/dev/sbus/vigra.c32
-rw-r--r--sys/dev/sbus/zx.c30
9 files changed, 28 insertions, 242 deletions
diff --git a/sys/dev/sbus/agten.c b/sys/dev/sbus/agten.c
index 36f7ff1d92d..e51564daaf6 100644
--- a/sys/dev/sbus/agten.c
+++ b/sys/dev/sbus/agten.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: agten.c,v 1.1 2004/06/21 04:41:10 miod Exp $ */
+/* $OpenBSD: agten.c,v 1.2 2004/11/29 22:07:40 miod Exp $ */
/*
* Copyright (c) 2002, 2003, Miodrag Vallat.
* All rights reserved.
@@ -106,18 +106,6 @@ struct agten_softc {
int sc_nscreens;
};
-struct wsscreen_descr agten_stdscreen = {
- "std",
-};
-
-const struct wsscreen_descr *agten_scrlist[] = {
- &agten_stdscreen,
-};
-
-struct wsscreen_list agten_screenlist = {
- sizeof(agten_scrlist) / sizeof(struct wsscreen_descr *), agten_scrlist
-};
-
int agten_ioctl(void *, u_long, caddr_t, int, struct proc *);
int agten_alloc_screen(void *, const struct wsscreen_descr *, void **,
int *, int *, long *);
@@ -172,7 +160,6 @@ agtenattach(struct device *parent, struct device *self, void *args)
{
struct agten_softc *sc = (struct agten_softc *)self;
struct sbus_attach_args *sa = args;
- struct wsemuldisplaydev_attach_args waa;
bus_space_tag_t bt;
bus_space_handle_t bh;
int node, isconsole;
@@ -241,23 +228,13 @@ agtenattach(struct device *parent, struct device *self, void *args)
fbwscons_init(&sc->sc_sunfb, isconsole ? 0 : RI_CLEAR);
fbwscons_setcolormap(&sc->sc_sunfb, agten_setcolor);
- agten_stdscreen.capabilities = sc->sc_sunfb.sf_ro.ri_caps;
- agten_stdscreen.nrows = sc->sc_sunfb.sf_ro.ri_rows;
- agten_stdscreen.ncols = sc->sc_sunfb.sf_ro.ri_cols;
- agten_stdscreen.textops = &sc->sc_sunfb.sf_ro.ri_ops;
-
if (isconsole) {
- fbwscons_console_init(&sc->sc_sunfb, &agten_stdscreen, -1,
- NULL);
+ fbwscons_console_init(&sc->sc_sunfb, -1, NULL);
}
sbus_establish(&sc->sc_sd, &sc->sc_sunfb.sf_dev);
- waa.console = isconsole;
- waa.scrdata = &agten_screenlist;
- waa.accessops = &agten_accessops;
- waa.accesscookie = sc;
- config_found(self, &waa, wsemuldisplaydevprint);
+ fbwscons_attach(&sc->sc_sunfb, &agten_accessops, isconsole);
}
int
diff --git a/sys/dev/sbus/bwtwo.c b/sys/dev/sbus/bwtwo.c
index 0c7e30d35c7..760b835ab8d 100644
--- a/sys/dev/sbus/bwtwo.c
+++ b/sys/dev/sbus/bwtwo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bwtwo.c,v 1.10 2003/06/27 01:36:53 jason Exp $ */
+/* $OpenBSD: bwtwo.c,v 1.11 2004/11/29 22:07:40 miod Exp $ */
/*
* Copyright (c) 2002 Jason L. Wright (jason@thought.net)
@@ -105,19 +105,6 @@ struct bwtwo_softc {
int sc_nscreens;
};
-struct wsscreen_descr bwtwo_stdscreen = {
- "std",
-};
-
-const struct wsscreen_descr *bwtwo_scrlist[] = {
- &bwtwo_stdscreen,
- /* XXX other formats? */
-};
-
-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 *);
@@ -170,7 +157,6 @@ bwtwoattach(parent, self, aux)
{
struct bwtwo_softc *sc = (struct bwtwo_softc *)self;
struct sbus_attach_args *sa = aux;
- struct wsemuldisplaydev_attach_args waa;
int console;
sc->sc_bustag = sa->sa_bustag;
@@ -214,22 +200,12 @@ bwtwoattach(parent, self, aux)
sc->sc_sunfb.sf_ro.ri_hw = sc;
fbwscons_init(&sc->sc_sunfb, console ? 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 (console) {
sc->sc_sunfb.sf_ro.ri_updatecursor = bwtwo_updatecursor;
- fbwscons_console_init(&sc->sc_sunfb, &bwtwo_stdscreen, -1,
- bwtwo_burner);
+ fbwscons_console_init(&sc->sc_sunfb, -1, bwtwo_burner);
}
- waa.console = console;
- waa.scrdata = &bwtwo_screenlist;
- waa.accessops = &bwtwo_accessops;
- waa.accesscookie = sc;
- config_found(self, &waa, wsemuldisplaydevprint);
+ fbwscons_attach(&sc->sc_sunfb, &bwtwo_accessops, console);
return;
diff --git a/sys/dev/sbus/cgsix.c b/sys/dev/sbus/cgsix.c
index 97aca416c78..71d25831129 100644
--- a/sys/dev/sbus/cgsix.c
+++ b/sys/dev/sbus/cgsix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgsix.c,v 1.44 2003/07/03 21:02:13 jason Exp $ */
+/* $OpenBSD: cgsix.c,v 1.45 2004/11/29 22:07:40 miod Exp $ */
/*
* Copyright (c) 2001 Jason L. Wright (jason@thought.net)
@@ -53,19 +53,6 @@
#include <dev/sbus/cgsixreg.h>
#include <dev/ic/bt458reg.h>
-struct wsscreen_descr cgsix_stdscreen = {
- "std",
-};
-
-const struct wsscreen_descr *cgsix_scrlist[] = {
- &cgsix_stdscreen,
- /* XXX other formats? */
-};
-
-struct wsscreen_list cgsix_screenlist = {
- sizeof(cgsix_scrlist) / sizeof(struct wsscreen_descr *), cgsix_scrlist
-};
-
int cgsix_ioctl(void *, u_long, caddr_t, int, struct proc *);
int cgsix_alloc_screen(void *, const struct wsscreen_descr *, void **,
int *, int *, long *);
@@ -130,7 +117,6 @@ cgsixattach(struct device *parent, struct device *self, void *aux)
{
struct cgsix_softc *sc = (struct cgsix_softc *)self;
struct sbus_attach_args *sa = aux;
- struct wsemuldisplaydev_attach_args waa;
int console, i;
u_int32_t fhc, rev;
@@ -242,26 +228,16 @@ cgsixattach(struct device *parent, struct device *self, void *aux)
cgsix_ras_init(sc);
}
- cgsix_stdscreen.capabilities = sc->sc_sunfb.sf_ro.ri_caps;
- cgsix_stdscreen.nrows = sc->sc_sunfb.sf_ro.ri_rows;
- cgsix_stdscreen.ncols = sc->sc_sunfb.sf_ro.ri_cols;
- cgsix_stdscreen.textops = &sc->sc_sunfb.sf_ro.ri_ops;
-
printf("\n");
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, &cgsix_stdscreen, -1,
- cgsix_burner);
+ fbwscons_console_init(&sc->sc_sunfb, -1, cgsix_burner);
}
- waa.console = console;
- waa.scrdata = &cgsix_screenlist;
- waa.accessops = &cgsix_accessops;
- waa.accesscookie = sc;
- config_found(self, &waa, wsemuldisplaydevprint);
+ fbwscons_attach(&sc->sc_sunfb, &cgsix_accessops, console);
return;
diff --git a/sys/dev/sbus/cgthree.c b/sys/dev/sbus/cgthree.c
index 2cc7eac5b9e..5b5b448d54f 100644
--- a/sys/dev/sbus/cgthree.c
+++ b/sys/dev/sbus/cgthree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgthree.c,v 1.35 2003/08/01 19:24:47 miod Exp $ */
+/* $OpenBSD: cgthree.c,v 1.36 2004/11/29 22:07:40 miod Exp $ */
/*
* Copyright (c) 2001 Jason L. Wright (jason@thought.net)
@@ -129,19 +129,6 @@ struct cgthree_softc {
u_int sc_mode;
};
-struct wsscreen_descr cgthree_stdscreen = {
- "std",
-};
-
-const struct wsscreen_descr *cgthree_scrlist[] = {
- &cgthree_stdscreen,
- /* XXX other formats? */
-};
-
-struct wsscreen_list cgthree_screenlist = {
- sizeof(cgthree_scrlist) / sizeof(struct wsscreen_descr *), cgthree_scrlist
-};
-
int cgthree_ioctl(void *, u_long, caddr_t, int, struct proc *);
int cgthree_alloc_screen(void *, const struct wsscreen_descr *, void **,
int *, int *, long *);
@@ -224,7 +211,6 @@ cgthreeattach(struct device *parent, struct device *self, void *aux)
{
struct cgthree_softc *sc = (struct cgthree_softc *)self;
struct sbus_attach_args *sa = aux;
- struct wsemuldisplaydev_attach_args waa;
int console, i;
sc->sc_bustag = sa->sa_bustag;
@@ -288,24 +274,15 @@ cgthreeattach(struct device *parent, struct device *self, void *aux)
fbwscons_init(&sc->sc_sunfb, console &&
(sc->sc_sunfb.sf_width >= 1024) ? 0 : RI_CLEAR);
- cgthree_stdscreen.capabilities = sc->sc_sunfb.sf_ro.ri_caps;
- cgthree_stdscreen.nrows = sc->sc_sunfb.sf_ro.ri_rows;
- cgthree_stdscreen.ncols = sc->sc_sunfb.sf_ro.ri_cols;
- cgthree_stdscreen.textops = &sc->sc_sunfb.sf_ro.ri_ops;
-
fbwscons_setcolormap(&sc->sc_sunfb, cgthree_setcolor);
if (console) {
sc->sc_sunfb.sf_ro.ri_updatecursor = cgthree_updatecursor;
- fbwscons_console_init(&sc->sc_sunfb, &cgthree_stdscreen,
+ fbwscons_console_init(&sc->sc_sunfb,
sc->sc_sunfb.sf_width >= 1024 ? -1 : 0, cgthree_burner);
}
- waa.console = console;
- waa.scrdata = &cgthree_screenlist;
- waa.accessops = &cgthree_accessops;
- waa.accesscookie = sc;
- config_found(self, &waa, wsemuldisplaydevprint);
+ fbwscons_attach(&sc->sc_sunfb, &cgthree_accessops, console);
return;
diff --git a/sys/dev/sbus/mgx.c b/sys/dev/sbus/mgx.c
index fcedbd26f67..824ed989456 100644
--- a/sys/dev/sbus/mgx.c
+++ b/sys/dev/sbus/mgx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mgx.c,v 1.1 2004/06/20 21:28:06 miod Exp $ */
+/* $OpenBSD: mgx.c,v 1.2 2004/11/29 22:07:40 miod Exp $ */
/*
* Copyright (c) 2003, Miodrag Vallat.
* All rights reserved.
@@ -92,19 +92,6 @@ struct mgx_softc {
int sc_nscreens;
};
-struct wsscreen_descr mgx_stdscreen = {
- "std",
-};
-
-const struct wsscreen_descr *mgx_scrlist[] = {
- &mgx_stdscreen,
-};
-
-struct wsscreen_list mgx_screenlist = {
- sizeof(mgx_scrlist) / sizeof(struct wsscreen_descr *),
- mgx_scrlist
-};
-
int mgx_ioctl(void *, u_long, caddr_t, int, struct proc *);
int mgx_alloc_screen(void *, const struct wsscreen_descr *, void **,
int *, int *, long *);
@@ -166,7 +153,6 @@ mgxattach(struct device *parent, struct device *self, void *args)
{
struct mgx_softc *sc = (struct mgx_softc *)self;
struct sbus_attach_args *sa = args;
- struct wsemuldisplaydev_attach_args waa;
bus_space_tag_t bt;
bus_space_handle_t bh;
int node, fbsize;
@@ -227,26 +213,16 @@ mgxattach(struct device *parent, struct device *self, void *args)
bzero(sc->sc_cmap, sizeof(sc->sc_cmap));
fbwscons_setcolormap(&sc->sc_sunfb, mgx_setcolor);
- mgx_stdscreen.capabilities = sc->sc_sunfb.sf_ro.ri_caps;
- mgx_stdscreen.nrows = sc->sc_sunfb.sf_ro.ri_rows;
- mgx_stdscreen.ncols = sc->sc_sunfb.sf_ro.ri_cols;
- mgx_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,
- &mgx_stdscreen, -1, mgx_burner);
+ fbwscons_console_init(&sc->sc_sunfb, -1, mgx_burner);
}
sbus_establish(&sc->sc_sd, &sc->sc_sunfb.sf_dev);
- waa.console = isconsole;
- waa.scrdata = &mgx_screenlist;
- waa.accessops = &mgx_accessops;
- waa.accesscookie = sc;
- config_found(self, &waa, wsemuldisplaydevprint);
+ fbwscons_attach(&sc->sc_sunfb, &mgx_accessops, isconsole);
}
/*
diff --git a/sys/dev/sbus/rfx.c b/sys/dev/sbus/rfx.c
index db5cbc5de64..a1529ccea24 100644
--- a/sys/dev/sbus/rfx.c
+++ b/sys/dev/sbus/rfx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rfx.c,v 1.1 2004/06/20 20:49:57 miod Exp $ */
+/* $OpenBSD: rfx.c,v 1.2 2004/11/29 22:07:41 miod Exp $ */
/*
* Copyright (c) 2004, Miodrag Vallat.
@@ -122,19 +122,6 @@ struct rfx_softc {
int sc_nscreens;
};
-struct wsscreen_descr rfx_stdscreen = {
- "std",
-};
-
-const struct wsscreen_descr *rfx_scrlist[] = {
- &rfx_stdscreen,
-};
-
-struct wsscreen_list rfx_screenlist = {
- sizeof(rfx_scrlist) / sizeof(struct wsscreen_descr *),
- rfx_scrlist
-};
-
int rfx_alloc_screen(void *, const struct wsscreen_descr *, void **,
int *, int *, long *);
void rfx_burner(void *, u_int, u_int);
@@ -216,7 +203,6 @@ rfxattach(struct device *parent, struct device *self, void *args)
struct sbus_attach_args *sa = args;
const char *device = sa->sa_name;
struct rfx_config cf;
- struct wsemuldisplaydev_attach_args waa;
bus_space_tag_t bt;
bus_space_handle_t bh;
int node, cflen, isconsole = 0;
@@ -322,14 +308,8 @@ rfxattach(struct device *parent, struct device *self, void *args)
bzero(&sc->sc_cmap, sizeof(sc->sc_cmap));
fbwscons_setcolormap(&sc->sc_sunfb, rfx_setcolor);
- rfx_stdscreen.capabilities = sc->sc_sunfb.sf_ro.ri_caps;
- rfx_stdscreen.nrows = sc->sc_sunfb.sf_ro.ri_rows;
- rfx_stdscreen.ncols = sc->sc_sunfb.sf_ro.ri_cols;
- rfx_stdscreen.textops = &sc->sc_sunfb.sf_ro.ri_ops;
-
if (isconsole) {
- fbwscons_console_init(&sc->sc_sunfb, &rfx_stdscreen, -1,
- rfx_burner);
+ fbwscons_console_init(&sc->sc_sunfb, -1, rfx_burner);
}
/* enable video */
@@ -337,11 +317,7 @@ rfxattach(struct device *parent, struct device *self, void *args)
sbus_establish(&sc->sc_sd, &sc->sc_sunfb.sf_dev);
- waa.console = isconsole;
- waa.scrdata = &rfx_screenlist;
- waa.accessops = &rfx_accessops;
- waa.accesscookie = sc;
- config_found(self, &waa, wsemuldisplaydevprint);
+ fbwscons_attach(&sc->sc_sunfb, &rfx_accessops, isconsole);
}
/*
diff --git a/sys/dev/sbus/tvtwo.c b/sys/dev/sbus/tvtwo.c
index 09953b6445c..8058114d57d 100644
--- a/sys/dev/sbus/tvtwo.c
+++ b/sys/dev/sbus/tvtwo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tvtwo.c,v 1.1 2004/11/29 18:12:51 miod Exp $ */
+/* $OpenBSD: tvtwo.c,v 1.2 2004/11/29 22:07:41 miod Exp $ */
/*
* Copyright (c) 2003, Miodrag Vallat.
* All rights reserved.
@@ -125,19 +125,6 @@ struct tvtwo_softc {
int sc_nscreens;
};
-struct wsscreen_descr tvtwo_stdscreen = {
- "std",
-};
-
-const struct wsscreen_descr *tvtwo_scrlist[] = {
- &tvtwo_stdscreen,
-};
-
-struct wsscreen_list tvtwo_screenlist = {
- sizeof(tvtwo_scrlist) / sizeof(struct wsscreen_descr *),
- tvtwo_scrlist
-};
-
int tvtwo_ioctl(void *, u_long, caddr_t, int, struct proc *);
int tvtwo_alloc_screen(void *, const struct wsscreen_descr *, void **,
int *, int *, long *);
@@ -202,7 +189,6 @@ tvtwoattach(struct device *parent, struct device *self, void *args)
{
struct tvtwo_softc *sc = (struct tvtwo_softc *)self;
struct sbus_attach_args *sa = args;
- struct wsemuldisplaydev_attach_args waa;
bus_space_tag_t bt;
bus_space_handle_t bh;
int node, width, height, freqcode;
@@ -264,26 +250,16 @@ tvtwoattach(struct device *parent, struct device *self, void *args)
sc->sc_sunfb.sf_ro.ri_hw = sc;
fbwscons_init(&sc->sc_sunfb, isconsole ? 0 : RI_CLEAR);
- tvtwo_stdscreen.capabilities = sc->sc_sunfb.sf_ro.ri_caps;
- tvtwo_stdscreen.nrows = sc->sc_sunfb.sf_ro.ri_rows;
- tvtwo_stdscreen.ncols = sc->sc_sunfb.sf_ro.ri_cols;
- tvtwo_stdscreen.textops = &sc->sc_sunfb.sf_ro.ri_ops;
-
printf("%s: %dx%d\n", self->dv_xname,
sc->sc_sunfb.sf_width, sc->sc_sunfb.sf_height);
if (isconsole) {
- fbwscons_console_init(&sc->sc_sunfb,
- &tvtwo_stdscreen, -1, NULL);
+ fbwscons_console_init(&sc->sc_sunfb, -1, NULL);
}
sbus_establish(&sc->sc_sd, &sc->sc_sunfb.sf_dev);
- waa.console = isconsole;
- waa.scrdata = &tvtwo_screenlist;
- waa.accessops = &tvtwo_accessops;
- waa.accesscookie = sc;
- config_found(self, &waa, wsemuldisplaydevprint);
+ fbwscons_attach(&sc->sc_sunfb, &tvtwo_accessops, isconsole);
}
int
diff --git a/sys/dev/sbus/vigra.c b/sys/dev/sbus/vigra.c
index e95adc697c5..9e74a5cc541 100644
--- a/sys/dev/sbus/vigra.c
+++ b/sys/dev/sbus/vigra.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vigra.c,v 1.1 2004/11/29 18:12:51 miod Exp $ */
+/* $OpenBSD: vigra.c,v 1.2 2004/11/29 22:07:41 miod Exp $ */
/*
* Copyright (c) 2002, 2003, Miodrag Vallat.
@@ -186,19 +186,6 @@ struct vigra_softc {
int sc_nscreens;
};
-struct wsscreen_descr vigra_stdscreen = {
- "std",
-};
-
-const struct wsscreen_descr *vigra_scrlist[] = {
- &vigra_stdscreen,
-};
-
-struct wsscreen_list vigra_screenlist = {
- sizeof(vigra_scrlist) / sizeof(struct wsscreen_descr *),
- vigra_scrlist
-};
-
int vigra_ioctl(void *, u_long, caddr_t, int, struct proc *);
int vigra_alloc_screen(void *, const struct wsscreen_descr *, void **,
int *, int *, long *);
@@ -262,7 +249,6 @@ vigraattach(struct device *parent, struct device *self, void *args)
{
struct vigra_softc *sc = (struct vigra_softc *)self;
struct sbus_attach_args *sa = args;
- struct wsemuldisplaydev_attach_args waa;
bus_space_tag_t bt;
bus_space_handle_t bh;
int node, row, isconsole = 0;
@@ -351,15 +337,10 @@ vigraattach(struct device *parent, struct device *self, void *args)
&& sc->sc_sunfb.sf_width != 1280) ? 0 : RI_CLEAR);
fbwscons_setcolormap(&sc->sc_sunfb, vigra_setcolor);
- vigra_stdscreen.capabilities = sc->sc_sunfb.sf_ro.ri_caps;
- vigra_stdscreen.nrows = sc->sc_sunfb.sf_ro.ri_rows;
- vigra_stdscreen.ncols = sc->sc_sunfb.sf_ro.ri_cols;
- vigra_stdscreen.textops = &sc->sc_sunfb.sf_ro.ri_ops;
-
if (isconsole) {
switch (sc->sc_sunfb.sf_width) {
case 640:
- row = vigra_stdscreen.nrows - 1;
+ row = sc->sc_sunfb.sf_ro.ri_rows - 1;
break;
case 800:
case 1280:
@@ -370,17 +351,12 @@ vigraattach(struct device *parent, struct device *self, void *args)
break;
}
- fbwscons_console_init(&sc->sc_sunfb, &vigra_stdscreen, row,
- vigra_burner);
+ fbwscons_console_init(&sc->sc_sunfb, row, vigra_burner);
}
sbus_establish(&sc->sc_sd, &sc->sc_sunfb.sf_dev);
- waa.console = isconsole;
- waa.scrdata = &vigra_screenlist;
- waa.accessops = &vigra_accessops;
- waa.accesscookie = sc;
- config_found(self, &waa, wsemuldisplaydevprint);
+ fbwscons_attach(&sc->sc_sunfb, &vigra_accessops, isconsole);
}
int
diff --git a/sys/dev/sbus/zx.c b/sys/dev/sbus/zx.c
index 2ee230fcfa1..c3f6a2f886f 100644
--- a/sys/dev/sbus/zx.c
+++ b/sys/dev/sbus/zx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zx.c,v 1.2 2004/07/26 13:26:39 miod Exp $ */
+/* $OpenBSD: zx.c,v 1.3 2004/11/29 22:07:41 miod Exp $ */
/* $NetBSD: zx.c,v 1.5 2002/10/02 16:52:46 thorpej Exp $ */
/*
@@ -129,19 +129,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 *);
@@ -218,7 +205,6 @@ zx_attach(struct device *parent, struct device *self, void *args)
struct zx_softc *sc = (struct zx_softc *)self;
struct sbus_attach_args *sa = args;
struct rasops_info *ri;
- struct wsemuldisplaydev_attach_args waa;
bus_space_tag_t bt;
bus_space_handle_t bh;
int node, isconsole = 0;
@@ -320,15 +306,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 */
@@ -339,11 +319,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