Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Oct 2013 14:37:20 +0000 (UTC)
From:      Aleksandr Rybalko <ray@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r256903 - user/ed/newcons/sys/dev/vt
Message-ID:  <201310221437.r9MEbKCj046499@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310221437.r9MEbKCj046499>