diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2008-12-26 23:46:20 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2008-12-26 23:46:20 +0000 |
commit | 3c16c7b79443caf0bd961413ae693609f3e0c9c9 (patch) | |
tree | d2532aa2084d99ba19476d741137be8de75ef3eb | |
parent | 98d45c69fbaee89aabba35e59ac5ad66df90eab5 (diff) |
Use the `fontbytes' display property as the font stride, instead of
computing it ourselves.
-rw-r--r-- | sys/arch/sparc/dev/p9100.c | 35 |
1 files changed, 20 insertions, 15 deletions
diff --git a/sys/arch/sparc/dev/p9100.c b/sys/arch/sparc/dev/p9100.c index e2e5f12a55c..0303bce2221 100644 --- a/sys/arch/sparc/dev/p9100.c +++ b/sys/arch/sparc/dev/p9100.c @@ -1,4 +1,4 @@ -/* $OpenBSD: p9100.c,v 1.47 2008/12/26 22:30:21 miod Exp $ */ +/* $OpenBSD: p9100.c,v 1.48 2008/12/26 23:46:19 miod Exp $ */ /* * Copyright (c) 2003, 2005, 2006, 2008, Miodrag Vallat. @@ -943,8 +943,8 @@ void p9100_pick_romfont(struct p9100_softc *sc) { struct rasops_info *ri = &sc->sc_sunfb.sf_ro; - int *romwidth, *romheight; - u_int8_t **romaddr; + int *fontwidth, *fontheight, *fontstride; + u_int8_t **fontaddr; char buf[200]; /* @@ -958,25 +958,30 @@ p9100_pick_romfont(struct p9100_softc *sc) * Get the PROM font metrics and address */ if (snprintf(buf, sizeof buf, "stdout @ is my-self " - "addr char-height %lx ! addr char-width %lx ! addr font-base %lx !", - (vaddr_t)&romheight, (vaddr_t)&romwidth, (vaddr_t)&romaddr) >= - sizeof buf) + "addr char-height %lx ! addr char-width %lx ! " + "addr font-base %lx ! addr fontbytes %lx !", + (vaddr_t)&fontheight, (vaddr_t)&fontwidth, + (vaddr_t)&fontaddr, (vaddr_t)&fontstride) >= sizeof buf) return; - romheight = romwidth = NULL; + fontheight = fontwidth = fontstride = NULL; + fontaddr = NULL; rominterpret(buf); - if (romheight == NULL || romwidth == NULL || romaddr == NULL || - *romheight == 0 || *romwidth == 0 || *romaddr == NULL) + if (fontheight == NULL || fontwidth == NULL || fontstride == NULL || + fontaddr == NULL || *fontheight == 0 || *fontwidth == 0 || + *fontstride < howmany(*fontwidth, NBBY) || + *fontstride > 4 /* paranoia */) return; - p9100_romfont.fontwidth = *romwidth; - p9100_romfont.fontheight = *romheight; - p9100_romfont.stride = howmany(*romwidth, NBBY); - p9100_romfont.data = *romaddr; + p9100_romfont.fontwidth = *fontwidth; + p9100_romfont.fontheight = *fontheight; + p9100_romfont.stride = *fontstride; + p9100_romfont.data = *fontaddr; #ifdef DEBUG - printf("%s: PROM font %dx%d @%p", - sc->sc_sunfb.sf_dev.dv_xname, *romwidth, *romheight, *romaddr); + printf("%s: PROM font %dx%d-%d @%p", + sc->sc_sunfb.sf_dev.dv_xname, *fontwidth, *fontheight, + *fontstride, *fontaddr); #endif /* |