summaryrefslogtreecommitdiff
path: root/bsd-core/drm_agpsupport.c
diff options
context:
space:
mode:
Diffstat (limited to 'bsd-core/drm_agpsupport.c')
-rw-r--r--bsd-core/drm_agpsupport.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/bsd-core/drm_agpsupport.c b/bsd-core/drm_agpsupport.c
index 9e98140a..4f3a6f28 100644
--- a/bsd-core/drm_agpsupport.c
+++ b/bsd-core/drm_agpsupport.c
@@ -39,8 +39,8 @@
#endif
/* Returns 1 if AGP or 0 if not. */
-int
-drm_device_is_agp(drm_device_t *dev)
+static int
+drm_device_find_capability(drm_device_t *dev, int cap)
{
int ret;
@@ -74,9 +74,9 @@ drm_device_is_agp(drm_device_t *dev)
next = AGP_CAPID_GET_NEXT_PTR(capid);
/*
- * If this capability entry ID is 2, then we are done.
+ * If this capability entry ID is cap, then we are done.
*/
- if (AGP_CAPID_GET_CAP_ID(capid) == 2)
+ if (AGP_CAPID_GET_CAP_ID(capid) == cap)
return 1;
}
@@ -87,6 +87,16 @@ drm_device_is_agp(drm_device_t *dev)
#endif
}
+int drm_device_is_agp(drm_device_t *dev)
+{
+ return (drm_device_find_capability(dev, PCIY_AGP));
+}
+
+int drm_device_is_pcie(drm_device_t *dev)
+{
+ return (drm_device_find_capability(dev, PCIY_EXPRESS));
+}
+
int drm_agp_info(drm_device_t * dev, drm_agp_info_t *info)
{
struct agp_info *kern;