diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2006-08-14 12:24:32 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2006-08-14 12:24:32 +0000 |
commit | 1fe6f9aba02559893c021dd451e8c66f91073441 (patch) | |
tree | 88b6c411c99727533c1809828a88b29dd0f941b2 /sys/arch/sparc | |
parent | d70a9c32c4328490ae2803ae9d24cb5d55c0c2b5 (diff) |
Fix 640x480 mode operation (needs a font change, and stride is larger than
width in this mode).
Diffstat (limited to 'sys/arch/sparc')
-rw-r--r-- | sys/arch/sparc/dev/tvtwo.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/sys/arch/sparc/dev/tvtwo.c b/sys/arch/sparc/dev/tvtwo.c index 5c38de21c9c..4dc152b6fcc 100644 --- a/sys/arch/sparc/dev/tvtwo.c +++ b/sys/arch/sparc/dev/tvtwo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tvtwo.c,v 1.12 2006/06/02 20:00:54 miod Exp $ */ +/* $OpenBSD: tvtwo.c,v 1.13 2006/08/14 12:24:30 miod Exp $ */ /* * Copyright (c) 2003, 2006, Miodrag Vallat. * All rights reserved. @@ -238,7 +238,7 @@ tvtwoattach(struct device *parent, struct device *self, void *args) sc->sc_sunfb.sf_depth = 8; sc->sc_sunfb.sf_width = width; sc->sc_sunfb.sf_height = height; - sc->sc_sunfb.sf_linebytes = width; + sc->sc_sunfb.sf_linebytes = width >= 1024 ? width : 1024; sc->sc_sunfb.sf_fbsize = sc->sc_sunfb.sf_linebytes * height; /* Map the frame buffer memory area we're interested in. */ @@ -253,11 +253,18 @@ tvtwoattach(struct device *parent, struct device *self, void *args) sc->sc_sunfb.sf_ro.ri_hw = sc; sc->sc_sunfb.sf_ro.ri_bits = (u_char *)sc->sc_m8; - fbwscons_init(&sc->sc_sunfb, isconsole ? RI_CLEARMARGINS : RI_CLEAR); + + /* + * If the framebuffer width is under 1024, we will switch from + * the PROM font to the more adequate 8x16 font here. + */ + fbwscons_init(&sc->sc_sunfb, + isconsole && (width >= 1024) ? RI_CLEARMARGINS : RI_CLEAR); fbwscons_setcolormap(&sc->sc_sunfb, tvtwo_setcolor); if (isconsole) { - fbwscons_console_init(&sc->sc_sunfb, -1); + fbwscons_console_init(&sc->sc_sunfb, + width >= 1024 ? -1 : 0); } printf("%s: %dx%d\n", self->dv_xname, |