diff options
author | robert <robert@FreeBSD.org> | 2003-07-18 00:06:10 +0000 |
---|---|---|
committer | robert <robert@FreeBSD.org> | 2003-07-18 00:06:10 +0000 |
commit | 5d7e53d23e6b1542634f43d15f2e618e1e1c4c10 (patch) | |
tree | 084cc86a627c8c6d6c172dc307f3d8f5f5b36bc6 /sys | |
parent | 788547d4cf2856cc0d849f205d6384723345026b (diff) | |
download | FreeBSD-src-5d7e53d23e6b1542634f43d15f2e618e1e1c4c10.zip FreeBSD-src-5d7e53d23e6b1542634f43d15f2e618e1e1c4c10.tar.gz |
Make the 80x60, 132x25, 132x43, 132x50, and 132x60 VESA text modes
work when using a graphics chipset which identifies itself as
`VIA CLE266', used in some VIA EPIA boards. Two values need to be
patched in the VESA mode information structure: the widths of the modes
mentioned above are encoded in a format which was unknown to the VESA
module (and to my copy of the VBE spec.) whereas the window memory
segment values seem to be just incorrect.
I tested this on a VIA EPIA-M9000 and -M10000.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/i386/isa/vesa.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/i386/isa/vesa.c b/sys/i386/isa/vesa.c index ebb41ff..7c4a2ad 100644 --- a/sys/i386/isa/vesa.c +++ b/sys/i386/isa/vesa.c @@ -58,6 +58,8 @@ __FBSDID("$FreeBSD$"); #include <i386/isa/isa.h> #endif +#define VESA_VIA_CLE266 "VIA CLE266\r\n" + #ifndef VESA_DEBUG #define VESA_DEBUG 0 #endif @@ -607,6 +609,7 @@ vesa_bios_init(void) struct vesa_mode vmode; video_info_t *p; u_char *vmbuf; + int is_via_cle266; int modes; int err; int i; @@ -649,6 +652,8 @@ vesa_bios_init(void) /* fix string ptrs */ vesa_oemstr = (char *)vesa_fix_ptr(vesa_adp_info->v_oemstr, vmf.vmf_es, vmf.vmf_di, buf); + is_via_cle266 = strcmp(vesa_oemstr, VESA_VIA_CLE266) == 0; + if (vesa_adp_info->v_version >= 0x0200) { vesa_venderstr = (char *)vesa_fix_ptr(vesa_adp_info->v_venderstr, @@ -712,6 +717,13 @@ vesa_bios_init(void) vmode.v_modeattr & V_MODEGRAPHICS ? "graphics" : "text", vmode.v_width, vmode.v_height, vmode.v_bpp); #endif + if (is_via_cle266) { + if ((vmode.v_width & 0xff00) >> 8 == vmode.v_height - 1) { + vmode.v_width &= 0xff; + vmode.v_waseg = 0xb8000 >> 4; + } + } + /* copy some fields */ bzero(&vesa_vmode[modes], sizeof(vesa_vmode[modes])); vesa_vmode[modes].vi_mode = vesa_vmodetab[i]; |