Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/wscons Suspend multicons output to the old console d...



details:   https://anonhg.NetBSD.org/src/rev/c9fd4db0f59c
branches:  trunk
changeset: 448330:c9fd4db0f59c
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Wed Jan 30 11:24:48 2019 +0000

description:
Suspend multicons output to the old console device while replaying
the vcons msgbuf.

diffstat:

 sys/dev/wscons/wsdisplay.c            |  22 +++++++++++++++++-----
 sys/dev/wscons/wsdisplay_vcons_util.c |  14 +++++++++++++-
 sys/dev/wscons/wsdisplayvar.h         |   3 ++-
 3 files changed, 32 insertions(+), 7 deletions(-)

diffs (128 lines):

diff -r 66ff410a80ad -r c9fd4db0f59c sys/dev/wscons/wsdisplay.c
--- a/sys/dev/wscons/wsdisplay.c        Wed Jan 30 11:13:25 2019 +0000
+++ b/sys/dev/wscons/wsdisplay.c        Wed Jan 30 11:24:48 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplay.c,v 1.151 2019/01/30 10:54:52 jmcneill Exp $ */
+/* $NetBSD: wsdisplay.c,v 1.152 2019/01/30 11:24:48 jmcneill Exp $ */
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.151 2019/01/30 10:54:52 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.152 2019/01/30 11:24:48 jmcneill Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_wsdisplay_compat.h"
@@ -74,6 +74,7 @@
 
 #ifdef WSDISPLAY_MULTICONS
 static bool wsdisplay_multicons_enable = true;
+static bool wsdisplay_multicons_suspended = false;
 #endif
 
 /* Console device before replaced by wsdisplay */
@@ -2301,7 +2302,8 @@
        (*dc->wsemul->output)(dc->wsemulcookie, &c, 1, 1);
 
 #ifdef WSDISPLAY_MULTICONS
-       if (wsdisplay_multicons_enable && wsdisplay_ocn && wsdisplay_ocn->cn_putc)
+       if (!wsdisplay_multicons_suspended &&
+           wsdisplay_multicons_enable && wsdisplay_ocn && wsdisplay_ocn->cn_putc)
                wsdisplay_ocn->cn_putc(wsdisplay_ocn->cn_dev, i);
 #endif
 }
@@ -2318,7 +2320,8 @@
        }
 
 #ifdef WSDISPLAY_MULTICONS
-       if (wsdisplay_multicons_enable && wsdisplay_ocn && wsdisplay_ocn->cn_getc) {
+       if (!wsdisplay_multicons_suspended &&
+           wsdisplay_multicons_enable && wsdisplay_ocn && wsdisplay_ocn->cn_getc) {
                c = wsdisplay_ocn->cn_getc(wsdisplay_ocn->cn_dev);
                if (c >= 0)
                        return c;
@@ -2345,7 +2348,8 @@
 
 #ifdef WSDISPLAY_MULTICONS
        /* notify to old console driver */
-       if (wsdisplay_multicons_enable && wsdisplay_ocn && wsdisplay_ocn->cn_pollc)
+       if (!wsdisplay_multicons_suspended &&
+           wsdisplay_multicons_enable && wsdisplay_ocn && wsdisplay_ocn->cn_pollc)
                wsdisplay_ocn->cn_pollc(wsdisplay_ocn->cn_dev, on);
 #endif
 }
@@ -2368,6 +2372,14 @@
 }
 
 #ifdef WSDISPLAY_MULTICONS
+void
+wsdisplay_multicons_suspend(bool suspend)
+{
+       wsdisplay_multicons_suspended = suspend;
+}
+#endif
+
+#ifdef WSDISPLAY_MULTICONS
 SYSCTL_SETUP(sysctl_hw_wsdisplay_setup, "sysctl hw.wsdisplay subtree setup")
 {
        const struct sysctlnode *wsdisplay_node;
diff -r 66ff410a80ad -r c9fd4db0f59c sys/dev/wscons/wsdisplay_vcons_util.c
--- a/sys/dev/wscons/wsdisplay_vcons_util.c     Wed Jan 30 11:13:25 2019 +0000
+++ b/sys/dev/wscons/wsdisplay_vcons_util.c     Wed Jan 30 11:24:48 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: wsdisplay_vcons_util.c,v 1.2 2011/05/25 06:01:39 macallan Exp $ */
+/*     $NetBSD: wsdisplay_vcons_util.c,v 1.3 2019/01/30 11:24:48 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2009 Michael Lorenz
@@ -26,6 +26,10 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifdef _KERNEL_OPT
+#include "opt_wsdisplay_compat.h"
+#endif
+
 /* some utility functions for use with vcons */
 #include <sys/param.h>
 #include <sys/stdint.h>
@@ -48,6 +52,10 @@
        int status = scr->scr_status;
        int rptr = msgbufp->msg_bufr;
 
+#ifdef WSDISPLAY_MULTICONS
+       wsdisplay_multicons_suspend(true);
+#endif
+
        scr->scr_status &= ~VCONS_IS_VISIBLE;
        while (rptr != msgbufp->msg_bufx) {
                cnputc(msgbufp->msg_bufc[rptr]);
@@ -57,4 +65,8 @@
        }
        scr->scr_status = status;
        vcons_update_screen(scr);
+
+#ifdef WSDISPLAY_MULTICONS
+       wsdisplay_multicons_suspend(false);
+#endif
 }
diff -r 66ff410a80ad -r c9fd4db0f59c sys/dev/wscons/wsdisplayvar.h
--- a/sys/dev/wscons/wsdisplayvar.h     Wed Jan 30 11:13:25 2019 +0000
+++ b/sys/dev/wscons/wsdisplayvar.h     Wed Jan 30 11:24:48 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: wsdisplayvar.h,v 1.54 2018/12/04 09:27:59 mlelstv Exp $ */
+/* $NetBSD: wsdisplayvar.h,v 1.55 2019/01/30 11:24:48 jmcneill Exp $ */
 
 /*
  * Copyright (c) 1996, 1997 Christopher G. Demetriou.  All rights reserved.
@@ -173,6 +173,7 @@
 void   wsdisplay_preattach(const struct wsscreen_descr *, void *, int, int,
             long);
 void   wsdisplay_cndetach(void);
+void   wsdisplay_multicons_suspend(bool);
 
 int    wsdisplaydevprint(void *, const char *);
 int    wsemuldisplaydevprint(void *, const char *);



Home | Main Index | Thread Index | Old Index