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.c49
1 files changed, 21 insertions, 28 deletions
diff --git a/bsd-core/drm_agpsupport.c b/bsd-core/drm_agpsupport.c
index 97613d21..a568c5a5 100644
--- a/bsd-core/drm_agpsupport.c
+++ b/bsd-core/drm_agpsupport.c
@@ -35,20 +35,17 @@
#include "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);
@@ -82,21 +79,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;
}
@@ -109,7 +102,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;
@@ -135,13 +128,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;
}
@@ -183,7 +176,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)
@@ -198,14 +191,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;
@@ -251,16 +244,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;
}
@@ -276,7 +269,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;
@@ -301,10 +294,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);
@@ -313,7 +306,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;
@@ -342,10 +335,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);
@@ -354,7 +347,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;
@@ -387,10 +380,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);