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/dev | |
parent | d70a9c32c4328490ae2803ae9d24cb5d55c0c2b5 (diff) |
Fix 640x480 mode operation (needs a font change, and stride is larger than
width in this mode).
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/sbus/tvtwo.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/sys/dev/sbus/tvtwo.c b/sys/dev/sbus/tvtwo.c index accc8ddcd82..57992a03b78 100644 --- a/sys/dev/sbus/tvtwo.c +++ b/sys/dev/sbus/tvtwo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tvtwo.c,v 1.9 2006/06/02 20:00:56 miod Exp $ */ +/* $OpenBSD: tvtwo.c,v 1.10 2006/08/14 12:24:31 miod Exp $ */ /* * Copyright (c) 2003, 2006, Miodrag Vallat. * All rights reserved. @@ -258,7 +258,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. */ @@ -283,10 +283,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, |