summaryrefslogtreecommitdiff
path: root/shared-core/i915_dma.c
diff options
context:
space:
mode:
Diffstat (limited to 'shared-core/i915_dma.c')
-rw-r--r--shared-core/i915_dma.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c
index fc1b356f..72573cbb 100644
--- a/shared-core/i915_dma.c
+++ b/shared-core/i915_dma.c
@@ -94,7 +94,7 @@ int i915_dma_cleanup(drm_device_t *dev)
(drm_i915_private_t *) dev->dev_private;
if (dev_priv->ring.virtual_start) {
- DRM_IOREMAPFREE( &dev_priv->ring.map, dev);
+ drm_core_ioremapfree( &dev_priv->ring.map, dev);
}
if (dev_priv->hw_status_page) {
@@ -135,8 +135,8 @@ static int i915_initialize(drm_device_t *dev,
i915_dma_cleanup(dev);
return DRM_ERR(EINVAL);
}
-
- DRM_FIND_MAP( dev_priv->mmio_map, init->mmio_offset );
+
+ dev_priv->mmio_map = drm_core_findmap(dev, init->mmio_offset);
if(!dev_priv->mmio_map) {
dev->dev_private = (void *)dev_priv;
i915_dma_cleanup(dev);
@@ -159,7 +159,7 @@ static int i915_initialize(drm_device_t *dev,
dev_priv->ring.map.flags = 0;
dev_priv->ring.map.mtrr = 0;
- DRM_IOREMAP( &dev_priv->ring.map, dev );
+ drm_core_ioremap( &dev_priv->ring.map, dev );
if (dev_priv->ring.map.handle == NULL) {
dev->dev_private = (void *) dev_priv;
@@ -770,3 +770,26 @@ int i915_setparam( DRM_IOCTL_ARGS )
return 0;
}
+
+static void i915_driver_pretakedown(drm_device_t *dev)
+{
+ if ( dev->dev_private ) {
+ drm_i915_private_t *dev_priv = dev->dev_private;
+ i915_mem_takedown( &(dev_priv->agp_heap) );
+ }
+ i915_dma_cleanup( dev );
+}
+
+static void i915_driver_prerelease(drm_device_t *dev, DRMFILE filp)
+{
+ if ( dev->dev_private ) {
+ drm_i915_private_t *dev_priv = dev->dev_private;
+ i915_mem_release( dev, filp, dev_priv->agp_heap );
+ }
+}
+
+void i915_driver_register_fns(drm_device_t *dev)
+{
+ dev->fn_tbl.pretakedown = i915_driver_pretakedown;
+ dev->fn_tbl.prerelease = i915_driver_prerelease;
+}