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.
This commit is contained in:
parent
e27d79bb28
commit
fcaec66af7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=117710
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user