summaryrefslogtreecommitdiff
path: root/sys/arch/sparc/dev/cgsix.c
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2008-12-26 22:30:22 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2008-12-26 22:30:22 +0000
commit98d45c69fbaee89aabba35e59ac5ad66df90eab5 (patch)
tree158772ef675dbfc4b9381e2b9a5aa47ba1944376 /sys/arch/sparc/dev/cgsix.c
parentbf3b6f2384dfb5783abe569c9796e049014076e7 (diff)
Move the logic responsible from deciding whether a frame buffer needs to be
cleared on attach, from the individual drivers to the common frame buffer code; the latter will decide based on the prom font metrics and the prom console window position, whenever possible. This removes the need for the console window position to be hardcoded in the p9100 driver, and will no longer require a screen clear on a vigra VS-12 in high resolution mode.
Diffstat (limited to 'sys/arch/sparc/dev/cgsix.c')
-rw-r--r--sys/arch/sparc/dev/cgsix.c28
1 files changed, 7 insertions, 21 deletions
diff --git a/sys/arch/sparc/dev/cgsix.c b/sys/arch/sparc/dev/cgsix.c
index db2c3ff7554..578aeae0a1b 100644
--- a/sys/arch/sparc/dev/cgsix.c
+++ b/sys/arch/sparc/dev/cgsix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgsix.c,v 1.39 2008/12/26 15:34:10 miod Exp $ */
+/* $OpenBSD: cgsix.c,v 1.40 2008/12/26 22:30:21 miod Exp $ */
/* $NetBSD: cgsix.c,v 1.33 1997/08/07 19:12:30 pk Exp $ */
/*
@@ -274,19 +274,10 @@ cgsixattach(struct device *parent, struct device *self, void *args)
CGSIX_VID_OFFSET, round_page(sc->sc_sunfb.sf_fbsize));
sc->sc_sunfb.sf_ro.ri_hw = sc;
- /*
- * If the framebuffer width is under 1024x768, we will 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);
+ printf("%dx%d, rev %d\n", sc->sc_sunfb.sf_width,
+ sc->sc_sunfb.sf_height, fhcrev);
+
+ fbwscons_init(&sc->sc_sunfb, isconsole);
fbwscons_setcolormap(&sc->sc_sunfb, cgsix_setcolor);
/*
@@ -304,13 +295,8 @@ cgsixattach(struct device *parent, struct device *self, void *args)
cgsix_ras_init(sc);
}
- printf("%dx%d, rev %d\n", sc->sc_sunfb.sf_width,
- sc->sc_sunfb.sf_height, fhcrev);
-
- if (isconsole) {
- fbwscons_console_init(&sc->sc_sunfb,
- sc->sc_sunfb.sf_width >= 1024 ? -1 : 0);
- }
+ if (isconsole)
+ fbwscons_console_init(&sc->sc_sunfb, -1);
fbwscons_attach(&sc->sc_sunfb, &cgsix_accessops, isconsole);
}