From owner-svn-src-user@FreeBSD.ORG Tue Oct 22 14:37:21 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 4A1CB796; Tue, 22 Oct 2013 14:37:21 +0000 (UTC) (envelope-from ray@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 1BA562F72; Tue, 22 Oct 2013 14:37:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r9MEbKa7046500; Tue, 22 Oct 2013 14:37:20 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r9MEbKCj046499; Tue, 22 Oct 2013 14:37:20 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201310221437.r9MEbKCj046499@svn.freebsd.org> From: Aleksandr Rybalko Date: Tue, 22 Oct 2013 14:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r256903 - user/ed/newcons/sys/dev/vt X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Oct 2013 14:37:21 -0000 Author: ray Date: Tue Oct 22 14:37:20 2013 New Revision: 256903 URL: http://svnweb.freebsd.org/changeset/base/256903 Log: o Do not blank screen on window resize. o Force resize for first window (usually console). o Inform user on driver changes. o Reverse priority. Bigger now better. Sponsored by: The FreeBSD Foundation Modified: user/ed/newcons/sys/dev/vt/vt_core.c Modified: user/ed/newcons/sys/dev/vt/vt_core.c ============================================================================== --- user/ed/newcons/sys/dev/vt/vt_core.c Tue Oct 22 14:32:42 2013 (r256902) +++ user/ed/newcons/sys/dev/vt/vt_core.c Tue Oct 22 14:37:20 2013 (r256903) @@ -640,8 +640,7 @@ vt_flush(struct vt_device *vd) continue; vt_bitblt_char(vd, vf, r[col], - VTBUF_ISCURSOR(&vw->vw_buf, row, col), - row, col); + VTBUF_ISCURSOR(&vw->vw_buf, row, col), row, col); } } } @@ -900,7 +899,7 @@ vt_change_font(struct vt_window *vw, str /* Grow the screen buffer and terminal. */ terminal_mute(tm, 1); vtbuf_grow(&vw->vw_buf, &size, vw->vw_buf.vb_history_size); - terminal_set_winsize(tm, &wsz); + terminal_set_winsize_blank(tm, &wsz, 0); terminal_mute(tm, 0); /* Actually apply the font to the current window. */ @@ -1381,17 +1380,23 @@ void vt_allocate(struct vt_driver *drv, void *softc) { struct vt_device *vd; + struct winsize wsz; if (main_vd == NULL) { main_vd = malloc(sizeof *vd, M_VT, M_WAITOK|M_ZERO); + printf("%s: VT initialize with new VT driver.\n", __func__); } else { /* * Check if have rights to replace current driver. For example: * it is bad idea to replace KMS driver with generic VGA one. */ - /* Lowest preferred. */ - if (drv->vd_priority >= main_vd->vd_driver->vd_priority) + if (drv->vd_priority <= main_vd->vd_driver->vd_priority) { + printf("%s: Driver priority %d too low. Current %d\n ", + __func__, drv->vd_priority, + main_vd->vd_driver->vd_priority); return; + } + printf("%s: Replace existing VT driver.\n", __func__); } vd = main_vd; @@ -1415,4 +1420,8 @@ vt_allocate(struct vt_driver *drv, void callout_schedule(&vd->vd_timer, hz / VT_TIMERFREQ); termcn_cnregister(vd->vd_windows[VT_CONSWINDOW]->vw_terminal); + + /* Update console window sizes to actual. */ + vt_winsize(vd, vd->vd_windows[VT_CONSWINDOW]->vw_font, &wsz); + terminal_set_winsize(vd->vd_windows[VT_CONSWINDOW]->vw_terminal, &wsz); }