diff options
Diffstat (limited to 'sys/dev/drm/drm_agpsupport.c')
-rw-r--r-- | sys/dev/drm/drm_agpsupport.c | 49 |
1 files changed, 21 insertions, 28 deletions
diff --git a/sys/dev/drm/drm_agpsupport.c b/sys/dev/drm/drm_agpsupport.c index 1614c21..37ef21b 100644 --- a/sys/dev/drm/drm_agpsupport.c +++ b/sys/dev/drm/drm_agpsupport.c @@ -38,20 +38,17 @@ __FBSDID("$FreeBSD$"); #include "dev/drm/drmP.h" -#ifdef __FreeBSD__ #if __FreeBSD_version >= 800004 #include <dev/agp/agpreg.h> #else /* __FreeBSD_version >= 800004 */ #include <pci/agpreg.h> #endif /* __FreeBSD_version >= 800004 */ #include <dev/pci/pcireg.h> -#endif /* Returns 1 if AGP or 0 if not. */ static int drm_device_find_capability(struct drm_device *dev, int cap) { -#ifdef __FreeBSD__ #if __FreeBSD_version >= 602102 return (pci_find_extcap(dev->device, cap, NULL) == 0); @@ -85,21 +82,17 @@ drm_device_find_capability(struct drm_device *dev, int cap) return 0; #endif -#else - /* XXX: fill me in for non-FreeBSD */ - return 1; -#endif } int drm_device_is_agp(struct drm_device *dev) { - if (dev->driver.device_is_agp != NULL) { + 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); + ret = (*dev->driver->device_is_agp)(dev); if (ret != DRM_MIGHT_BE_AGP) return ret; } @@ -112,7 +105,7 @@ int drm_device_is_pcie(struct drm_device *dev) return (drm_device_find_capability(dev, PCIY_EXPRESS)); } -int drm_agp_info(struct drm_device * dev, drm_agp_info_t *info) +int drm_agp_info(struct drm_device * dev, struct drm_agp_info *info) { struct agp_info *kern; @@ -138,13 +131,13 @@ int drm_agp_info_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { int err; - drm_agp_info_t info; + struct drm_agp_info info; err = drm_agp_info(dev, &info); if (err != 0) return err; - *(drm_agp_info_t *) data = info; + *(struct drm_agp_info *) data = info; return 0; } @@ -186,7 +179,7 @@ int drm_agp_release(struct drm_device * dev) return 0; } -int drm_agp_enable(struct drm_device *dev, drm_agp_mode_t mode) +int drm_agp_enable(struct drm_device *dev, struct drm_agp_mode mode) { if (!dev->agp || !dev->agp->acquired) @@ -201,14 +194,14 @@ int drm_agp_enable(struct drm_device *dev, drm_agp_mode_t mode) int drm_agp_enable_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_agp_mode_t mode; + struct drm_agp_mode mode; - mode = *(drm_agp_mode_t *) data; + mode = *(struct drm_agp_mode *) data; return drm_agp_enable(dev, mode); } -int drm_agp_alloc(struct drm_device *dev, drm_agp_buffer_t *request) +int drm_agp_alloc(struct drm_device *dev, struct drm_agp_buffer *request) { drm_agp_mem_t *entry; void *handle; @@ -254,16 +247,16 @@ int drm_agp_alloc(struct drm_device *dev, drm_agp_buffer_t *request) int drm_agp_alloc_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_agp_buffer_t request; + struct drm_agp_buffer request; int retcode; - request = *(drm_agp_buffer_t *) data; + request = *(struct drm_agp_buffer *) data; DRM_LOCK(); retcode = drm_agp_alloc(dev, &request); DRM_UNLOCK(); - *(drm_agp_buffer_t *) data = request; + *(struct drm_agp_buffer *) data = request; return retcode; } @@ -279,7 +272,7 @@ static drm_agp_mem_t * drm_agp_lookup_entry(struct drm_device *dev, return NULL; } -int drm_agp_unbind(struct drm_device *dev, drm_agp_binding_t *request) +int drm_agp_unbind(struct drm_device *dev, struct drm_agp_binding *request) { drm_agp_mem_t *entry; int retcode; @@ -304,10 +297,10 @@ int drm_agp_unbind(struct drm_device *dev, drm_agp_binding_t *request) int drm_agp_unbind_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_agp_binding_t request; + struct drm_agp_binding request; int retcode; - request = *(drm_agp_binding_t *) data; + request = *(struct drm_agp_binding *) data; DRM_LOCK(); retcode = drm_agp_unbind(dev, &request); @@ -316,7 +309,7 @@ int drm_agp_unbind_ioctl(struct drm_device *dev, void *data, return retcode; } -int drm_agp_bind(struct drm_device *dev, drm_agp_binding_t *request) +int drm_agp_bind(struct drm_device *dev, struct drm_agp_binding *request) { drm_agp_mem_t *entry; int retcode; @@ -345,10 +338,10 @@ int drm_agp_bind(struct drm_device *dev, drm_agp_binding_t *request) int drm_agp_bind_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_agp_binding_t request; + struct drm_agp_binding request; int retcode; - request = *(drm_agp_binding_t *) data; + request = *(struct drm_agp_binding *) data; DRM_LOCK(); retcode = drm_agp_bind(dev, &request); @@ -357,7 +350,7 @@ int drm_agp_bind_ioctl(struct drm_device *dev, void *data, return retcode; } -int drm_agp_free(struct drm_device *dev, drm_agp_buffer_t *request) +int drm_agp_free(struct drm_device *dev, struct drm_agp_buffer *request) { drm_agp_mem_t *entry; @@ -390,10 +383,10 @@ int drm_agp_free(struct drm_device *dev, drm_agp_buffer_t *request) int drm_agp_free_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_agp_buffer_t request; + struct drm_agp_buffer request; int retcode; - request = *(drm_agp_buffer_t *) data; + request = *(struct drm_agp_buffer *) data; DRM_LOCK(); retcode = drm_agp_free(dev, &request); |