summaryrefslogtreecommitdiff
path: root/sys/dev/wscons
diff options
context:
space:
mode:
authorAaron Campbell <aaron@cvs.openbsd.org>2000-11-23 16:13:43 +0000
committerAaron Campbell <aaron@cvs.openbsd.org>2000-11-23 16:13:43 +0000
commit498d524fb10c5f9cec0c679a50201c3383220fb8 (patch)
tree77bbe3326987e4f3f0a39dd4ee8ef3fca7bbe365 /sys/dev/wscons
parent14bdec9a973f010f04fced2ab9befec8094b2a1f (diff)
Make wsdisplaystart() a bit more like PCVT's pcstart() to avoid tty races when
switching virtual terminals.
Diffstat (limited to 'sys/dev/wscons')
-rw-r--r--sys/dev/wscons/wsdisplay.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/sys/dev/wscons/wsdisplay.c b/sys/dev/wscons/wsdisplay.c
index 7a0125e95e3..8cf700dd3bf 100644
--- a/sys/dev/wscons/wsdisplay.c
+++ b/sys/dev/wscons/wsdisplay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsdisplay.c,v 1.8 2000/11/15 21:23:48 aaron Exp $ */
+/* $OpenBSD: wsdisplay.c,v 1.9 2000/11/23 16:13:42 aaron Exp $ */
/* $NetBSD: wsdisplay.c,v 1.37.4.1 2000/06/30 16:27:53 simonb Exp $ */
/*
@@ -1179,6 +1179,9 @@ wsdisplaystart(tp)
splx(s);
return;
}
+ if (tp->t_outq.c_cc == 0 && tp->t_wsel.si_selpid == 0)
+ goto low;
+
sc = wsdisplay_cd.cd_devs[WSDISPLAYUNIT(tp->t_dev)];
scr = sc->sc_scr[WSDISPLAYSCREEN(tp->t_dev)];
if (scr->scr_hold_screen) {
@@ -1204,29 +1207,29 @@ wsdisplaystart(tp)
if (!(scr->scr_flags & SCR_GRAPHICS)) {
KASSERT(WSSCREEN_HAS_EMULATOR(scr));
(*scr->scr_dconf->wsemul->output)(scr->scr_dconf->wsemulcookie,
- buf, n, 0);
+ buf, n, 0);
}
ndflush(&tp->t_outq, n);
if ((n = ndqb(&tp->t_outq, 0)) > 0) {
buf = tp->t_outq.c_cf;
- if (!(scr->scr_flags & SCR_GRAPHICS)) {
- KASSERT(WSSCREEN_HAS_EMULATOR(scr));
- (*scr->scr_dconf->wsemul->output)(scr->scr_dconf->wsemulcookie,
- buf, n, 0);
- }
+ if (!(scr->scr_flags & SCR_GRAPHICS)) {
+ KASSERT(WSSCREEN_HAS_EMULATOR(scr));
+ (*scr->scr_dconf->wsemul->output)
+ (scr->scr_dconf->wsemulcookie, buf, n, 0);
+ }
ndflush(&tp->t_outq, n);
}
s = spltty();
tp->t_state &= ~TS_BUSY;
- /* Come back if there's more to do */
- if (tp->t_outq.c_cc) {
- tp->t_state |= TS_TIMEOUT;
- timeout_add(&tp->t_rstrt_to, (hz > 128) ? (hz / 128) : 1);
- }
+
+ tp->t_state |= TS_TIMEOUT;
+ timeout_add(&tp->t_rstrt_to, (hz > 128) ? (hz / 128) : 1);
+
if (tp->t_outq.c_cc <= tp->t_lowat) {
+low:
if (tp->t_state&TS_ASLEEP) {
tp->t_state &= ~TS_ASLEEP;
wakeup((caddr_t)&tp->t_outq);