diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2003-03-27 18:11:39 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2003-03-27 18:11:39 +0000 |
commit | 51dc9e2f188c1476a6d25a61ef23094517c255b1 (patch) | |
tree | 265b782f0c3251e30e0ad1212f099d36cdb1bf48 /sys/dev | |
parent | c93d758d08071e5499e097ab90fb13cd42627c95 (diff) |
map vid mem based on linebytes and height
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/sbus/cgthree.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/dev/sbus/cgthree.c b/sys/dev/sbus/cgthree.c index fbc59874d95..929598ce0e7 100644 --- a/sys/dev/sbus/cgthree.c +++ b/sys/dev/sbus/cgthree.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cgthree.c,v 1.26 2003/02/12 19:41:20 henric Exp $ */ +/* $OpenBSD: cgthree.c,v 1.27 2003/03/27 18:11:38 jason Exp $ */ /* * Copyright (c) 2001 Jason L. Wright (jason@thought.net) @@ -247,6 +247,11 @@ cgthreeattach(parent, self, aux) sc->sc_bustag = sa->sa_bustag; sc->sc_paddr = sbus_bus_addr(sa->sa_bustag, sa->sa_slot, sa->sa_offset); + 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); + if (sa->sa_nreg != 1) { printf(": expected %d registers, got %d\n", 1, sa->sa_nreg); goto fail; @@ -265,7 +270,7 @@ cgthreeattach(parent, self, aux) if (sbus_bus_map(sa->sa_bustag, sa->sa_reg[0].sbr_slot, sa->sa_reg[0].sbr_offset + CGTHREE_VID_OFFSET, - CGTHREE_VID_SIZE, BUS_SPACE_MAP_LINEAR, + 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; @@ -273,11 +278,6 @@ cgthreeattach(parent, self, aux) console = cgthree_is_console(sa->sa_node); - 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, &sc->sc_dev); cgthree_reset(sc); |