aboutsummaryrefslogtreecommitdiff
path: root/bsd-core/mga_drv.c
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2005-12-30 02:17:05 +0000
committerEric Anholt <anholt@freebsd.org>2005-12-30 02:17:05 +0000
commit7f2c7f9977d3e62c594d47ca8a5d7fefac2fc4de (patch)
tree055cd6ff8a4a67dce2e0349e884c5873c8a8f639 /bsd-core/mga_drv.c
parent780e90e4a265532cf96c887267b80c691f016996 (diff)
Merge patch from jhb to catch up with FreeBSD-current vgapci master device
changes.
Diffstat (limited to 'bsd-core/mga_drv.c')
-rw-r--r--bsd-core/mga_drv.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/bsd-core/mga_drv.c b/bsd-core/mga_drv.c
index 1dc146f6..3d324fb4 100644
--- a/bsd-core/mga_drv.c
+++ b/bsd-core/mga_drv.c
@@ -61,6 +61,8 @@ static drm_pci_id_list_t mga_pciidlist[] = {
*/
static int mga_driver_device_is_agp(drm_device_t * dev)
{
+ device_t bus;
+
/* There are PCI versions of the G450. These cards have the
* same PCI ID as the AGP G450, but have an additional PCI-to-PCI
* bridge chip. We detect these cards, which are not currently
@@ -69,9 +71,14 @@ static int mga_driver_device_is_agp(drm_device_t * dev)
* device is 0x0021 (HB6 Universal PCI-PCI bridge), we reject the
* device.
*/
+#if __FreeBSD_version >= 700010
+ bus = device_get_parent(device_get_parent(dev->device));
+#else
+ bus = device_get_parent(dev->device);
+#endif
if (pci_get_device(dev->device) == 0x0525 &&
- pci_get_vendor(device_get_parent(dev->device)) == 0x3388 &&
- pci_get_device(device_get_parent(dev->device)) == 0x0021)
+ pci_get_vendor(bus) == 0x3388 &&
+ pci_get_device(bus) == 0x0021)
return 0;
else
return 2;
@@ -145,7 +152,11 @@ static driver_t mga_driver = {
};
extern devclass_t drm_devclass;
+#if __FreeBSD_version >= 700010
+DRIVER_MODULE(mga, vgapci, mga_driver, drm_devclass, 0, 0);
+#else
DRIVER_MODULE(mga, pci, mga_driver, drm_devclass, 0, 0);
+#endif
MODULE_DEPEND(mga, drm, 1, 1, 1);
#elif defined(__NetBSD__) || defined(__OpenBSD__)