summaryrefslogtreecommitdiff
path: root/sys/dev/sbus/rfx.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/dev/sbus/rfx.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/dev/sbus/rfx.c')
-rw-r--r--sys/dev/sbus/rfx.c30
1 files changed, 3 insertions, 27 deletions
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);
}
/*