From 4baf344378b841e9787f354d036b50b5ebb90b74 Mon Sep 17 00:00:00 2001 From: jmcneill Date: Sat, 18 Feb 2006 18:56:05 +0000 Subject: [PATCH] Bunch of changes to wscons in preparation for splash screen support: * Add WSDISPLAY_TYPE_VESA for vesafb. While here, fix a typo in a comment. * Add WSDISPLAYIO_SSPLASH and WSDISPLAYIO_SPROGRESS ioctls. The former toggles the splash screen on and off, and the latter updates the progress animation. * Prevent more than one hw driver from claiming to be the console. * In vcons, keep two pointers to the screen's vcons_data. This lets us override the original (ie with null emulops during boot), and restore them later on. --- sys/dev/wscons/wsconsio.h | 9 +++++++-- sys/dev/wscons/wsdisplay.c | 11 +++++++++-- sys/dev/wscons/wsdisplay_vcons.c | 6 +++--- sys/dev/wscons/wsdisplay_vconsvar.h | 3 ++- 4 files changed, 21 insertions(+), 8 deletions(-) diff --git a/sys/dev/wscons/wsconsio.h b/sys/dev/wscons/wsconsio.h index e20be168d8eb..d55ec5bda299 100644 --- a/sys/dev/wscons/wsconsio.h +++ b/sys/dev/wscons/wsconsio.h @@ -1,4 +1,4 @@ -/* $NetBSD: wsconsio.h,v 1.78 2006/02/05 17:38:33 jmmv Exp $ */ +/* $NetBSD: wsconsio.h,v 1.79 2006/02/18 18:56:05 jmcneill Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -298,8 +298,9 @@ struct wsmouse_repeat { #define WSDISPLAY_TYPE_SUNCG14 37 /* Sun cgfourteen */ #define WSDISPLAY_TYPE_SUNTCX 38 /* Sun TCX */ #define WSDISPLAY_TYPE_SUNFFB 39 /* Sun creator FFB */ -#define WSDISPLAY_TYPE_STI 40 /* HP STI frambuffers */ +#define WSDISPLAY_TYPE_STI 40 /* HP STI framebuffers */ #define WSDISPLAY_TYPE_HDLCD 41 /* Hitachi HD44780 based LCDs */ +#define WSDISPLAY_TYPE_VESA 42 /* VESA BIOS framebuffer */ /* Basic display information. Not applicable to all display types. */ struct wsdisplay_fbinfo { @@ -471,6 +472,10 @@ struct wsdisplay_msgattrs { #define WSDISPLAYIO_GBORDER _IOR('W', 91, int) #define WSDISPLAYIO_SBORDER _IOW('W', 92, int) +/* Splash screen control */ +#define WSDISPLAYIO_SSPLASH _IOW('W', 93, int) +#define WSDISPLAYIO_SPROGRESS _IOW('W', 94, int) + /* XXX NOT YET DEFINED */ /* Mapping information retrieval. */ diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c index 774eb7667066..052908ccd1c0 100644 --- a/sys/dev/wscons/wsdisplay.c +++ b/sys/dev/wscons/wsdisplay.c @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay.c,v 1.88 2006/02/07 09:13:02 jmmv Exp $ */ +/* $NetBSD: wsdisplay.c,v 1.89 2006/02/18 18:56:05 jmcneill Exp $ */ /* * Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved. @@ -31,7 +31,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.88 2006/02/07 09:13:02 jmmv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.89 2006/02/18 18:56:05 jmcneill Exp $"); #include "opt_wsdisplay_border.h" #include "opt_wsdisplay_compat.h" @@ -211,6 +211,7 @@ int wsdisplay_update_rawkbd(struct wsdisplay_softc *, #endif static int wsdisplay_console_initted; +static int wsdisplay_console_attached; static struct wsdisplay_softc *wsdisplay_console_device; static struct wsscreen_internal wsdisplay_console_conf; @@ -530,6 +531,10 @@ wsdisplay_emul_attach(struct device *parent, struct device *self, void *aux) struct wsdisplay_softc *sc = (struct wsdisplay_softc *)self; struct wsemuldisplaydev_attach_args *ap = aux; + /* Don't allow more than one console to attach */ + if (wsdisplay_console_attached && ap->console) + ap->console = 0; + wsdisplay_common_attach(sc, ap->console, sc->sc_dv.dv_cfdata->wsemuldisplaydevcf_kbdmux, ap->scrdata, ap->accessops, ap->accesscookie); @@ -651,6 +656,8 @@ wsdisplay_common_attach(struct wsdisplay_softc *sc, int console, int kbdmux, sc->sc_focusidx = 0; sc->sc_focus = sc->sc_scr[0]; start = 1; + + wsdisplay_console_attached = 1; } printf("\n"); diff --git a/sys/dev/wscons/wsdisplay_vcons.c b/sys/dev/wscons/wsdisplay_vcons.c index a512cfd067e3..edcd06c8edc1 100644 --- a/sys/dev/wscons/wsdisplay_vcons.c +++ b/sys/dev/wscons/wsdisplay_vcons.c @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_vcons.c,v 1.3 2006/02/14 16:02:00 macallan Exp $ */ +/* $NetBSD: wsdisplay_vcons.c,v 1.4 2006/02/18 18:56:05 jmcneill Exp $ */ /*- * Copyright (c) 2005, 2006 Michael Lorenz @@ -34,7 +34,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.3 2006/02/14 16:02:00 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: wsdisplay_vcons.c,v 1.4 2006/02/18 18:56:05 jmcneill Exp $"); #include #include @@ -180,7 +180,7 @@ vcons_init_screen(struct vcons_data *vd, struct vcons_screen *scr, int cnt, i; scr->scr_cookie = vd->cookie; - scr->scr_vd = vd; + scr->scr_vd = scr->scr_origvd = vd; SCREEN_IDLE(scr); /* diff --git a/sys/dev/wscons/wsdisplay_vconsvar.h b/sys/dev/wscons/wsdisplay_vconsvar.h index 9bd86db480b7..12a4cfaeeaa8 100644 --- a/sys/dev/wscons/wsdisplay_vconsvar.h +++ b/sys/dev/wscons/wsdisplay_vconsvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: wsdisplay_vconsvar.h,v 1.1 2006/02/12 20:55:35 macallan Exp $ */ +/* $NetBSD: wsdisplay_vconsvar.h,v 1.2 2006/02/18 18:56:05 jmcneill Exp $ */ /*- * Copyright (c) 2005, 2006 Michael Lorenz @@ -43,6 +43,7 @@ struct vcons_screen { LIST_ENTRY(vcons_screen) next; void *scr_cookie; struct vcons_data *scr_vd; + struct vcons_data *scr_origvd; const struct wsscreen_descr *scr_type; uint16_t *scr_chars; long *scr_attrs;