diff options
author | H. Peter Anvin <hpa@zytor.com> | 2006-09-30 10:50:56 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2006-09-30 10:50:56 -0700 |
commit | e573c2a208e9194cfce053adc093ddc452e0c7d7 (patch) | |
tree | bbd957e1af099b563d498d817efcce3858231322 | |
parent | 1dc565cf36d53925abceb6897e1c686aaee6493e (diff) | |
download | syslinux.git-e573c2a208e9194cfce053adc093ddc452e0c7d7.tar.gz syslinux.git-e573c2a208e9194cfce053adc093ddc452e0c7d7.tar.xz syslinux.git-e573c2a208e9194cfce053adc093ddc452e0c7d7.zip |
vesainit: more careful detection of VESA modes
-rw-r--r-- | com32/lib/sys/vesa/initvesa.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/com32/lib/sys/vesa/initvesa.c b/com32/lib/sys/vesa/initvesa.c index 35084449..bcdcc09d 100644 --- a/com32/lib/sys/vesa/initvesa.c +++ b/com32/lib/sys/vesa/initvesa.c @@ -116,9 +116,13 @@ static int vesacon_set_mode(void) return 1; /* Function call failed */ if ( gi->signature != VESA_MAGIC ) return 2; /* No magic */ +#if 1 + /* Linear frame buffer is a VBE 2.0 feature. In theory this + test is redundant given that we check the bitmasks. */ if ( gi->version < 0x0200 ) { return 3; /* VESA 2.0 not supported */ } +#endif /* Copy general info */ memcpy(&__vesa_info.gi, gi, sizeof *gi); @@ -145,8 +149,16 @@ static int vesacon_set_mode(void) mi->mode_attr, mi->h_res, mi->v_res, mi->bpp, mi->memory_layout, mi->rpos, mi->gpos, mi->bpos); - /* Must be an LFB color graphics mode supported by the hardware */ - if ( (mi->mode_attr & 0x0099) != 0x0099 ) + /* Must be an LFB color graphics mode supported by the hardware. + + The bits tested are: + 7 - linear frame buffer available + 4 - graphics mode + 3 - color mode + 1 - mode information available (mandatory in VBE 1.2+) + 0 - mode supported by hardware + */ + if ( (mi->mode_attr & 0x009b) != 0x009b ) continue; /* Must be 640x480, 32 bpp */ |