summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2003-08-01 19:24:50 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2003-08-01 19:24:50 +0000
commit3d990c6a5ea3b3f437b0ba042d4143535ab49bc6 (patch)
treee3f710101bddbffc54644a00445ba6052a18aa94
parent6b714c70f58688e499d5a6e81b8927c931c89cc3 (diff)
The Vigra VS10-EK is recognized as a cgthree clone, but due to its utterly
ridiculous resolution, we need to plug the "clear the screen and switch font" trick here too. [Thanks to Andrey Smagin for providing a card for testing]
-rw-r--r--sys/arch/sparc/dev/cgthree.c32
-rw-r--r--sys/dev/sbus/cgthree.c26
2 files changed, 44 insertions, 14 deletions
diff --git a/sys/arch/sparc/dev/cgthree.c b/sys/arch/sparc/dev/cgthree.c
index 0e8b7cca2a4..aac4ecf9e0f 100644
--- a/sys/arch/sparc/dev/cgthree.c
+++ b/sys/arch/sparc/dev/cgthree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgthree.c,v 1.23 2003/06/28 17:05:33 miod Exp $ */
+/* $OpenBSD: cgthree.c,v 1.24 2003/08/01 19:24:49 miod Exp $ */
/* $NetBSD: cgthree.c,v 1.33 1997/05/24 20:16:11 pk Exp $ */
/*
@@ -72,8 +72,9 @@
*/
/*
- * color display (cgthree) driver.
- *
+ * Color display (cgthree) driver.
+ * Works with the real Sun hardware, as well as various clones from Tatung,
+ * Integrix (S20), and the Vigra VS10-EK.
*/
#include <sys/param.h>
@@ -302,7 +303,23 @@ cgthreeattach(parent, self, args)
sc->sc_sunfb.sf_ro.ri_bits = mapiodev(ca->ca_ra.ra_reg, CG3REG_MEM,
round_page(sc->sc_sunfb.sf_fbsize));
sc->sc_sunfb.sf_ro.ri_hw = sc;
- fbwscons_init(&sc->sc_sunfb, isconsole ? 0 : RI_CLEAR);
+
+ printf(", %dx%d\n", sc->sc_sunfb.sf_width, sc->sc_sunfb.sf_height);
+
+ /*
+ * If the framebuffer width is under 1024x768, which is the case for
+ * some clones on laptops, as well as with the VS10-EK, switch from
+ * the PROM font to the more adequate 8x16 font here.
+ * However, we need to adjust two things in this case:
+ * - the display row should be overrided from the current PROM metrics,
+ * to prevent us from overwriting the last few lines of text.
+ * - if the 80x34 screen would make a large margin appear around it,
+ * choose to clear the screen rather than keeping old prom output in
+ * the margins.
+ * XXX there should be a rasops "clear margins" feature
+ */
+ fbwscons_init(&sc->sc_sunfb, isconsole &&
+ (sc->sc_sunfb.sf_width >= 1024) ? 0 : RI_CLEAR);
fbwscons_setcolormap(&sc->sc_sunfb, cgthree_setcolor);
cgthree_stdscreen.capabilities = sc->sc_sunfb.sf_ro.ri_caps;
@@ -310,12 +327,11 @@ cgthreeattach(parent, self, args)
cgthree_stdscreen.ncols = sc->sc_sunfb.sf_ro.ri_cols;
cgthree_stdscreen.textops = &sc->sc_sunfb.sf_ro.ri_ops;
- printf(", %dx%d\n", sc->sc_sunfb.sf_width, sc->sc_sunfb.sf_height);
-
if (isconsole) {
- fbwscons_console_init(&sc->sc_sunfb, &cgthree_stdscreen, -1,
- cgthree_burner);
+ fbwscons_console_init(&sc->sc_sunfb, &cgthree_stdscreen,
+ sc->sc_sunfb.sf_width >= 1024 ? -1 : 0, cgthree_burner);
}
+
#if defined(SUN4C) || defined(SUN4M)
if (sbus)
sbus_establish(&sc->sc_sd, &sc->sc_sunfb.sf_dev);
diff --git a/sys/dev/sbus/cgthree.c b/sys/dev/sbus/cgthree.c
index c2c03089b88..2cc7eac5b9e 100644
--- a/sys/dev/sbus/cgthree.c
+++ b/sys/dev/sbus/cgthree.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgthree.c,v 1.34 2003/07/03 21:02:13 jason Exp $ */
+/* $OpenBSD: cgthree.c,v 1.35 2003/08/01 19:24:47 miod Exp $ */
/*
* Copyright (c) 2001 Jason L. Wright (jason@thought.net)
@@ -270,21 +270,35 @@ cgthreeattach(struct device *parent, struct device *self, void *aux)
sc->sc_sunfb.sf_ro.ri_bits = (void *)bus_space_vaddr(sc->sc_bustag,
sc->sc_vid_regs);
sc->sc_sunfb.sf_ro.ri_hw = sc;
- fbwscons_init(&sc->sc_sunfb, console ? 0 : RI_CLEAR);
+
+ printf("\n");
+
+ /*
+ * If the framebuffer width is under 1024x768, which is the case for
+ * some clones on laptops, as well as with the VS10-EK, switch from
+ * the PROM font to the more adequate 8x16 font here.
+ * However, we need to adjust two things in this case:
+ * - the display row should be overrided from the current PROM metrics,
+ * to prevent us from overwriting the last few lines of text.
+ * - if the 80x34 screen would make a large margin appear around it,
+ * choose to clear the screen rather than keeping old prom output in
+ * the margins.
+ * XXX there should be a rasops "clear margins" feature
+ */
+ fbwscons_init(&sc->sc_sunfb, console &&
+ (sc->sc_sunfb.sf_width >= 1024) ? 0 : RI_CLEAR);
cgthree_stdscreen.capabilities = sc->sc_sunfb.sf_ro.ri_caps;
cgthree_stdscreen.nrows = sc->sc_sunfb.sf_ro.ri_rows;
cgthree_stdscreen.ncols = sc->sc_sunfb.sf_ro.ri_cols;
cgthree_stdscreen.textops = &sc->sc_sunfb.sf_ro.ri_ops;
- printf("\n");
-
fbwscons_setcolormap(&sc->sc_sunfb, cgthree_setcolor);
if (console) {
sc->sc_sunfb.sf_ro.ri_updatecursor = cgthree_updatecursor;
- fbwscons_console_init(&sc->sc_sunfb, &cgthree_stdscreen, -1,
- cgthree_burner);
+ fbwscons_console_init(&sc->sc_sunfb, &cgthree_stdscreen,
+ sc->sc_sunfb.sf_width >= 1024 ? -1 : 0, cgthree_burner);
}
waa.console = console;