summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2008-04-28 19:28:38 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2008-04-28 19:28:38 +0000
commitc617c51eb72d49626182c34850d356c5c399f65d (patch)
tree36b26ff903875b2140ad3b6d49abb6f36669f546
parent46b5a99c47d9e9af2e1493e6d329295f3936bc7c (diff)
Do not alter mode parameter in vesafb_set_mode(), since we might ask for a
non-linear-graphics mode; found the hard way by Yusuke Baba (babayaga1 , y8 dot dion dot ne dot jp), thanks for the report.
-rw-r--r--sys/dev/vesa/vesafb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/vesa/vesafb.c b/sys/dev/vesa/vesafb.c
index 5987515d8fb..476b533f004 100644
--- a/sys/dev/vesa/vesafb.c
+++ b/sys/dev/vesa/vesafb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vesafb.c,v 1.5 2007/11/25 16:43:39 jmc Exp $ */
+/* $OpenBSD: vesafb.c,v 1.6 2008/04/28 19:28:37 miod Exp $ */
/*-
* Copyright (c) 2006 Jared D. McNeill <jmcneill@invisible.ca>
@@ -231,7 +231,7 @@ vesafb_set_mode(struct vga_pci_softc *sc, int mode)
bzero(&tf, sizeof(struct trapframe));
tf.tf_eax = VBE_FUNC_SETMODE;
- tf.tf_ebx = mode | 0x4000; /* flat */
+ tf.tf_ebx = mode;
res = kvm86_bioscall(BIOS_VIDEO_INTR, &tf);
if (res || VBECALL_SUPPORT(tf.tf_eax) != VBECALL_SUPPORTED) {
@@ -269,7 +269,7 @@ vesafb_find_mode(struct vga_pci_softc *sc, int width, int height, int bpp)
if (i == vesabios_softc->sc_nmodes)
return -1;
else
- return vesabios_softc->sc_modes[i];
+ return vesabios_softc->sc_modes[i] | 0x4000; /* flat */
}
int