i915: Filter pci devices based on PCI_CLASS_DISPLAY_VGA
Subsystems (2)
PATCH 1/1 i915: Filter pci devices based on PCI_CLASS_DISPLAY_VGA
This fixes hangs on 855-class hardware by avoiding double attachment of the driver due to the stub second head device having the same pci id as the real device.
Other DRM drivers probably want this treatment as well, but I'm applying it just to this one for safety.
Signed-off-by Eric Anholt <[email protected]>
--- drivers/gpu/drm/drm_drv.c | 10 +++++++- include/drm/drm_pciids.h | 52 +++++++++++++++++++++++++------------------- 2 files changed, 38 insertions(+), 24 deletions(-)
drivers/gpu/drm/drm_drv.c +9 -1
@@ -266,11 +266,19 @@ int drm_init(struct drm_driver *driver)for (i =0 ; driver->pci_driver.id_table[i].vendor !=0 ; i++) { pid = (struct pci_device_id *)&driver->pci_driver.id_table[i]; +/* Loop around setting up a DRM device for each PCI device +* matching our ID and device class. If we had the internal +* function that pci_get_subsys and pci_get_class used, we'd +* be able to just pass pid in instead of doing a two-stage +* thing. +*/ pdev =NULL ; -/* pass back in pdev to account for multiple identical cards */ while ((pdev =pci_get_subsys (pid->vendor, pid->device, pid->subvendor, pid->subdevice, pdev)) !=NULL ) { +if ((pdev->class & pid->class_mask) != pid->class) +continue ; +/* stealth mode requires a manual probe */ pci_dev_get (pdev);drm_get_dev (pdev, pid, driver);
include/drm/drm_pciids.h +29 -23
57 lines not on this page · raw message
Signature · 1 line
1.5.6.5