summaryrefslogtreecommitdiffstats
path: root/sys/dev/fb
diff options
context:
space:
mode:
authoryokota <yokota@FreeBSD.org>2000-01-10 08:49:49 +0000
committeryokota <yokota@FreeBSD.org>2000-01-10 08:49:49 +0000
commitfb454a04bb178fc0249a350d555c1782614d817d (patch)
tree877c2a95629e8cf7cad6b5487ceaf4004667f1f2 /sys/dev/fb
parent8bf15d0ff02fec1848db33c7e9aea06bdbb97a61 (diff)
downloadFreeBSD-src-fb454a04bb178fc0249a350d555c1782614d817d.zip
FreeBSD-src-fb454a04bb178fc0249a350d555c1782614d817d.tar.gz
Rework the algorithm to detect MDA/CGA/EGA/VGA cards, so that
the vga driver won't be fooled to believe it has a CGA card when in fact it is a VGA card.
Diffstat (limited to 'sys/dev/fb')
-rw-r--r--sys/dev/fb/vga.c46
1 files changed, 26 insertions, 20 deletions
diff --git a/sys/dev/fb/vga.c b/sys/dev/fb/vga.c
index 530484f..485b074 100644
--- a/sys/dev/fb/vga.c
+++ b/sys/dev/fb/vga.c
@@ -962,28 +962,34 @@ probe_adapters(void)
* type detected.
*/
#ifndef VGA_NO_BIOS
- switch ((rtcin(RTC_EQUIPMENT) >> 4) & 3) { /* bit 4 and 5 */
- case 0:
- /* EGA/VGA */
+ if (*(u_int32_t *)BIOS_PADDRTOVADDR(0x4a8)) {
+ /* EGA/VGA BIOS is present */
fill_adapter_param(readb(BIOS_PADDRTOVADDR(0x488)) & 0x0f,
biosadapter);
- break;
- case 1:
- /* CGA 40x25 */
- /* FIXME: switch to the 80x25 mode? XXX */
- biosadapter[V_ADP_PRIMARY] = adapter_init_value[DCC_CGA40];
- biosadapter[V_ADP_SECONDARY] = adapter_init_value[DCC_MONO];
- break;
- case 2:
- /* CGA 80x25 */
- biosadapter[V_ADP_PRIMARY] = adapter_init_value[DCC_CGA80];
- biosadapter[V_ADP_SECONDARY] = adapter_init_value[DCC_MONO];
- break;
- case 3:
- /* MDA */
- biosadapter[V_ADP_PRIMARY] = adapter_init_value[DCC_MONO];
- biosadapter[V_ADP_SECONDARY] = adapter_init_value[DCC_CGA80];
- break;
+ } else {
+ switch ((rtcin(RTC_EQUIPMENT) >> 4) & 3) { /* bit 4 and 5 */
+ case 0:
+ /* EGA/VGA: shouldn't be happening */
+ fill_adapter_param(readb(BIOS_PADDRTOVADDR(0x488)) & 0x0f,
+ biosadapter);
+ break;
+ case 1:
+ /* CGA 40x25 */
+ /* FIXME: switch to the 80x25 mode? XXX */
+ biosadapter[V_ADP_PRIMARY] = adapter_init_value[DCC_CGA40];
+ biosadapter[V_ADP_SECONDARY] = adapter_init_value[DCC_MONO];
+ break;
+ case 2:
+ /* CGA 80x25 */
+ biosadapter[V_ADP_PRIMARY] = adapter_init_value[DCC_CGA80];
+ biosadapter[V_ADP_SECONDARY] = adapter_init_value[DCC_MONO];
+ break;
+ case 3:
+ /* MDA */
+ biosadapter[V_ADP_PRIMARY] = adapter_init_value[DCC_MONO];
+ biosadapter[V_ADP_SECONDARY] = adapter_init_value[DCC_CGA80];
+ break;
+ }
}
#else
/* assume EGA/VGA? XXX */
OpenPOWER on IntegriCloud