summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJason Wright <jason@cvs.openbsd.org>2003-03-20 15:42:07 +0000
committerJason Wright <jason@cvs.openbsd.org>2003-03-20 15:42:07 +0000
commita972201e4b0ffc3fbdba61cffb781d06e40c23cf (patch)
treee3114f45bf565bc922cbd3429e65c40f3abe36e1 /sys
parent0dcce2a0f9b4867029e7ab82defdb9e4fd77fe17 (diff)
Compute linebytes and such earlier and use them to decide how much
memory to map. (fixes the TGX+ running in 1280x1024x8 mode). ok miod, millert.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/sbus/cgsix.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/dev/sbus/cgsix.c b/sys/dev/sbus/cgsix.c
index 1c8c6eab150..8f101c5e0f7 100644
--- a/sys/dev/sbus/cgsix.c
+++ b/sys/dev/sbus/cgsix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgsix.c,v 1.34 2003/02/12 19:41:20 henric Exp $ */
+/* $OpenBSD: cgsix.c,v 1.35 2003/03/20 15:42:06 jason Exp $ */
/*
* Copyright (c) 2001 Jason L. Wright (jason@thought.net)
@@ -155,6 +155,11 @@ cgsixattach(parent, self, aux)
goto fail;
}
+ sc->sc_depth = getpropint(sa->sa_node, "depth", 8);
+ sc->sc_linebytes = getpropint(sa->sa_node, "linebytes", 1152);
+ sc->sc_height = getpropint(sa->sa_node, "height", 900);
+ sc->sc_width = getpropint(sa->sa_node, "width", 1152);
+
/*
* Map just BT, FHC, FBC, THC, and video RAM.
*/
@@ -181,7 +186,8 @@ cgsixattach(parent, self, aux)
if (sbus_bus_map(sa->sa_bustag, sa->sa_reg[0].sbr_slot,
sa->sa_reg[0].sbr_offset + CGSIX_VID_OFFSET,
- CGSIX_VID_SIZE, BUS_SPACE_MAP_LINEAR, 0, &sc->sc_vid_regs) != 0) {
+ sc->sc_linebytes * sc->sc_height, BUS_SPACE_MAP_LINEAR,
+ 0, &sc->sc_vid_regs) != 0) {
printf(": cannot map vid registers\n");
goto fail_vid;
}
@@ -226,11 +232,6 @@ cgsixattach(parent, self, aux)
cgsix_burner(sc, 1, 0);
- sc->sc_depth = getpropint(sa->sa_node, "depth", 8);
- sc->sc_linebytes = getpropint(sa->sa_node, "linebytes", 1152);
- sc->sc_height = getpropint(sa->sa_node, "height", 900);
- sc->sc_width = getpropint(sa->sa_node, "width", 1152);
-
sbus_establish(&sc->sc_sd, self);
sc->sc_rasops.ri_depth = sc->sc_depth;