Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Jan 2014 14:42:26 +0000 (UTC)
From:      Aleksandr Rybalko <ray@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r260450 - head/sys/dev/vt/hw/vga
Message-ID:  <201401081442.s08EgQ9X018360@svn.freebsd.org>

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



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