aboutsummaryrefslogtreecommitdiff
path: root/bsd-core/drm_agpsupport.c
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2005-11-28 21:15:46 +0000
committerEric Anholt <anholt@freebsd.org>2005-11-28 21:15:46 +0000
commit1835dff04a69509c0ea5fdb94abe0eaa61e7ab5a (patch)
tree6429c7218395c5df204ed027faf863f292473337 /bsd-core/drm_agpsupport.c
parent0472ac5d117908a4ef612722960411c58e824999 (diff)
Fix AGP support guessing: Implement the same bridge checking in the MGA
driver as Linux uses, and actually use the driver's device_is_agp if available (hopefully fixing i915).
Diffstat (limited to 'bsd-core/drm_agpsupport.c')
-rw-r--r--bsd-core/drm_agpsupport.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/bsd-core/drm_agpsupport.c b/bsd-core/drm_agpsupport.c
index 58293566..0a565105 100644
--- a/bsd-core/drm_agpsupport.c
+++ b/bsd-core/drm_agpsupport.c
@@ -89,6 +89,17 @@ drm_device_find_capability(drm_device_t *dev, int cap)
int drm_device_is_agp(drm_device_t *dev)
{
+ if (dev->driver.device_is_agp != NULL) {
+ int ret;
+
+ /* device_is_agp returns a tristate, 0 = not AGP, 1 = definitely
+ * AGP, 2 = fall back to PCI capability
+ */
+ ret = (*dev->driver.device_is_agp)(dev);
+ if (ret != 2)
+ return ret;
+ }
+
return (drm_device_find_capability(dev, PCIY_AGP));
}