summaryrefslogtreecommitdiff
path: root/sys/dev/drm
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2005-12-20 22:44:36 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2005-12-20 22:44:36 +0000
commite9aa66d283ffab59006ac183b8788b3630178717 (patch)
treebf1b884ed397ca7de689d6b0df49906526678361 /sys/dev/drm
parenta1ee13ef190e865c9f19b1445020de1af28b3e6e (diff)
Notes
Diffstat (limited to 'sys/dev/drm')
-rw-r--r--sys/dev/drm/drm_agpsupport.c5
-rw-r--r--sys/dev/drm/drm_drv.c10
-rw-r--r--sys/dev/drm/i915_drv.c8
-rw-r--r--sys/dev/drm/mach64_drv.c4
-rw-r--r--sys/dev/drm/mga_drv.c15
-rw-r--r--sys/dev/drm/r128_drv.c4
-rw-r--r--sys/dev/drm/radeon_drv.c4
-rw-r--r--sys/dev/drm/savage_drv.c4
-rw-r--r--sys/dev/drm/sis_drv.c4
-rw-r--r--sys/dev/drm/tdfx_drv.c4
10 files changed, 59 insertions, 3 deletions
diff --git a/sys/dev/drm/drm_agpsupport.c b/sys/dev/drm/drm_agpsupport.c
index 91ead3b4ad39..19785ea21d41 100644
--- a/sys/dev/drm/drm_agpsupport.c
+++ b/sys/dev/drm/drm_agpsupport.c
@@ -56,6 +56,10 @@ drm_device_find_capability(drm_device_t *dev, int cap)
}
#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;
@@ -84,6 +88,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/sys/dev/drm/drm_drv.c b/sys/dev/drm/drm_drv.c
index eb9c644661e3..19c92b2bc075 100644
--- a/sys/dev/drm/drm_drv.c
+++ b/sys/dev/drm/drm_drv.c
@@ -153,6 +153,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"))
@@ -161,6 +162,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) {
@@ -180,11 +185,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/sys/dev/drm/i915_drv.c b/sys/dev/drm/i915_drv.c
index f2ab3940be01..138af374db8e 100644
--- a/sys/dev/drm/i915_drv.c
+++ b/sys/dev/drm/i915_drv.c
@@ -98,13 +98,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/sys/dev/drm/mach64_drv.c b/sys/dev/drm/mach64_drv.c
index 36fe0aed6e32..8ba4a21ae165 100644
--- a/sys/dev/drm/mach64_drv.c
+++ b/sys/dev/drm/mach64_drv.c
@@ -109,7 +109,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/sys/dev/drm/mga_drv.c b/sys/dev/drm/mga_drv.c
index 6df2434125c1..725004350e70 100644
--- a/sys/dev/drm/mga_drv.c
+++ b/sys/dev/drm/mga_drv.c
@@ -64,6 +64,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
@@ -72,9 +74,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;
@@ -148,7 +155,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/sys/dev/drm/r128_drv.c b/sys/dev/drm/r128_drv.c
index e79dcbe10697..71b4259b96ce 100644
--- a/sys/dev/drm/r128_drv.c
+++ b/sys/dev/drm/r128_drv.c
@@ -109,7 +109,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/sys/dev/drm/radeon_drv.c b/sys/dev/drm/radeon_drv.c
index 8ac798eac83c..af12d3d3f05e 100644
--- a/sys/dev/drm/radeon_drv.c
+++ b/sys/dev/drm/radeon_drv.c
@@ -114,7 +114,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/sys/dev/drm/savage_drv.c b/sys/dev/drm/savage_drv.c
index 98a8e91dfcf4..1d046c4d3b3a 100644
--- a/sys/dev/drm/savage_drv.c
+++ b/sys/dev/drm/savage_drv.c
@@ -99,7 +99,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/sys/dev/drm/sis_drv.c b/sys/dev/drm/sis_drv.c
index 5c7a1614e204..04d14515d9f1 100644
--- a/sys/dev/drm/sis_drv.c
+++ b/sys/dev/drm/sis_drv.c
@@ -92,7 +92,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/sys/dev/drm/tdfx_drv.c b/sys/dev/drm/tdfx_drv.c
index c193ecc02f31..87ecf3fb0b2b 100644
--- a/sys/dev/drm/tdfx_drv.c
+++ b/sys/dev/drm/tdfx_drv.c
@@ -93,7 +93,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__)