From 23f9222c11003c11e92e530e2761586922fc46f5 Mon Sep 17 00:00:00 2001 From: macallan Date: Tue, 7 Aug 2007 01:59:23 +0000 Subject: [PATCH] if we can't determine the console framebuffer's depth assume it's 8bit Mainly for /chaos/control which doesn't have any useful properties on its node --- sys/arch/macppc/macppc/autoconf.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/sys/arch/macppc/macppc/autoconf.c b/sys/arch/macppc/macppc/autoconf.c index 318e7a9490b3..be546892729d 100644 --- a/sys/arch/macppc/macppc/autoconf.c +++ b/sys/arch/macppc/macppc/autoconf.c @@ -1,4 +1,4 @@ -/* $NetBSD: autoconf.c,v 1.57 2007/04/14 19:56:05 macallan Exp $ */ +/* $NetBSD: autoconf.c,v 1.58 2007/08/07 01:59:23 macallan Exp $ */ /* * Copyright (C) 1995, 1996 Wolfgang Solfrank. @@ -32,7 +32,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.57 2007/04/14 19:56:05 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.58 2007/08/07 01:59:23 macallan Exp $"); #include #include @@ -554,7 +554,14 @@ copyprops(int node, prop_dictionary_t dict) prop_dictionary_set_uint32(dict, "height", temp); } OF_to_intprop(dict, console_node, "linebytes", "linebytes"); - OF_to_intprop(dict, console_node, "depth", "depth"); + if (!OF_to_intprop(dict, console_node, "depth", "depth")) { + /* + * XXX we should check linebytes vs. width but those + * FBs that don't have a depth property ( /chaos/control... ) + * won't have linebytes either + */ + prop_dictionary_set_uint32(dict, "depth", 8); + } if (!OF_to_intprop(dict, console_node, "address", "address")) { uint32_t fbaddr = 0; OF_interpret("frame-buffer-adr", 0, 1, &fbaddr);