summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authordrochner <drochner@NetBSD.org>1999-03-22 18:24:23 +0000
committerdrochner <drochner@NetBSD.org>1999-03-22 18:24:23 +0000
commitb2c812d776aedfd20c1f3138b0667cd5af397315 (patch)
treeb80ef66855c4b3c2f80ba84409266242b2695549 /sys/dev
parent487d9f3582220ffc6de2765529c1429e6bae29ce (diff)
set "fontset" variables to 0 if no appropriate font was found for a
freshly allocated screen, should fix panic if "vga_mapchar()" it attempted later
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/vga.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/sys/dev/ic/vga.c b/sys/dev/ic/vga.c
index 3844bdf6355..566e944ba52 100644
--- a/sys/dev/ic/vga.c
+++ b/sys/dev/ic/vga.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vga.c,v 1.14 1999/02/20 18:27:53 drochner Exp $ */
+/* $NetBSD: vga.c,v 1.15 1999/03/22 18:24:23 drochner Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -296,7 +296,8 @@ bad:
}
/*
- * We want at least ASCII 32..255 be present.
+ * We want at least ASCII 32..127 be present in the
+ * first font slot.
*/
#define vga_valid_primary_font(f) \
(f->encoding == WSDISPLAY_FONTENC_IBM || \
@@ -306,7 +307,7 @@ int
vga_selectfont(vc, scr, name1, name2)
struct vga_config *vc;
struct vgascreen *scr;
- char *name1, *name2;
+ char *name1, *name2; /* NULL: take first found */
{
const struct wsscreen_descr *type = scr->pcs.type;
struct vgafont *f1, *f2;
@@ -332,6 +333,10 @@ vga_selectfont(vc, scr, name1, name2)
}
}
+ /*
+ * The request fails if no primary font was found,
+ * or if a second font was requested but not found.
+ */
if (f1 && (!name2 || f2)) {
#ifdef VGAFONTDEBUG
if (scr != &vga_console_screen || vga_console_attached) {
@@ -408,12 +413,15 @@ vga_init_screen(vc, scr, type, existing, attrp)
#endif
scr->pcs.mem = NULL;
+
+ scr->fontset1 = scr->fontset2 = 0;
if (vga_selectfont(vc, scr, 0, 0)) {
if (scr == &vga_console_screen)
panic("vga_init_screen: no font");
else
printf("vga_init_screen: no font\n");
}
+
vc->nscreens++;
LIST_INSERT_HEAD(&vc->screens, scr, next);
}