diff options
-rw-r--r-- | bsd-core/drm_drv.c | 13 | ||||
-rw-r--r-- | bsd-core/i915_drv.c | 2 |
2 files changed, 10 insertions, 5 deletions
diff --git a/bsd-core/drm_drv.c b/bsd-core/drm_drv.c index 032821f6..92d5700d 100644 --- a/bsd-core/drm_drv.c +++ b/bsd-core/drm_drv.c @@ -150,9 +150,14 @@ int drm_probe(device_t dev, drm_pci_id_list_t *idlist) { drm_pci_id_list_t *id_entry; int vendor, device; + device_t realdev; - vendor = pci_get_vendor(dev); - device = pci_get_device(dev); + if (!strcmp(device_get_name(dev), "drmsub")) + realdev = device_get_parent(dev); + else + realdev = dev; + vendor = pci_get_vendor(realdev); + device = pci_get_device(realdev); id_entry = drm_find_description(vendor, device, idlist); if (id_entry != NULL) { @@ -187,8 +192,8 @@ int drm_attach(device_t nbdev, drm_pci_id_list_t *idlist) mtx_init(&dev->dev_lock, "drm device", NULL, MTX_DEF); #endif - id_entry = drm_find_description(pci_get_vendor(nbdev), - pci_get_device(nbdev), idlist); + id_entry = drm_find_description(pci_get_vendor(dev->device), + pci_get_device(dev->device), idlist); dev->id_entry = id_entry; return drm_load(dev); diff --git a/bsd-core/i915_drv.c b/bsd-core/i915_drv.c index c571b389..029fec2a 100644 --- a/bsd-core/i915_drv.c +++ b/bsd-core/i915_drv.c @@ -101,7 +101,7 @@ static driver_t i915_driver = { }; extern devclass_t drm_devclass; -DRIVER_MODULE(i915, pci, i915_driver, drm_devclass, 0, 0); +DRIVER_MODULE(i915, agp, i915_driver, drm_devclass, 0, 0); MODULE_DEPEND(i915, drm, 1, 1, 1); #elif defined(__NetBSD__) || defined(__OpenBSD__) |