From owner-svn-src-all@FreeBSD.ORG Wed Jan 8 14:42:27 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2F212EA6; Wed, 8 Jan 2014 14:42:27 +0000 (UTC) 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 1B39510A1; Wed, 8 Jan 2014 14:42:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s08EgQGT018361; Wed, 8 Jan 2014 14:42:26 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s08EgQ9X018360; Wed, 8 Jan 2014 14:42:26 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201401081442.s08EgQ9X018360@svn.freebsd.org> From: Aleksandr Rybalko Date: Wed, 8 Jan 2014 14:42:26 +0000 (UTC) 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 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.17 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: Wed, 08 Jan 2014 14:42:27 -0000 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; +}