Finish the last bits necessary to get the i915 DRM port working on FreeBSD
authorEric Anholt <anholt@freebsd.org>
Fri, 2 Dec 2005 23:41:47 +0000 (23:41 +0000)
committerEric Anholt <anholt@freebsd.org>
Fri, 2 Dec 2005 23:41:47 +0000 (23:41 +0000)
Submitted by: Alexey Popov <llp@iteranet.com>

bsd-core/drm_drv.c
bsd-core/i915_drv.c

index 032821f..92d5700 100644 (file)
@@ -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);
index c571b38..029fec2 100644 (file)
@@ -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__)