From c798a382f1e11a0fd60a78924db0663f8e988a1b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 29 Jun 2005 02:54:19 +0000 Subject: Get the BSD DRM compiling again after MGA and mapping changes. Note that i915 has been disabled for the moment, rather than working around linux-specific code in the shared dir. --- bsd-core/drm_drv.c | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'bsd-core/drm_drv.c') diff --git a/bsd-core/drm_drv.c b/bsd-core/drm_drv.c index e3cac422..019852d9 100644 --- a/bsd-core/drm_drv.c +++ b/bsd-core/drm_drv.c @@ -71,8 +71,8 @@ static drm_ioctl_desc_t drm_ioctls[256] = { [DRM_IOCTL_NR(DRM_IOCTL_UNBLOCK)] = { drm_noop, 1, 1 }, [DRM_IOCTL_NR(DRM_IOCTL_AUTH_MAGIC)] = { drm_authmagic, 1, 1 }, - [DRM_IOCTL_NR(DRM_IOCTL_ADD_MAP)] = { drm_addmap, 1, 1 }, - [DRM_IOCTL_NR(DRM_IOCTL_RM_MAP)] = { drm_rmmap, 1, 0 }, + [DRM_IOCTL_NR(DRM_IOCTL_ADD_MAP)] = { drm_addmap_ioctl, 1, 1 }, + [DRM_IOCTL_NR(DRM_IOCTL_RM_MAP)] = { drm_rmmap_ioctl, 1, 0 }, [DRM_IOCTL_NR(DRM_IOCTL_SET_SAREA_CTX)] = { drm_setsareactx, 1, 1 }, [DRM_IOCTL_NR(DRM_IOCTL_GET_SAREA_CTX)] = { drm_getsareactx, 1, 0 }, @@ -92,7 +92,7 @@ static drm_ioctl_desc_t drm_ioctls[256] = { [DRM_IOCTL_NR(DRM_IOCTL_UNLOCK)] = { drm_unlock, 1, 0 }, [DRM_IOCTL_NR(DRM_IOCTL_FINISH)] = { drm_noop, 1, 0 }, - [DRM_IOCTL_NR(DRM_IOCTL_ADD_BUFS)] = { drm_addbufs, 1, 1 }, + [DRM_IOCTL_NR(DRM_IOCTL_ADD_BUFS)] = { drm_addbufs_ioctl, 1, 1 }, [DRM_IOCTL_NR(DRM_IOCTL_MARK_BUFS)] = { drm_markbufs, 1, 1 }, [DRM_IOCTL_NR(DRM_IOCTL_INFO_BUFS)] = { drm_infobufs, 1, 0 }, [DRM_IOCTL_NR(DRM_IOCTL_MAP_BUFS)] = { drm_mapbufs, 1, 0 }, @@ -101,10 +101,10 @@ 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_ACQUIRE)] = { drm_agp_acquire_ioctl, 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_ENABLE)] = { drm_agp_enable_ioctl, 1, 1 }, + [DRM_IOCTL_NR(DRM_IOCTL_AGP_INFO)] = { drm_agp_info_ioctl, 1, 0 }, [DRM_IOCTL_NR(DRM_IOCTL_AGP_ALLOC)] = { drm_agp_alloc, 1, 1 }, [DRM_IOCTL_NR(DRM_IOCTL_AGP_FREE)] = { drm_agp_free, 1, 1 }, [DRM_IOCTL_NR(DRM_IOCTL_AGP_BIND)] = { drm_agp_bind, 1, 1 }, @@ -424,7 +424,7 @@ static int drm_takedown(drm_device_t *dev) dev->agp->memory = NULL; if (dev->agp->acquired) - drm_agp_release(); + drm_agp_release(dev); dev->agp->acquired = 0; dev->agp->enabled = 0; @@ -434,10 +434,8 @@ static int drm_takedown(drm_device_t *dev) dev->sg = NULL; } - /* Clean up maps that weren't set up by the driver. */ TAILQ_FOREACH_SAFE(map, &dev->maplist, link, mapsave) { - if (!map->kernel_owned) - drm_remove_map(dev, map); + drm_rmmap(dev, map); } drm_dma_takedown(dev); @@ -562,8 +560,6 @@ error: */ static void drm_cleanup(drm_device_t *dev) { - drm_local_map_t *map; - DRM_DEBUG( "\n" ); #ifdef __FreeBSD__ @@ -585,11 +581,6 @@ static void drm_cleanup(drm_device_t *dev) drm_takedown(dev); DRM_UNLOCK(); - /* Clean up any maps left over that had been allocated by the driver. */ - while ((map = TAILQ_FIRST(&dev->maplist)) != NULL) { - drm_remove_map(dev, map); - } - if ( dev->agp ) { drm_agp_uninit(); free(dev->agp, M_DRM); -- cgit v1.2.3