Module Name:    src
Committed By:   uwe
Date:           Thu Aug  9 23:56:35 UTC 2012

Modified Files:
        src/sys/dev/ic: vga.c

Log Message:
Reset flip/flop using dedicated vga_reset_state() macro we already have.
Explicit vga_raw_read() used here before was incorrect since it reads
from *wrong* io handle!

Fixes weird problem under VirtualBox where first switch to a different
VT caused text mode color 0 (normally black) to become something else.


To generate a diff of this commit:
cvs rdiff -u -r1.108 -r1.109 src/sys/dev/ic/vga.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ic/vga.c
diff -u src/sys/dev/ic/vga.c:1.108 src/sys/dev/ic/vga.c:1.109
--- src/sys/dev/ic/vga.c:1.108	Wed Jan 11 20:41:28 2012
+++ src/sys/dev/ic/vga.c	Thu Aug  9 23:56:35 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: vga.c,v 1.108 2012/01/11 20:41:28 macallan Exp $ */
+/* $NetBSD: vga.c,v 1.109 2012/08/09 23:56:35 uwe Exp $ */
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vga.c,v 1.108 2012/01/11 20:41:28 macallan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vga.c,v 1.109 2012/08/09 23:56:35 uwe Exp $");
 
 /* for WSCONS_SUPPORT_PCVTFONTS */
 #include "opt_wsdisplay_compat.h"
@@ -1565,7 +1565,7 @@ vga_save_palette(struct vga_config *vc)
 	for (i = 0; i < sizeof(vc->palette); i++)
 		*palette++ = vga_raw_read(vh, VGA_DAC_PALETTE);
 
-	vga_raw_read(vh, 0x0a);			/* reset flip/flop */
+	vga_reset_state(vh);			/* reset flip/flop */
 }
 
 void
@@ -1583,6 +1583,6 @@ vga_restore_palette(struct vga_config *v
 	for (i = 0; i < sizeof(vc->palette); i++)
 		vga_raw_write(vh, VGA_DAC_PALETTE, *palette++);
 
-	vga_raw_read(vh, 0x0a);			/* reset flip/flop */
+	vga_reset_state(vh);			/* reset flip/flop */
 	vga_enable(vh);
 }

Reply via email to