From owner-svn-src-all@freebsd.org Fri Aug 21 15:21:58 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01C8F9BF6FA; Fri, 21 Aug 2015 15:21:58 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6C0389F; Fri, 21 Aug 2015 15:21:57 +0000 (UTC) (envelope-from cem@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t7LFLvbv032851; Fri, 21 Aug 2015 15:21:57 GMT (envelope-from cem@FreeBSD.org) Received: (from cem@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t7LFLvAZ032848; Fri, 21 Aug 2015 15:21:57 GMT (envelope-from cem@FreeBSD.org) Message-Id: <201508211521.t7LFLvAZ032848@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: cem set sender to cem@FreeBSD.org using -f From: "Conrad E. Meyer" Date: Fri, 21 Aug 2015 15:21:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r286997 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 21 Aug 2015 15:21:58 -0000 Author: cem Date: Fri Aug 21 15:21:56 2015 New Revision: 286997 URL: https://svnweb.freebsd.org/changeset/base/286997 Log: vt_cpulogos: Resize all terms/windows when tearing down logos PR: 202288 (partial) Tested by: Jakob Alvermark Reviewed by: ed Approved by: markj (mentor) Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D3388 Modified: head/sys/dev/vt/vt.h head/sys/dev/vt/vt_core.c head/sys/dev/vt/vt_cpulogos.c Modified: head/sys/dev/vt/vt.h ============================================================================== --- head/sys/dev/vt/vt.h Fri Aug 21 15:20:01 2015 (r286996) +++ head/sys/dev/vt/vt.h Fri Aug 21 15:21:56 2015 (r286997) @@ -369,6 +369,7 @@ struct vt_driver { * Utility macro to make early vt(4) instances work. */ +extern struct vt_device vt_consdev; extern struct terminal vt_consterm; extern const struct terminal_class vt_termclass; void vt_upgrade(struct vt_device *vd); Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Fri Aug 21 15:20:01 2015 (r286996) +++ head/sys/dev/vt/vt_core.c Fri Aug 21 15:21:56 2015 (r286997) @@ -144,7 +144,6 @@ VT_SYSCTL_INT(splash_cpu_style, 2, "Draw "(0 = Alternate beastie, 1 = Beastie, 2 = Orb)"); VT_SYSCTL_INT(splash_cpu_duration, 10, "Hide logos after (seconds)"); -static struct vt_device vt_consdev; static unsigned int vt_unit = 0; static MALLOC_DEFINE(M_VT, "vt", "vt device"); struct vt_device *main_vd = &vt_consdev; @@ -187,7 +186,7 @@ SET_DECLARE(vt_drv_set, struct vt_driver struct terminal vt_consterm; static struct vt_window vt_conswindow; -static struct vt_device vt_consdev = { +struct vt_device vt_consdev = { .vd_driver = NULL, .vd_softc = NULL, .vd_prev_driver = NULL, Modified: head/sys/dev/vt/vt_cpulogos.c ============================================================================== --- head/sys/dev/vt/vt_cpulogos.c Fri Aug 21 15:20:01 2015 (r286996) +++ head/sys/dev/vt/vt_cpulogos.c Fri Aug 21 15:21:56 2015 (r286997) @@ -152,6 +152,7 @@ vt_fini_logos(void *dummy __unused) struct vt_font *vf; struct winsize wsz; term_pos_t size; + unsigned int i; if (!vt_draw_logo_cpus) return; @@ -160,44 +161,43 @@ vt_fini_logos(void *dummy __unused) if (!vt_splash_cpu) return; - tm = &vt_consterm; - vw = tm->tm_softc; - if (vw == NULL) - return; - vd = vw->vw_device; - if (vd == NULL) - return; - vf = vw->vw_font; - if (vf == NULL) - return; - + vd = &vt_consdev; VT_LOCK(vd); - if ((vd->vd_flags & (VDF_DEAD | VDF_TEXTMODE)) != 0) - goto out; - + if ((vd->vd_flags & (VDF_DEAD | VDF_TEXTMODE)) != 0) { + VT_UNLOCK(vd); + return; + } vt_draw_logo_cpus = 0; VT_UNLOCK(vd); - vt_termsize(vd, vf, &size); - vt_winsize(vd, vf, &wsz); - - /* Resize screen buffer and terminal. */ - terminal_mute(tm, 1); - vtbuf_grow(&vw->vw_buf, &size, vw->vw_buf.vb_history_size); - terminal_set_winsize_blank(tm, &wsz, 0, NULL); - terminal_set_cursor(tm, &vw->vw_buf.vb_cursor); - terminal_mute(tm, 0); - - VT_LOCK(vd); - vt_compute_drawable_area(vw); - - if (vd->vd_curwindow == vw) { - vd->vd_flags |= VDF_INVALID; - vt_resume_flush_timer(vd, 0); + for (i = 0; i < VT_MAXWINDOWS; i++) { + vw = vd->vd_windows[i]; + if (vw == NULL) + continue; + tm = vw->vw_terminal; + vf = vw->vw_font; + if (vf == NULL) + continue; + + vt_termsize(vd, vf, &size); + vt_winsize(vd, vf, &wsz); + + /* Resize screen buffer and terminal. */ + terminal_mute(tm, 1); + vtbuf_grow(&vw->vw_buf, &size, vw->vw_buf.vb_history_size); + terminal_set_winsize_blank(tm, &wsz, 0, NULL); + terminal_set_cursor(tm, &vw->vw_buf.vb_cursor); + terminal_mute(tm, 0); + + VT_LOCK(vd); + vt_compute_drawable_area(vw); + + if (vd->vd_curwindow == vw) { + vd->vd_flags |= VDF_INVALID; + vt_resume_flush_timer(vd, 0); + } + VT_UNLOCK(vd); } - -out: - VT_UNLOCK(vd); } static void