Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/macppc/dev * Don't try to clear the screen if we fa...



details:   https://anonhg.NetBSD.org/src/rev/e32900aa1cca
branches:  trunk
changeset: 572041:e32900aa1cca
user:      briggs <briggs%NetBSD.org@localhost>
date:      Wed Dec 15 04:52:05 2004 +0000

description:
* Don't try to clear the screen if we failed to map it.
* Don't try to call OF_open for /chaos@F0000000/control@B -- it hangs.

diffstat:

 sys/arch/macppc/dev/ofb.c |  31 ++++++++++++++++++++++++-------
 1 files changed, 24 insertions(+), 7 deletions(-)

diffs (73 lines):

diff -r 0aaac6d24f0e -r e32900aa1cca sys/arch/macppc/dev/ofb.c
--- a/sys/arch/macppc/dev/ofb.c Wed Dec 15 04:25:19 2004 +0000
+++ b/sys/arch/macppc/dev/ofb.c Wed Dec 15 04:52:05 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ofb.c,v 1.39 2004/04/24 15:49:00 kleink Exp $  */
+/*     $NetBSD: ofb.c,v 1.40 2004/12/15 04:52:05 briggs Exp $  */
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ofb.c,v 1.39 2004/04/24 15:49:00 kleink Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ofb.c,v 1.40 2004/12/15 04:52:05 briggs Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -154,7 +154,7 @@
                node = dc->dc_node;
                sc->nscreens = 1;
        } else {
-               int i, len, screenbytes;
+               int len;
 
                dc = malloc(sizeof(struct ofb_devconfig), M_DEVBUF, M_WAITOK);
                memset(dc, 0, sizeof(struct ofb_devconfig));
@@ -172,10 +172,6 @@
                        node = OF_child(node);
 
                ofb_common_init(node, dc);
-
-               screenbytes = dc->dc_ri.ri_stride * dc->dc_ri.ri_height;
-               for (i = 0; i < screenbytes; i += sizeof(u_int32_t))
-                       *(u_int32_t *)(dc->dc_paddr + i) = 0xffffffff;
        }
        sc->sc_dc = dc;
 
@@ -195,6 +191,18 @@
                return;
        }
 
+       /*
+        * Clear the screen here, instead of above, in case
+        * ofb_common_init() failed to map the framebuffer.
+        */
+       if (!console) {
+               int i, screenbytes;
+
+               screenbytes = dc->dc_ri.ri_stride * dc->dc_ri.ri_height;
+               for (i = 0; i < screenbytes; i += sizeof(u_int32_t))
+                       *(u_int32_t *)(dc->dc_paddr + i) = 0xffffffff;
+       }
+
        pci_devinfo(pa->pa_id, pa->pa_class, 0, devinfo, sizeof(devinfo));
        printf(": %s\n", devinfo);
        printf("%s: %d x %d, %dbpp\n", self->dv_xname,
@@ -227,6 +235,15 @@
 
                memset(name, 0, 64);
                OF_package_to_path(node, name, sizeof(name));
+
+               /*
+                * /chaos/control on some boxes hangs up in OF_open.
+                * If we return here, we get "can't map frame buffer"
+                * which isn't really a big deal in these cases.
+                */
+               if (!strncmp(name, "/chaos@F0000000/control@B", sizeof(name)))
+                       return;
+
                dc->dc_ih = OF_open(name);
        }
 



Home | Main Index | Thread Index | Old Index