Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-5]: src/sys/arch/macppc/dev Pullup 1.16 [tsubai, mycroft]:
details: https://anonhg.NetBSD.org/src/rev/7ceee8020d51
branches: netbsd-1-5
changeset: 490076:7ceee8020d51
user: tv <tv%NetBSD.org@localhost>
date: Wed Nov 01 16:24:01 2000 +0000
description:
Pullup 1.16 [tsubai, mycroft]:
Get the correct OF node of the screen because PowerBooks have two screens
in one PCI device.
diffstat:
sys/arch/macppc/dev/ofb.c | 24 +++++++++++++++++++-----
1 files changed, 19 insertions(+), 5 deletions(-)
diffs (61 lines):
diff -r d1889e4bec32 -r 7ceee8020d51 sys/arch/macppc/dev/ofb.c
--- a/sys/arch/macppc/dev/ofb.c Wed Nov 01 16:13:48 2000 +0000
+++ b/sys/arch/macppc/dev/ofb.c Wed Nov 01 16:24:01 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ofb.c,v 1.13.2.1 2000/06/30 16:27:30 simonb Exp $ */
+/* $NetBSD: ofb.c,v 1.13.2.2 2000/11/01 16:24:01 tv Exp $ */
/*
* Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -129,7 +129,7 @@
struct ofb_softc *sc = (struct ofb_softc *)self;
struct pci_attach_args *pa = aux;
struct wsemuldisplaydev_attach_args a;
- int console;
+ int console, node;
struct ofb_devconfig *dc;
char devinfo[256];
@@ -137,9 +137,10 @@
if (console) {
dc = &ofb_console_dc;
+ node = dc->dc_node;
sc->nscreens = 1;
} else {
- int node, i, screenbytes;
+ int i, len, screenbytes;
dc = malloc(sizeof(struct ofb_devconfig), M_DEVBUF, M_WAITOK);
bzero(dc, sizeof(struct ofb_devconfig));
@@ -148,6 +149,14 @@
printf(": ofdev not found\n");
return;
}
+
+ /* XXX There are two child screens on PowerBook. */
+ bzero(devinfo, sizeof(devinfo));
+ OF_getprop(node, "device_type", devinfo, sizeof(devinfo));
+ len = strlen(devinfo);
+ if (strcmp(devinfo + len - 7, "-parent") == 0)
+ node = OF_child(node);
+
ofb_common_init(node, dc);
screenbytes = dc->dc_ri.ri_stride * dc->dc_ri.ri_height;
@@ -156,8 +165,13 @@
}
sc->sc_dc = dc;
- OF_getprop(dc->dc_node, "assigned-addresses", sc->sc_addrs,
- sizeof(sc->sc_addrs));
+ /* XXX */
+ if (OF_getprop(node, "assigned-addresses", sc->sc_addrs,
+ sizeof(sc->sc_addrs)) == -1) {
+ node = OF_parent(node);
+ OF_getprop(node, "assigned-addresses", sc->sc_addrs,
+ sizeof(sc->sc_addrs));
+ }
if (dc->dc_paddr == 0) {
printf(": cannot map framebuffer\n");
Home |
Main Index |
Thread Index |
Old Index