probe as console devices which have a "class-code" property corresponding to

PCI_CLASS_DISPLAY, and not just those which have a "display" device_type.
In the case where each head is a subnode of the graphics card, it's the heads
which have a "display" device_type.

Maybe only testing "class-code" would make sense if this property is defined
on any openfirmware based PowerPC platform.
This commit is contained in:
aymeric 2008-01-09 17:45:46 +00:00
parent 71c98bab0d
commit f5f76a59f0
1 changed files with 12 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: ofw_autoconf.c,v 1.5 2007/12/16 16:42:12 phx Exp $ */ /* $NetBSD: ofw_autoconf.c,v 1.6 2008/01/09 17:45:46 aymeric Exp $ */
/* /*
* Copyright (C) 1995, 1996 Wolfgang Solfrank. * Copyright (C) 1995, 1996 Wolfgang Solfrank.
* Copyright (C) 1995, 1996 TooLs GmbH. * Copyright (C) 1995, 1996 TooLs GmbH.
@ -31,7 +31,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ofw_autoconf.c,v 1.5 2007/12/16 16:42:12 phx Exp $"); __KERNEL_RCSID(0, "$NetBSD: ofw_autoconf.c,v 1.6 2008/01/09 17:45:46 aymeric Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/conf.h> #include <sys/conf.h>
@ -46,6 +46,7 @@ __KERNEL_RCSID(0, "$NetBSD: ofw_autoconf.c,v 1.5 2007/12/16 16:42:12 phx Exp $")
#include <machine/stdarg.h> #include <machine/stdarg.h>
#include <dev/ofw/openfirm.h> #include <dev/ofw/openfirm.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcivar.h> #include <dev/pci/pcivar.h>
#include <dev/scsipi/scsi_all.h> #include <dev/scsipi/scsi_all.h>
#include <dev/scsipi/scsipi_all.h> #include <dev/scsipi/scsipi_all.h>
@ -234,12 +235,20 @@ device_register(dev, aux)
} }
if (node != 0) { if (node != 0) {
int pci_class = 0;
prop_dictionary_set_uint32(dict, "device_node", node); prop_dictionary_set_uint32(dict, "device_node", node);
/* see if this is going to be console */ /* see if this is going to be console */
memset(name, 0, sizeof(name)); memset(name, 0, sizeof(name));
OF_getprop(node, "device_type", name, sizeof(name)); OF_getprop(node, "device_type", name, sizeof(name));
if (strcmp(name, "display") == 0) {
OF_getprop(node, "class-code", &pci_class,
sizeof pci_class);
pci_class = (pci_class >> 16) & 0xff;
if (strcmp(name, "display") == 0 ||
pci_class == PCI_CLASS_DISPLAY) {
/* setup display properties for fb driver */ /* setup display properties for fb driver */
prop_dictionary_set_bool(dict, "is_console", 0); prop_dictionary_set_bool(dict, "is_console", 0);
copy_disp_props(dev, node, dict); copy_disp_props(dev, node, dict);