svn commit: r260450 - head/sys/dev/vt/hw/vga

Aleksandr Rybalko ray at FreeBSD.org
Wed Jan 8 14:42:27 UTC 2014


Author: ray
Date: Wed Jan  8 14:42:26 2014
New Revision: 260450
URL: http://svnweb.freebsd.org/changeset/base/260450

Log:
  Restore VGA mode on vt switch. It fix VESA mode left by Xorg on exit.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  head/sys/dev/vt/hw/vga/vga.c

Modified: head/sys/dev/vt/hw/vga/vga.c
==============================================================================
--- head/sys/dev/vt/hw/vga/vga.c	Wed Jan  8 14:36:35 2014	(r260449)
+++ head/sys/dev/vt/hw/vga/vga.c	Wed Jan  8 14:42:26 2014	(r260450)
@@ -75,12 +75,14 @@ static vd_init_t	vga_init;
 static vd_blank_t	vga_blank;
 static vd_bitbltchr_t	vga_bitbltchr;
 static vd_putchar_t	vga_putchar;
+static vd_postswitch_t	vga_postswitch;
 
 static const struct vt_driver vt_vga_driver = {
 	.vd_init	= vga_init,
 	.vd_blank	= vga_blank,
 	.vd_bitbltchr	= vga_bitbltchr,
 	.vd_putchar	= vga_putchar,
+	.vd_postswitch	= vga_postswitch,
 	.vd_priority	= VD_PRIORITY_GENERIC,
 };
 
@@ -602,3 +604,13 @@ vga_init(struct vt_device *vd)
 
 	return (CN_INTERNAL);
 }
+
+static void
+vga_postswitch(struct vt_device *vd)
+{
+
+	/* Reinit VGA mode, to restore view after app which change mode. */
+	vga_initialize(vd, (vd->vd_flags & VDF_TEXTMODE));
+	/* Ask vt(9) to update chars on visible area. */
+	vd->vd_flags |= VDF_INVALID;
+}


More information about the svn-src-all mailing list