Author: rnoland
Date: Thu Dec 18 21:58:57 2008
New Revision: 186299
URL: http://svn.freebsd.org/changeset/base/186299

Log:
  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

Modified:
  head/sys/dev/drm/drmP.h
  head/sys/dev/drm/drm_drv.c

Modified: head/sys/dev/drm/drmP.h
==============================================================================
--- head/sys/dev/drm/drmP.h     Thu Dec 18 21:46:18 2008        (r186298)
+++ head/sys/dev/drm/drmP.h     Thu Dec 18 21:58:57 2008        (r186299)
@@ -87,6 +87,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>
 

Modified: head/sys/dev/drm/drm_drv.c
==============================================================================
--- head/sys/dev/drm/drm_drv.c  Thu Dec 18 21:46:18 2008        (r186298)
+++ head/sys/dev/drm/drm_drv.c  Thu Dec 18 21:58:57 2008        (r186299)
@@ -152,6 +152,10 @@ int drm_probe(device_t dev, drm_pci_id_l
        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);
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to