summaryrefslogtreecommitdiff
path: root/bsd-core
diff options
context:
space:
mode:
Diffstat (limited to 'bsd-core')
-rw-r--r--bsd-core/drmP.h4
-rw-r--r--bsd-core/drm_agpsupport.c17
-rw-r--r--bsd-core/drm_drv.c4
3 files changed, 10 insertions, 15 deletions
diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h
index 98e4945c..b22ce3b2 100644
--- a/bsd-core/drmP.h
+++ b/bsd-core/drmP.h
@@ -848,7 +848,7 @@ void drm_vbl_send_signals(drm_device_t *dev);
int drm_device_is_agp(drm_device_t *dev);
drm_agp_head_t *drm_agp_init(void);
void drm_agp_uninit(void);
-void drm_agp_do_release(void);
+int drm_agp_release(drm_device_t *dev);
void *drm_agp_allocate_memory(size_t pages, u32 type);
int drm_agp_free_memory(void *handle);
int drm_agp_bind_memory(void *handle, off_t start);
@@ -921,7 +921,7 @@ int drm_wait_vblank(DRM_IOCTL_ARGS);
/* AGP/GART support (drm_agpsupport.c) */
int drm_agp_acquire(DRM_IOCTL_ARGS);
-int drm_agp_release(DRM_IOCTL_ARGS);
+int drm_agp_release_ioctl(DRM_IOCTL_ARGS);
int drm_agp_enable(DRM_IOCTL_ARGS);
int drm_agp_info(DRM_IOCTL_ARGS);
int drm_agp_alloc(DRM_IOCTL_ARGS);
diff --git a/bsd-core/drm_agpsupport.c b/bsd-core/drm_agpsupport.c
index 540cb402..7c5351ae 100644
--- a/bsd-core/drm_agpsupport.c
+++ b/bsd-core/drm_agpsupport.c
@@ -129,25 +129,20 @@ int drm_agp_acquire(DRM_IOCTL_ARGS)
return 0;
}
-int drm_agp_release(DRM_IOCTL_ARGS)
+int drm_agp_release_ioctl(DRM_IOCTL_ARGS)
{
DRM_DEVICE;
+ return drm_agp_release(dev);
+}
+
+void drm_agp_release(drm_device_t * dev)
+{
if (!dev->agp || !dev->agp->acquired)
return EINVAL;
agp_release(dev->agp->agpdev);
dev->agp->acquired = 0;
return 0;
-
-}
-
-void drm_agp_do_release(void)
-{
- device_t agpdev;
-
- agpdev = DRM_AGP_FIND_DEVICE();
- if (agpdev)
- agp_release(agpdev);
}
int drm_agp_enable(DRM_IOCTL_ARGS)
diff --git a/bsd-core/drm_drv.c b/bsd-core/drm_drv.c
index 44a6c85a..e3cac422 100644
--- a/bsd-core/drm_drv.c
+++ b/bsd-core/drm_drv.c
@@ -102,7 +102,7 @@ static drm_ioctl_desc_t drm_ioctls[256] = {
[DRM_IOCTL_NR(DRM_IOCTL_CONTROL)] = { drm_control, 1, 1 },
[DRM_IOCTL_NR(DRM_IOCTL_AGP_ACQUIRE)] = { drm_agp_acquire, 1, 1 },
- [DRM_IOCTL_NR(DRM_IOCTL_AGP_RELEASE)] = { drm_agp_release, 1, 1 },
+ [DRM_IOCTL_NR(DRM_IOCTL_AGP_RELEASE)] = { drm_agp_release_ioctl, 1, 1 },
[DRM_IOCTL_NR(DRM_IOCTL_AGP_ENABLE)] = { drm_agp_enable, 1, 1 },
[DRM_IOCTL_NR(DRM_IOCTL_AGP_INFO)] = { drm_agp_info, 1, 0 },
[DRM_IOCTL_NR(DRM_IOCTL_AGP_ALLOC)] = { drm_agp_alloc, 1, 1 },
@@ -424,7 +424,7 @@ static int drm_takedown(drm_device_t *dev)
dev->agp->memory = NULL;
if (dev->agp->acquired)
- drm_agp_do_release();
+ drm_agp_release();
dev->agp->acquired = 0;
dev->agp->enabled = 0;