summaryrefslogtreecommitdiff
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
parent780e90e4a265532cf96c887267b80c691f016996 (diff)
Merge patch from jhb to catch up with FreeBSD-current vgapci master device
changes.
-rw-r--r--bsd-core/drm_agpsupport.c7
-rw-r--r--bsd-core/drm_drv.c10
-rw-r--r--bsd-core/i915_drv.c8
-rw-r--r--bsd-core/mach64_drv.c4
-rw-r--r--bsd-core/mga_drv.c15
-rw-r--r--bsd-core/r128_drv.c4
-rw-r--r--bsd-core/radeon_drv.c4
-rw-r--r--bsd-core/savage_drv.c4
-rw-r--r--bsd-core/sis_drv.c4
-rw-r--r--bsd-core/tdfx_drv.c4
10 files changed, 59 insertions, 5 deletions
diff --git a/bsd-core/drm_agpsupport.c b/bsd-core/drm_agpsupport.c
index 92fb8e0d..0406f50e 100644
--- a/bsd-core/drm_agpsupport.c
+++ b/bsd-core/drm_agpsupport.c
@@ -42,9 +42,11 @@
static int
drm_device_find_capability(drm_device_t *dev, int cap)
{
- int ret;
-
#ifdef __FreeBSD__
+#if __FreeBSD_version >= 700010
+
+ return (pci_find_extcap(dev->device, cap, NULL) == 0);
+#else
/* Code taken from agp.c. IWBNI that was a public interface. */
u_int32_t status;
u_int8_t ptr, next;
@@ -73,6 +75,7 @@ drm_device_find_capability(drm_device_t *dev, int cap)
}
return 0;
+#endif
#else
/* XXX: fill me in for non-FreeBSD */
return 1;
diff --git a/bsd-core/drm_drv.c b/bsd-core/drm_drv.c
index 92d5700d..3f53a72f 100644
--- a/bsd-core/drm_drv.c
+++ b/bsd-core/drm_drv.c
@@ -150,6 +150,7 @@ int drm_probe(device_t dev, drm_pci_id_list_t *idlist)
{
drm_pci_id_list_t *id_entry;
int vendor, device;
+#if __FreeBSD_version < 700010
device_t realdev;
if (!strcmp(device_get_name(dev), "drmsub"))
@@ -158,6 +159,10 @@ int drm_probe(device_t dev, drm_pci_id_list_t *idlist)
realdev = dev;
vendor = pci_get_vendor(realdev);
device = pci_get_device(realdev);
+#else
+ vendor = pci_get_vendor(dev);
+ device = pci_get_device(dev);
+#endif
id_entry = drm_find_description(vendor, device, idlist);
if (id_entry != NULL) {
@@ -177,11 +182,14 @@ int drm_attach(device_t nbdev, drm_pci_id_list_t *idlist)
unit = device_get_unit(nbdev);
dev = device_get_softc(nbdev);
+#if __FreeBSD_version < 700010
if (!strcmp(device_get_name(nbdev), "drmsub"))
dev->device = device_get_parent(nbdev);
else
dev->device = nbdev;
-
+#else
+ dev->device = nbdev;
+#endif
dev->devnode = make_dev(&drm_cdevsw,
unit,
DRM_DEV_UID,
diff --git a/bsd-core/i915_drv.c b/bsd-core/i915_drv.c
index 029fec2a..d5830e5a 100644
--- a/bsd-core/i915_drv.c
+++ b/bsd-core/i915_drv.c
@@ -95,13 +95,21 @@ static device_method_t i915_methods[] = {
};
static driver_t i915_driver = {
+#if __FreeBSD_version >= 700010
+ "drm",
+#else
"drmsub",
+#endif
i915_methods,
sizeof(drm_device_t)
};
extern devclass_t drm_devclass;
+#if __FreeBSD_version >= 700010
+DRIVER_MODULE(i915, vgapci, i915_driver, drm_devclass, 0, 0);
+#else
DRIVER_MODULE(i915, agp, i915_driver, drm_devclass, 0, 0);
+#endif
MODULE_DEPEND(i915, drm, 1, 1, 1);
#elif defined(__NetBSD__) || defined(__OpenBSD__)
diff --git a/bsd-core/mach64_drv.c b/bsd-core/mach64_drv.c
index c4f27547..31c45e53 100644
--- a/bsd-core/mach64_drv.c
+++ b/bsd-core/mach64_drv.c
@@ -106,7 +106,11 @@ static driver_t mach64_driver = {
};
extern devclass_t drm_devclass;
+#if __FreeBSD_version >= 700010
+DRIVER_MODULE(mach64, vgapci, mach64_driver, drm_devclass, 0, 0);
+#else
DRIVER_MODULE(mach64, pci, mach64_driver, drm_devclass, 0, 0);
+#endif
MODULE_DEPEND(mach64, drm, 1, 1, 1);
#elif defined(__NetBSD__) || defined(__OpenBSD__)
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__)
diff --git a/bsd-core/r128_drv.c b/bsd-core/r128_drv.c
index a1518a62..fbc8c041 100644
--- a/bsd-core/r128_drv.c
+++ b/bsd-core/r128_drv.c
@@ -106,7 +106,11 @@ static driver_t r128_driver = {
};
extern devclass_t drm_devclass;
+#if __FreeBSD_version >= 700010
+DRIVER_MODULE(r128, vgapci, r128_driver, drm_devclass, 0, 0);
+#else
DRIVER_MODULE(r128, pci, r128_driver, drm_devclass, 0, 0);
+#endif
MODULE_DEPEND(r128, drm, 1, 1, 1);
#elif defined(__NetBSD__) || defined(__OpenBSD__)
diff --git a/bsd-core/radeon_drv.c b/bsd-core/radeon_drv.c
index 144b1ade..f66bc795 100644
--- a/bsd-core/radeon_drv.c
+++ b/bsd-core/radeon_drv.c
@@ -111,7 +111,11 @@ static driver_t radeon_driver = {
};
extern devclass_t drm_devclass;
+#if __FreeBSD_version >= 700010
+DRIVER_MODULE(radeon, vgapci, radeon_driver, drm_devclass, 0, 0);
+#else
DRIVER_MODULE(radeon, pci, radeon_driver, drm_devclass, 0, 0);
+#endif
MODULE_DEPEND(radeon, drm, 1, 1, 1);
#elif defined(__NetBSD__) || defined(__OpenBSD__)
diff --git a/bsd-core/savage_drv.c b/bsd-core/savage_drv.c
index 4c9be4c8..f4fa22b6 100644
--- a/bsd-core/savage_drv.c
+++ b/bsd-core/savage_drv.c
@@ -96,7 +96,11 @@ static driver_t savage_driver = {
};
extern devclass_t drm_devclass;
+#if __FreeBSD_version >= 700010
+DRIVER_MODULE(savage, vgapci, savage_driver, drm_devclass, 0, 0);
+#else
DRIVER_MODULE(savage, pci, savage_driver, drm_devclass, 0, 0);
+#endif
MODULE_DEPEND(savage, drm, 1, 1, 1);
#elif defined(__NetBSD__) || defined(__OpenBSD__)
diff --git a/bsd-core/sis_drv.c b/bsd-core/sis_drv.c
index 159e2e85..5b87d3a9 100644
--- a/bsd-core/sis_drv.c
+++ b/bsd-core/sis_drv.c
@@ -89,7 +89,11 @@ static driver_t sis_driver = {
};
extern devclass_t drm_devclass;
+#if __FreeBSD_version >= 700010
+DRIVER_MODULE(sisdrm, vgapci, sis_driver, drm_devclass, 0, 0);
+#else
DRIVER_MODULE(sisdrm, pci, sis_driver, drm_devclass, 0, 0);
+#endif
MODULE_DEPEND(sisdrm, drm, 1, 1, 1);
#elif defined(__NetBSD__) || defined(__OpenBSD__)
diff --git a/bsd-core/tdfx_drv.c b/bsd-core/tdfx_drv.c
index 60427836..5eb56f83 100644
--- a/bsd-core/tdfx_drv.c
+++ b/bsd-core/tdfx_drv.c
@@ -90,7 +90,11 @@ static driver_t tdfx_driver = {
};
extern devclass_t drm_devclass;
+#if __FreeBSD_version >= 700010
+DRIVER_MODULE(tdfx, vgapci, tdfx_driver, drm_devclass, 0, 0);
+#else
DRIVER_MODULE(tdfx, pci, tdfx_driver, drm_devclass, 0, 0);
+#endif
MODULE_DEPEND(tdfx, drm, 1, 1, 1);
#elif defined(__NetBSD__) || defined(__OpenBSD__)