summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Noland <rnoland@2hip.net>2009-03-05 00:44:56 -0600
committerRobert Noland <rnoland@2hip.net>2009-03-05 00:44:56 -0600
commit222dc6582e7afad0cd397452a0c4bcea23efeb04 (patch)
tree50e706151d1b0713feb96469cec7c53489fcba09
parent4a27f1c6384c3987dc25e0d2b65e4cf56af7769a (diff)
FreeBSD: We only want drm to ever attach to the primary pci device.
Intel 855 chips present the same pci id for both heads. This prevents us from attaching to the dummy second head. All other chips that I am aware of either only present a single pci id, or different ids for each head so that we only match on the correct head.
-rw-r--r--bsd-core/drmP.h1
-rw-r--r--bsd-core/drm_drv.c4
2 files changed, 5 insertions, 0 deletions
diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h
index 79998e84..a8227c29 100644
--- a/bsd-core/drmP.h
+++ b/bsd-core/drmP.h
@@ -83,6 +83,7 @@ struct drm_file;
#include <sys/agpio.h>
#include <sys/mutex.h>
#include <dev/pci/pcivar.h>
+#include <dev/pci/pcireg.h>
#include <sys/selinfo.h>
#include <sys/bus.h>
diff --git a/bsd-core/drm_drv.c b/bsd-core/drm_drv.c
index d4d50e6a..85e86d36 100644
--- a/bsd-core/drm_drv.c
+++ b/bsd-core/drm_drv.c
@@ -173,6 +173,10 @@ int drm_probe(device_t dev, drm_pci_id_list_t *idlist)
device = pci_get_device(dev);
#endif
+ if (pci_get_class(dev) != PCIC_DISPLAY
+ || pci_get_subclass(dev) != PCIS_DISPLAY_VGA)
+ return ENXIO;
+
id_entry = drm_find_description(vendor, device, idlist);
if (id_entry != NULL) {
device_set_desc(dev, id_entry->name);