summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2006-11-29 12:13:56 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2006-11-29 12:13:56 +0000
commitfb2255fc8756c12ec3557ef061587f1ffdb3fcc5 (patch)
tree2979602a939896459f2502111118521c6012ac2d /sys/dev
parentafe56911378491afdcb3a537d27aa1860371ba7b (diff)
Add a new member to struct wsemuldisplaydev_attach_args, for a frame buffer
driver to be able to tell how many wscons screens to attach to it, instead of WSDISPLAY_DEFAULTSCREENS which is a global setting.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/sti.c3
-rw-r--r--sys/dev/ic/vga.c3
-rw-r--r--sys/dev/isa/ega.c3
-rw-r--r--sys/dev/isa/pcdisplay.c3
-rw-r--r--sys/dev/pci/tga.c3
-rw-r--r--sys/dev/pcmcia/cfxga.c4
-rw-r--r--sys/dev/wscons/wsdisplay.c16
-rw-r--r--sys/dev/wscons/wsdisplayvar.h3
8 files changed, 23 insertions, 15 deletions
diff --git a/sys/dev/ic/sti.c b/sys/dev/ic/sti.c
index 7e6afa2e8b4..500aa22e873 100644
--- a/sys/dev/ic/sti.c
+++ b/sys/dev/ic/sti.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sti.c,v 1.44 2006/08/22 21:04:32 miod Exp $ */
+/* $OpenBSD: sti.c,v 1.45 2006/11/29 12:13:54 miod Exp $ */
/*
* Copyright (c) 2000-2003 Michael Shalayeff
@@ -467,6 +467,7 @@ sti_end_attach(void *v)
waa.scrdata = &sti_default_screenlist;
waa.accessops = &sti_accessops;
waa.accesscookie = sc;
+ waa.defaultscreens = 0;
/* attach as console if required */
if (waa.console && !ISSET(sc->sc_flags, STI_ATTACHED)) {
diff --git a/sys/dev/ic/vga.c b/sys/dev/ic/vga.c
index 884dddf39e9..c5489d3df46 100644
--- a/sys/dev/ic/vga.c
+++ b/sys/dev/ic/vga.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vga.c,v 1.39 2006/09/29 19:46:02 miod Exp $ */
+/* $OpenBSD: vga.c,v 1.40 2006/11/29 12:13:54 miod Exp $ */
/* $NetBSD: vga.c,v 1.28.2.1 2000/06/30 16:27:47 simonb Exp $ */
/*
@@ -532,6 +532,7 @@ vga_extended_attach(self, iot, memt, type, map)
aa.scrdata = (vc->hdl.vh_mono ? &vga_screenlist_mono : &vga_screenlist);
aa.accessops = &vga_accessops;
aa.accesscookie = vc;
+ aa.defaultscreens = 0;
config_found(self, &aa, wsemuldisplaydevprint);
}
diff --git a/sys/dev/isa/ega.c b/sys/dev/isa/ega.c
index f0c4bb7448b..4be901605cb 100644
--- a/sys/dev/isa/ega.c
+++ b/sys/dev/isa/ega.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ega.c,v 1.8 2006/09/29 19:46:04 miod Exp $ */
+/* $OpenBSD: ega.c,v 1.9 2006/11/29 12:13:54 miod Exp $ */
/* $NetBSD: ega.c,v 1.4.4.1 2000/06/30 16:27:47 simonb Exp $ */
/*
@@ -520,6 +520,7 @@ ega_attach(parent, self, aux)
aa.scrdata = &ega_screenlist;
aa.accessops = &ega_accessops;
aa.accesscookie = dc;
+ aa.defaultscreens = 0;
config_found(self, &aa, wsemuldisplaydevprint);
}
diff --git a/sys/dev/isa/pcdisplay.c b/sys/dev/isa/pcdisplay.c
index 4f2be0968b3..d39d4316ada 100644
--- a/sys/dev/isa/pcdisplay.c
+++ b/sys/dev/isa/pcdisplay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pcdisplay.c,v 1.7 2004/04/02 04:39:51 deraadt Exp $ */
+/* $OpenBSD: pcdisplay.c,v 1.8 2006/11/29 12:13:54 miod Exp $ */
/* $NetBSD: pcdisplay.c,v 1.9.4.1 2000/06/30 16:27:48 simonb Exp $ */
/*
@@ -287,6 +287,7 @@ pcdisplay_attach(parent, self, aux)
aa.scrdata = &pcdisplay_screenlist;
aa.accessops = &pcdisplay_accessops;
aa.accesscookie = sc;
+ aa.defaultscreens = 0;
config_found(self, &aa, wsemuldisplaydevprint);
}
diff --git a/sys/dev/pci/tga.c b/sys/dev/pci/tga.c
index 01bc6c89d44..80d6ed8b7c5 100644
--- a/sys/dev/pci/tga.c
+++ b/sys/dev/pci/tga.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tga.c,v 1.26 2006/02/16 23:05:46 miod Exp $ */
+/* $OpenBSD: tga.c,v 1.27 2006/11/29 12:13:55 miod Exp $ */
/* $NetBSD: tga.c,v 1.40 2002/03/13 15:05:18 ad Exp $ */
/*
@@ -540,6 +540,7 @@ tgaattach(parent, self, aux)
aa.scrdata = &tga_screenlist;
aa.accessops = &tga_accessops;
aa.accesscookie = sc;
+ aa.defaultscreens = 0;
config_found(self, &aa, wsemuldisplaydevprint);
diff --git a/sys/dev/pcmcia/cfxga.c b/sys/dev/pcmcia/cfxga.c
index 1e011a6d71e..4424a96f46d 100644
--- a/sys/dev/pcmcia/cfxga.c
+++ b/sys/dev/pcmcia/cfxga.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cfxga.c,v 1.11 2006/11/28 12:01:27 miod Exp $ */
+/* $OpenBSD: cfxga.c,v 1.12 2006/11/29 12:13:55 miod Exp $ */
/*
* Copyright (c) 2005, 2006, Matthieu Herrb and Miodrag Vallat
@@ -404,9 +404,7 @@ cfxga_attach(struct device *parent, struct device *self, void *aux)
waa.scrdata = &sc->sc_wsl;
waa.accessops = &cfxga_accessops;
waa.accesscookie = sc;
-#ifdef notyet
waa.defaultscreens = 1;
-#endif
if ((sc->sc_wsdisplay =
config_found(self, &waa, wsemuldisplaydevprint)) == NULL) {
diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c
index 5112dbc5880..4e71d61d85a 100644
--- a/sys/dev/wscons/wsdisplay.c
+++ b/sys/dev/wscons/wsdisplay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsdisplay.c,v 1.70 2006/11/01 03:37:24 tedu Exp $ */
+/* $OpenBSD: wsdisplay.c,v 1.71 2006/11/29 12:13:55 miod Exp $ */
/* $NetBSD: wsdisplay.c,v 1.82 2005/02/27 00:27:52 perry Exp $ */
/*
@@ -233,7 +233,7 @@ int wsdisplayparam(struct tty *, struct termios *);
void wsdisplay_common_attach(struct wsdisplay_softc *sc,
int console, int mux, const struct wsscreen_list *,
const struct wsdisplay_accessops *accessops,
- void *accesscookie);
+ void *accesscookie, u_int defaultscreens);
int wsdisplay_common_detach(struct wsdisplay_softc *, int);
#ifdef WSDISPLAY_COMPAT_RAWKBD
@@ -571,7 +571,7 @@ wsdisplay_emul_attach(struct device *parent, struct device *self, void *aux)
wsdisplay_common_attach(sc, ap->console,
sc->sc_dv.dv_cfdata->wsemuldisplaydevcf_mux, ap->scrdata,
- ap->accessops, ap->accesscookie);
+ ap->accessops, ap->accesscookie, ap->defaultscreens);
if (ap->console && cn_tab == &wsdisplay_cons) {
int maj;
@@ -659,7 +659,8 @@ wsemuldisplaydevprint(void *aux, const char *pnp)
void
wsdisplay_common_attach(struct wsdisplay_softc *sc, int console, int kbdmux,
const struct wsscreen_list *scrdata,
- const struct wsdisplay_accessops *accessops, void *accesscookie)
+ const struct wsdisplay_accessops *accessops, void *accesscookie,
+ u_int defaultscreens)
{
static int hookset = 0;
int i, start = 0;
@@ -728,9 +729,12 @@ wsdisplay_common_attach(struct wsdisplay_softc *sc, int console, int kbdmux,
/*
* Set up a number of virtual screens if wanted. The
* WSDISPLAYIO_ADDSCREEN ioctl is more flexible, so this code
- * is for special cases like installation kernels.
+ * is for special cases like installation kernels, as well as
+ * sane multihead defaults.
*/
- for (i = start; i < wsdisplay_defaultscreens; i++) {
+ if (defaultscreens == 0)
+ defaultscreens = wsdisplay_defaultscreens;
+ for (i = start; i < defaultscreens; i++) {
if (wsdisplay_addscreen(sc, i, 0, 0))
break;
}
diff --git a/sys/dev/wscons/wsdisplayvar.h b/sys/dev/wscons/wsdisplayvar.h
index 3f9cb984620..09357bc337d 100644
--- a/sys/dev/wscons/wsdisplayvar.h
+++ b/sys/dev/wscons/wsdisplayvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsdisplayvar.h,v 1.18 2006/06/30 21:38:19 miod Exp $ */
+/* $OpenBSD: wsdisplayvar.h,v 1.19 2006/11/29 12:13:55 miod Exp $ */
/* $NetBSD: wsdisplayvar.h,v 1.30 2005/02/04 02:10:49 perry Exp $ */
/*
@@ -143,6 +143,7 @@ struct wsemuldisplaydev_attach_args {
const struct wsscreen_list *scrdata; /* screen cfg info */
const struct wsdisplay_accessops *accessops; /* access ops */
void *accesscookie; /* access cookie */
+ u_int defaultscreens; /* screens to create */
};
#define WSEMULDISPLAYDEVCF_CONSOLE 0