Module Name: src Committed By: macallan Date: Mon Sep 21 13:23:43 UTC 2009
Modified Files: src/sys/arch/x86/x86: x86_autoconf.c Log Message: set is_console even if we don't have any fb_info so other console drivers than genfb have a chance of working. Tested with radeonfb which works fine with an RV280 TODO: figure out how to deal with more than one PCI_CLASS_DISPLAY device in a halfway sane manner To generate a diff of this commit: cvs rdiff -u -r1.44 -r1.45 src/sys/arch/x86/x86/x86_autoconf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/x86/x86/x86_autoconf.c diff -u src/sys/arch/x86/x86/x86_autoconf.c:1.44 src/sys/arch/x86/x86/x86_autoconf.c:1.45 --- src/sys/arch/x86/x86/x86_autoconf.c:1.44 Mon Aug 24 23:48:57 2009 +++ src/sys/arch/x86/x86/x86_autoconf.c Mon Sep 21 13:23:43 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: x86_autoconf.c,v 1.44 2009/08/24 23:48:57 jmcneill Exp $ */ +/* $NetBSD: x86_autoconf.c,v 1.45 2009/09/21 13:23:43 macallan Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.44 2009/08/24 23:48:57 jmcneill Exp $"); +__KERNEL_RCSID(0, "$NetBSD: x86_autoconf.c,v 1.45 2009/09/21 13:23:43 macallan Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -607,19 +607,38 @@ #endif fbinfo = lookup_bootinfo(BTINFO_FRAMEBUFFER); - if (fbinfo == NULL || fbinfo->physaddr == 0) - return; dict = device_properties(dev); - prop_dictionary_set_uint32(dict, "width", - fbinfo->width); - prop_dictionary_set_uint32(dict, "height", - fbinfo->height); - prop_dictionary_set_uint8(dict, "depth", - fbinfo->depth); - prop_dictionary_set_uint64(dict, "address", - fbinfo->physaddr); - prop_dictionary_set_uint16(dict, "linebytes", - fbinfo->stride); + /* + * framebuffer drivers other than genfb can work + * without the address property + */ + if (fbinfo != NULL) { + if (fbinfo->physaddr != 0) { + prop_dictionary_set_uint32(dict, "width", + fbinfo->width); + prop_dictionary_set_uint32(dict, "height", + fbinfo->height); + prop_dictionary_set_uint8(dict, "depth", + fbinfo->depth); + prop_dictionary_set_uint16(dict, "linebytes", + fbinfo->stride); + + prop_dictionary_set_uint64(dict, + "address", fbinfo->physaddr); + } +#if notyet + prop_dictionary_set_bool(dict, "splash", + fbinfo->flags & BI_FB_SPLASH ? + true : false); +#endif + if (fbinfo->depth == 8) { + gfb_cb.gcc_cookie = NULL; + gfb_cb.gcc_set_mapreg = + x86_genfb_set_mapreg; + prop_dictionary_set_uint64(dict, + "cmap_callback", (uint64_t)&gfb_cb); + } + } prop_dictionary_set_bool(dict, "is_console", true); prop_dictionary_set_bool(dict, "clear-screen", false); #if NWSDISPLAY > 0 && NGENFB > 0 @@ -630,12 +649,6 @@ prop_dictionary_set_bool(dict, "splash", fbinfo->flags & BI_FB_SPLASH ? true : false); #endif - if (fbinfo->depth == 8) { - gfb_cb.gcc_cookie = NULL; - gfb_cb.gcc_set_mapreg = x86_genfb_set_mapreg; - prop_dictionary_set_uint64(dict, - "cmap_callback", (uint64_t)&gfb_cb); - } pmf_cb.gpc_suspend = x86_genfb_suspend; pmf_cb.gpc_resume = x86_genfb_resume; prop_dictionary_set_uint64(dict,