diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-11-29 22:07:42 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-11-29 22:07:42 +0000 |
commit | cefdf5e62eae54a4c575c27947ca681a438ade33 (patch) | |
tree | f6057fe704b1e777395bda6ae431013303d9ffe7 /sys/dev/sbus/vigra.c | |
parent | 0ade68e7821ecaff132d0ec95dd118093bff8605 (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/vigra.c')
-rw-r--r-- | sys/dev/sbus/vigra.c | 32 |
1 files changed, 4 insertions, 28 deletions
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 |