aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/fb
diff options
context:
space:
mode:
authorJung-uk Kim <jkim@FreeBSD.org>2012-02-16 22:46:00 +0000
committerJung-uk Kim <jkim@FreeBSD.org>2012-02-16 22:46:00 +0000
commit2f18ee9d47eef25c563aa6d184ce4e36d49eadd4 (patch)
tree98287d5f14eceff3b9898d18a77fec38bdd2183e /sys/dev/fb
parent60474b7b97983793760b2f59d101bcb32783cc7d (diff)
Notes
Diffstat (limited to 'sys/dev/fb')
-rw-r--r--sys/dev/fb/vesa.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/fb/vesa.c b/sys/dev/fb/vesa.c
index ee97ff1902a7..0ec8a5544a91 100644
--- a/sys/dev/fb/vesa.c
+++ b/sys/dev/fb/vesa.c
@@ -1311,7 +1311,9 @@ vesa_set_mode(video_adapter_t *adp, int mode)
if (!(info.vi_flags & V_INFO_GRAPHICS))
info.vi_flags &= ~V_INFO_LINEAR;
- if (vesa_bios_set_mode(mode | ((info.vi_flags & V_INFO_LINEAR) ? 0x4000 : 0)))
+ if ((info.vi_flags & V_INFO_LINEAR) != 0)
+ mode |= 0x4000;
+ if (vesa_bios_set_mode(mode))
return (1);
/* Palette format is reset by the above VBE function call. */
@@ -1329,7 +1331,7 @@ vesa_set_mode(video_adapter_t *adp, int mode)
#if VESA_DEBUG > 0
printf("VESA: mode set!\n");
#endif
- vesa_adp->va_mode = mode;
+ vesa_adp->va_mode = mode & 0x1ff; /* Mode number is 9-bit. */
vesa_adp->va_flags &= ~V_ADP_COLOR;
vesa_adp->va_flags |=
(info.vi_flags & V_INFO_COLOR) ? V_ADP_COLOR : 0;