summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2020-05-16 11:07:55 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2020-05-16 11:07:55 +0000
commit371f0f3c793a66419319bab111dcf88eafe78b1a (patch)
treee2377e285764db5fb7fb555a62c19c8dc5e37bdb /sys/dev/ic
parent744c152c5c4fa815f0132828a45cb15d71a26d62 (diff)
Don't attempt to reset the state of the flip-flop associated with the
vga attribute controller index or set the enable/'palette address source' bit when saving and restoring 256 colour vga palette with 0x3c6-0x3c9 as this does not touch the attribute registers. When this code was ported from FreeBSD in vga.c rev 1.48 the flip-flop reset parts were mistakenly made to read 0x3ca instead of 0x3da. Fixes a problem with VirtualBox where the text mode background was a dim red colour instead of black after VT switch. Problem reported by and patch from John Carmack. ok matthieu@ who notes this also fixes a similiar problem with a KVM / virt-manager virtual machine.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/vga.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/sys/dev/ic/vga.c b/sys/dev/ic/vga.c
index 74cc3e07bf8..b6bc080fdfb 100644
--- a/sys/dev/ic/vga.c
+++ b/sys/dev/ic/vga.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vga.c,v 1.69 2017/06/17 19:20:30 fcambus Exp $ */
+/* $OpenBSD: vga.c,v 1.70 2020/05/16 11:07:54 jsg Exp $ */
/* $NetBSD: vga.c,v 1.28.2.1 2000/06/30 16:27:47 simonb Exp $ */
/*-
@@ -1213,8 +1213,6 @@ vga_save_palette(struct vga_config *vc)
vga_raw_write(vh, VGA_DAC_READ, 0x00);
for (i = 0; i < 3 * 256; i++)
*palette++ = vga_raw_read(vh, VGA_DAC_DATA);
-
- vga_raw_read(vh, 0x0a); /* reset flip/flop */
}
void
@@ -1231,10 +1229,6 @@ vga_restore_palette(struct vga_config *vc)
vga_raw_write(vh, VGA_DAC_WRITE, 0x00);
for (i = 0; i < 3 * 256; i++)
vga_raw_write(vh, VGA_DAC_DATA, *palette++);
-
- vga_raw_read(vh, 0x0a); /* reset flip/flop */
-
- vga_enable(vh);
}
void