summaryrefslogtreecommitdiff
path: root/bsd-core/drm_drv.c
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2005-12-02 23:41:47 +0000
committerEric Anholt <anholt@freebsd.org>2005-12-02 23:41:47 +0000
commit20fcbae5ac86b2d10b23253245f5e88b78d2c76f (patch)
tree59d02e44e74befd2e71c3b830f0fc5fa9b9852fa /bsd-core/drm_drv.c
parent422002dc8434061729b1558ac846648041c46ab3 (diff)
Finish the last bits necessary to get the i915 DRM port working on FreeBSD
Submitted by: Alexey Popov <llp@iteranet.com>
Diffstat (limited to 'bsd-core/drm_drv.c')
-rw-r--r--bsd-core/drm_drv.c13
1 files changed, 9 insertions, 4 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);