diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2007-01-12 22:02:36 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2007-01-12 22:02:36 +0000 |
commit | 8bc3dedf672d83a3c0713c8a2eb1d6633d1372a0 (patch) | |
tree | 4e33275ffa8695d6c838b6c53fe3f08bc2fd24f9 /sys | |
parent | ae4f44026a982e17a006294f4d27e8a16032364e (diff) |
Keep the wsscreen_descr in the softc, to allow sti of different text
resolutions to attach without disturbing each other.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/sti.c | 44 | ||||
-rw-r--r-- | sys/dev/ic/stivar.h | 7 | ||||
-rw-r--r-- | sys/dev/pci/sti_pci.c | 4 |
3 files changed, 27 insertions, 28 deletions
diff --git a/sys/dev/ic/sti.c b/sys/dev/ic/sti.c index 52c8967acd3..897636f7e25 100644 --- a/sys/dev/ic/sti.c +++ b/sys/dev/ic/sti.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sti.c,v 1.52 2007/01/11 22:02:03 miod Exp $ */ +/* $OpenBSD: sti.c,v 1.53 2007/01/12 22:02:33 miod Exp $ */ /* * Copyright (c) 2000-2003 Michael Shalayeff @@ -93,22 +93,6 @@ const struct wsdisplay_accessops sti_accessops = { sti_load_font }; -struct wsscreen_descr sti_default_screen = { - "default", 0, 0, - &sti_emulops, - 0, 0, - 0 -}; - -const struct wsscreen_descr *sti_default_scrlist[] = { - &sti_default_screen -}; - -struct wsscreen_list sti_default_screenlist = { - sizeof(sti_default_scrlist) / sizeof(sti_default_scrlist[0]), - sti_default_scrlist -}; - enum sti_bmove_funcs { bmf_clear, bmf_copy, bmf_invert, bmf_underline }; @@ -475,16 +459,24 @@ sti_screen_setup(struct sti_screen *scr, bus_space_tag_t iot, } /* - * parse screen descriptions: + * setup screen descriptions: * figure number of fonts supported; * allocate wscons structures; * calculate dimensions. */ - sti_default_screen.ncols = cfg.width / scr->scr_curfont.width; - sti_default_screen.nrows = cfg.height / scr->scr_curfont.height; - sti_default_screen.fontwidth = scr->scr_curfont.width; - sti_default_screen.fontheight = scr->scr_curfont.height; + strlcpy(scr->scr_wsd.name, "std", sizeof(scr->scr_wsd.name)); + scr->scr_wsd.ncols = cfg.width / scr->scr_curfont.width; + scr->scr_wsd.nrows = cfg.height / scr->scr_curfont.height; + scr->scr_wsd.textops = &sti_emulops; + scr->scr_wsd.fontwidth = scr->scr_curfont.width; + scr->scr_wsd.fontheight = scr->scr_curfont.height; + scr->scr_wsd.capabilities = 0; + + scr->scr_scrlist[0] = &scr->scr_wsd; + scr->scr_screenlist.nscreens = 1; + scr->scr_screenlist.screens = + (const struct wsscreen_descr **)scr->scr_scrlist; /* { extern int pmapdebug; pmapdebug = 0; } */ @@ -521,7 +513,7 @@ sti_end_attach(void *v) sc->sc_wsmode = WSDISPLAYIO_MODE_EMUL; waa.console = sc->sc_flags & STI_CONSOLE ? 1 : 0; - waa.scrdata = &sti_default_screenlist; + waa.scrdata = &sc->sc_scr->scr_screenlist; waa.accessops = &sti_accessops; waa.accesscookie = sc; waa.defaultscreens = 0; @@ -531,8 +523,8 @@ sti_end_attach(void *v) long defattr; sti_alloc_attr(sc, 0, 0, 0, &defattr); - wsdisplay_cnattach(&sti_default_screen, sc->sc_scr, - 0, sti_default_screen.nrows - 1, defattr); + wsdisplay_cnattach(&sc->sc_scr->scr_wsd, sc->sc_scr, + 0, sc->sc_scr->scr_wsd.nrows - 1, defattr); sc->sc_flags |= STI_ATTACHED; } @@ -1194,7 +1186,7 @@ sti_cnattach(struct sti_screen *scr, bus_space_tag_t iot, bus_addr_t *bases, panic(__func__); sti_alloc_attr(scr, 0, 0, 0, &defattr); - wsdisplay_cnattach(&sti_default_screen, scr, 0, 0, defattr); + wsdisplay_cnattach(&scr->scr_wsd, scr, 0, 0, defattr); return (0); } diff --git a/sys/dev/ic/stivar.h b/sys/dev/ic/stivar.h index 4b5451e89f1..b45cbfb0d58 100644 --- a/sys/dev/ic/stivar.h +++ b/sys/dev/ic/stivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stivar.h,v 1.22 2007/01/11 22:02:04 miod Exp $ */ +/* $OpenBSD: stivar.h,v 1.23 2007/01/12 22:02:33 miod Exp $ */ /* * Copyright (c) 2000-2003 Michael Shalayeff @@ -73,6 +73,11 @@ struct sti_screen { u_int16_t fbheight, fbwidth, oheight, owidth; u_int8_t name[STI_DEVNAME_LEN]; + + /* wsdisplay information */ + struct wsscreen_descr scr_wsd; + struct wsscreen_descr *scr_scrlist[1]; + struct wsscreen_list scr_screenlist; }; struct sti_softc { diff --git a/sys/dev/pci/sti_pci.c b/sys/dev/pci/sti_pci.c index 011adf00523..c527388eb67 100644 --- a/sys/dev/pci/sti_pci.c +++ b/sys/dev/pci/sti_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sti_pci.c,v 1.4 2007/01/11 22:06:40 miod Exp $ */ +/* $OpenBSD: sti_pci.c,v 1.5 2007/01/12 22:02:35 miod Exp $ */ /* * Copyright (c) 2006, 2007 Miodrag Vallat. @@ -25,6 +25,8 @@ #include <dev/pci/pcivar.h> #include <dev/pci/pcidevs.h> +#include <dev/wscons/wsdisplayvar.h> + #include <dev/ic/stireg.h> #include <dev/ic/stivar.h> |