From c9e7b212844fc079201a23cef5332617452152ef Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Thu, 18 Dec 2008 21:58:57 +0000 Subject: [PATCH] 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. Approved by: kib@ MFC after: 2 weeks --- sys/dev/drm/drmP.h | 1 + sys/dev/drm/drm_drv.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/sys/dev/drm/drmP.h b/sys/dev/drm/drmP.h index 9fb29f93ea0..18fc8b71fd2 100644 --- a/sys/dev/drm/drmP.h +++ b/sys/dev/drm/drmP.h @@ -87,6 +87,7 @@ struct drm_file; #include #include #include +#include #include #include diff --git a/sys/dev/drm/drm_drv.c b/sys/dev/drm/drm_drv.c index 8a0cdf42e7a..63be19bfdfd 100644 --- a/sys/dev/drm/drm_drv.c +++ b/sys/dev/drm/drm_drv.c @@ -152,6 +152,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);