From ab59dd285c4ccdec92adadfcb869fc83edd96e86 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 20 Jul 2005 21:17:47 +0000 Subject: Add latest r300 support from r300.sf.net CVS. Patch submitted by volodya, with BSD fix from jkim and the r300_reg.h license from Nicolai Haehnle. Big thanks to everyone involved! --- bsd-core/drm_agpsupport.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'bsd-core/drm_agpsupport.c') 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; -- cgit v1.2.3