summaryrefslogtreecommitdiff
path: root/usr.sbin/wsfontload/wsfontload.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/wsfontload/wsfontload.c')
-rw-r--r--usr.sbin/wsfontload/wsfontload.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/usr.sbin/wsfontload/wsfontload.c b/usr.sbin/wsfontload/wsfontload.c
index a6841a655e3..1ed693f2d67 100644
--- a/usr.sbin/wsfontload/wsfontload.c
+++ b/usr.sbin/wsfontload/wsfontload.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wsfontload.c,v 1.22 2020/07/20 14:09:24 fcambus Exp $ */
+/* $OpenBSD: wsfontload.c,v 1.23 2020/08/05 13:56:06 fcambus Exp $ */
/* $NetBSD: wsfontload.c,v 1.2 2000/01/05 18:46:43 ad Exp $ */
/*
@@ -76,6 +76,7 @@ main(int argc, char *argv[])
{
char *wsdev, *infile, *p;
struct wsdisplay_font f;
+ struct wsdisplay_screentype screens;
int c, res, wsfd, ffd, type, list, i;
int defwidth, defheight;
struct stat stat;
@@ -178,23 +179,16 @@ main(int argc, char *argv[])
ffd = STDIN_FILENO;
}
- res = ioctl(wsfd, WSDISPLAYIO_GTYPE, &type);
- if (res != 0)
- type = WSDISPLAY_TYPE_UNKNOWN;
-
- switch (type) {
- /* text-mode VGA */
- case WSDISPLAY_TYPE_ISAVGA:
- case WSDISPLAY_TYPE_PCIVGA:
+ memset(&screens, 0, sizeof(screens));
+ res = ioctl(wsfd, WSDISPLAYIO_GETSCREENTYPE, &screens);
+ if (res == 0) {
+ /* raster frame buffers */
+ defwidth = screens.fontwidth;
+ defheight = screens.fontheight;
+ } else {
+ /* text-mode VGA */
defwidth = 8;
defheight = 16;
- break;
- /* raster frame buffers */
- default:
- /* XXX ought to be computed from the frame buffer resolution */
- defwidth = 12;
- defheight = 22;
- break;
}
f.index = -1;