drm: Move drm_memory.c map support declarations to <drm/drm_legacy.h>
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 10 Sep 2014 10:43:56 +0000 (12:43 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 12 Sep 2014 13:28:12 +0000 (15:28 +0200)
And replace the drm_core_ prefix with drm_legacy_ since really, this
isn't core stuff.

Also drop drm_core_dropmap since it's unused.

v2: Fix up i810.ko fully which somehow slipped through.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_memory.c
drivers/gpu/drm/i810/i810_dma.c
drivers/gpu/drm/mga/mga_dma.c
drivers/gpu/drm/r128/r128_cce.c
drivers/gpu/drm/radeon/r600_cp.c
drivers/gpu/drm/radeon/radeon_cp.c
drivers/gpu/drm/savage/savage_bci.c
drivers/gpu/drm/via/via_dma.c
drivers/gpu/drm/via/via_map.c
include/drm/drmP.h
include/drm/drm_legacy.h

index 62fda6a..a521ef6 100644 (file)
@@ -120,25 +120,25 @@ static inline void *agp_remap(unsigned long offset, unsigned long size,
 
 #endif                         /* agp */
 
-void drm_core_ioremap(struct drm_local_map *map, struct drm_device *dev)
+void drm_legacy_ioremap(struct drm_local_map *map, struct drm_device *dev)
 {
        if (dev->agp && dev->agp->cant_use_aperture && map->type == _DRM_AGP)
                map->handle = agp_remap(map->offset, map->size, dev);
        else
                map->handle = ioremap(map->offset, map->size);
 }
-EXPORT_SYMBOL(drm_core_ioremap);
+EXPORT_SYMBOL(drm_legacy_ioremap);
 
-void drm_core_ioremap_wc(struct drm_local_map *map, struct drm_device *dev)
+void drm_legacy_ioremap_wc(struct drm_local_map *map, struct drm_device *dev)
 {
        if (dev->agp && dev->agp->cant_use_aperture && map->type == _DRM_AGP)
                map->handle = agp_remap(map->offset, map->size, dev);
        else
                map->handle = ioremap_wc(map->offset, map->size);
 }
-EXPORT_SYMBOL(drm_core_ioremap_wc);
+EXPORT_SYMBOL(drm_legacy_ioremap_wc);
 
-void drm_core_ioremapfree(struct drm_local_map *map, struct drm_device *dev)
+void drm_legacy_ioremapfree(struct drm_local_map *map, struct drm_device *dev)
 {
        if (!map->handle || !map->size)
                return;
@@ -148,4 +148,4 @@ void drm_core_ioremapfree(struct drm_local_map *map, struct drm_device *dev)
        else
                iounmap(map->handle);
 }
-EXPORT_SYMBOL(drm_core_ioremapfree);
+EXPORT_SYMBOL(drm_legacy_ioremapfree);
index c97e2ff..d918567 100644 (file)
@@ -213,7 +213,7 @@ static int i810_dma_cleanup(struct drm_device *dev)
                    (drm_i810_private_t *) dev->dev_private;
 
                if (dev_priv->ring.virtual_start)
-                       drm_core_ioremapfree(&dev_priv->ring.map, dev);
+                       drm_legacy_ioremapfree(&dev_priv->ring.map, dev);
                if (dev_priv->hw_status_page) {
                        pci_free_consistent(dev->pdev, PAGE_SIZE,
                                            dev_priv->hw_status_page,
@@ -227,7 +227,7 @@ static int i810_dma_cleanup(struct drm_device *dev)
                        drm_i810_buf_priv_t *buf_priv = buf->dev_private;
 
                        if (buf_priv->kernel_virtual && buf->total)
-                               drm_core_ioremapfree(&buf_priv->map, dev);
+                               drm_legacy_ioremapfree(&buf_priv->map, dev);
                }
        }
        return 0;
@@ -306,7 +306,7 @@ static int i810_freelist_init(struct drm_device *dev, drm_i810_private_t *dev_pr
                buf_priv->map.flags = 0;
                buf_priv->map.mtrr = 0;
 
-               drm_core_ioremap(&buf_priv->map, dev);
+               drm_legacy_ioremap(&buf_priv->map, dev);
                buf_priv->kernel_virtual = buf_priv->map.handle;
 
        }
@@ -334,7 +334,7 @@ static int i810_dma_initialize(struct drm_device *dev,
                DRM_ERROR("can not find sarea!\n");
                return -EINVAL;
        }
-       dev_priv->mmio_map = drm_core_findmap(dev, init->mmio_offset);
+       dev_priv->mmio_map = drm_legacy_findmap(dev, init->mmio_offset);
        if (!dev_priv->mmio_map) {
                dev->dev_private = (void *)dev_priv;
                i810_dma_cleanup(dev);
@@ -342,7 +342,7 @@ static int i810_dma_initialize(struct drm_device *dev,
                return -EINVAL;
        }
        dev->agp_buffer_token = init->buffers_offset;
-       dev->agp_buffer_map = drm_core_findmap(dev, init->buffers_offset);
+       dev->agp_buffer_map = drm_legacy_findmap(dev, init->buffers_offset);
        if (!dev->agp_buffer_map) {
                dev->dev_private = (void *)dev_priv;
                i810_dma_cleanup(dev);
@@ -363,7 +363,7 @@ static int i810_dma_initialize(struct drm_device *dev,
        dev_priv->ring.map.flags = 0;
        dev_priv->ring.map.mtrr = 0;
 
-       drm_core_ioremap(&dev_priv->ring.map, dev);
+       drm_legacy_ioremap(&dev_priv->ring.map, dev);
 
        if (dev_priv->ring.map.handle == NULL) {
                dev->dev_private = (void *)dev_priv;
index 37d80c1..8cfa9cb 100644 (file)
@@ -566,9 +566,9 @@ static int mga_do_agp_dma_bootstrap(struct drm_device *dev,
                return err;
        }
 
-       drm_core_ioremap(dev_priv->warp, dev);
-       drm_core_ioremap(dev_priv->primary, dev);
-       drm_core_ioremap(dev->agp_buffer_map, dev);
+       drm_legacy_ioremap(dev_priv->warp, dev);
+       drm_legacy_ioremap(dev_priv->primary, dev);
+       drm_legacy_ioremap(dev->agp_buffer_map, dev);
 
        if (!dev_priv->warp->handle ||
            !dev_priv->primary->handle || !dev->agp_buffer_map->handle) {
@@ -821,37 +821,37 @@ static int mga_do_init_dma(struct drm_device *dev, drm_mga_init_t *init)
                dev_priv->dma_access = MGA_PAGPXFER;
                dev_priv->wagp_enable = MGA_WAGP_ENABLE;
 
-               dev_priv->status = drm_core_findmap(dev, init->status_offset);
+               dev_priv->status = drm_legacy_findmap(dev, init->status_offset);
                if (!dev_priv->status) {
                        DRM_ERROR("failed to find status page!\n");
                        return -EINVAL;
                }
-               dev_priv->mmio = drm_core_findmap(dev, init->mmio_offset);
+               dev_priv->mmio = drm_legacy_findmap(dev, init->mmio_offset);
                if (!dev_priv->mmio) {
                        DRM_ERROR("failed to find mmio region!\n");
                        return -EINVAL;
                }
-               dev_priv->warp = drm_core_findmap(dev, init->warp_offset);
+               dev_priv->warp = drm_legacy_findmap(dev, init->warp_offset);
                if (!dev_priv->warp) {
                        DRM_ERROR("failed to find warp microcode region!\n");
                        return -EINVAL;
                }
-               dev_priv->primary = drm_core_findmap(dev, init->primary_offset);
+               dev_priv->primary = drm_legacy_findmap(dev, init->primary_offset);
                if (!dev_priv->primary) {
                        DRM_ERROR("failed to find primary dma region!\n");
                        return -EINVAL;
                }
                dev->agp_buffer_token = init->buffers_offset;
                dev->agp_buffer_map =
-                   drm_core_findmap(dev, init->buffers_offset);
+                   drm_legacy_findmap(dev, init->buffers_offset);
                if (!dev->agp_buffer_map) {
                        DRM_ERROR("failed to find dma buffer region!\n");
                        return -EINVAL;
                }
 
-               drm_core_ioremap(dev_priv->warp, dev);
-               drm_core_ioremap(dev_priv->primary, dev);
-               drm_core_ioremap(dev->agp_buffer_map, dev);
+               drm_legacy_ioremap(dev_priv->warp, dev);
+               drm_legacy_ioremap(dev_priv->primary, dev);
+               drm_legacy_ioremap(dev->agp_buffer_map, dev);
        }
 
        dev_priv->sarea_priv =
@@ -937,14 +937,14 @@ static int mga_do_cleanup_dma(struct drm_device *dev, int full_cleanup)
 
                if ((dev_priv->warp != NULL)
                    && (dev_priv->warp->type != _DRM_CONSISTENT))
-                       drm_core_ioremapfree(dev_priv->warp, dev);
+                       drm_legacy_ioremapfree(dev_priv->warp, dev);
 
                if ((dev_priv->primary != NULL)
                    && (dev_priv->primary->type != _DRM_CONSISTENT))
-                       drm_core_ioremapfree(dev_priv->primary, dev);
+                       drm_legacy_ioremapfree(dev_priv->primary, dev);
 
                if (dev->agp_buffer_map != NULL)
-                       drm_core_ioremapfree(dev->agp_buffer_map, dev);
+                       drm_legacy_ioremapfree(dev->agp_buffer_map, dev);
 
                if (dev_priv->used_new_dma_init) {
 #if __OS_HAS_AGP
index 1fae2f7..2c45ac9 100644 (file)
@@ -460,21 +460,21 @@ static int r128_do_init_cce(struct drm_device *dev, drm_r128_init_t *init)
                return -EINVAL;
        }
 
-       dev_priv->mmio = drm_core_findmap(dev, init->mmio_offset);
+       dev_priv->mmio = drm_legacy_findmap(dev, init->mmio_offset);
        if (!dev_priv->mmio) {
                DRM_ERROR("could not find mmio region!\n");
                dev->dev_private = (void *)dev_priv;
                r128_do_cleanup_cce(dev);
                return -EINVAL;
        }
-       dev_priv->cce_ring = drm_core_findmap(dev, init->ring_offset);
+       dev_priv->cce_ring = drm_legacy_findmap(dev, init->ring_offset);
        if (!dev_priv->cce_ring) {
                DRM_ERROR("could not find cce ring region!\n");
                dev->dev_private = (void *)dev_priv;
                r128_do_cleanup_cce(dev);
                return -EINVAL;
        }
-       dev_priv->ring_rptr = drm_core_findmap(dev, init->ring_rptr_offset);
+       dev_priv->ring_rptr = drm_legacy_findmap(dev, init->ring_rptr_offset);
        if (!dev_priv->ring_rptr) {
                DRM_ERROR("could not find ring read pointer!\n");
                dev->dev_private = (void *)dev_priv;
@@ -482,7 +482,7 @@ static int r128_do_init_cce(struct drm_device *dev, drm_r128_init_t *init)
                return -EINVAL;
        }
        dev->agp_buffer_token = init->buffers_offset;
-       dev->agp_buffer_map = drm_core_findmap(dev, init->buffers_offset);
+       dev->agp_buffer_map = drm_legacy_findmap(dev, init->buffers_offset);
        if (!dev->agp_buffer_map) {
                DRM_ERROR("could not find dma buffer region!\n");
                dev->dev_private = (void *)dev_priv;
@@ -492,7 +492,7 @@ static int r128_do_init_cce(struct drm_device *dev, drm_r128_init_t *init)
 
        if (!dev_priv->is_pci) {
                dev_priv->agp_textures =
-                   drm_core_findmap(dev, init->agp_textures_offset);
+                   drm_legacy_findmap(dev, init->agp_textures_offset);
                if (!dev_priv->agp_textures) {
                        DRM_ERROR("could not find agp texture region!\n");
                        dev->dev_private = (void *)dev_priv;
@@ -507,9 +507,9 @@ static int r128_do_init_cce(struct drm_device *dev, drm_r128_init_t *init)
 
 #if __OS_HAS_AGP
        if (!dev_priv->is_pci) {
-               drm_core_ioremap_wc(dev_priv->cce_ring, dev);
-               drm_core_ioremap_wc(dev_priv->ring_rptr, dev);
-               drm_core_ioremap_wc(dev->agp_buffer_map, dev);
+               drm_legacy_ioremap_wc(dev_priv->cce_ring, dev);
+               drm_legacy_ioremap_wc(dev_priv->ring_rptr, dev);
+               drm_legacy_ioremap_wc(dev->agp_buffer_map, dev);
                if (!dev_priv->cce_ring->handle ||
                    !dev_priv->ring_rptr->handle ||
                    !dev->agp_buffer_map->handle) {
@@ -603,11 +603,11 @@ int r128_do_cleanup_cce(struct drm_device *dev)
 #if __OS_HAS_AGP
                if (!dev_priv->is_pci) {
                        if (dev_priv->cce_ring != NULL)
-                               drm_core_ioremapfree(dev_priv->cce_ring, dev);
+                               drm_legacy_ioremapfree(dev_priv->cce_ring, dev);
                        if (dev_priv->ring_rptr != NULL)
-                               drm_core_ioremapfree(dev_priv->ring_rptr, dev);
+                               drm_legacy_ioremapfree(dev_priv->ring_rptr, dev);
                        if (dev->agp_buffer_map != NULL) {
-                               drm_core_ioremapfree(dev->agp_buffer_map, dev);
+                               drm_legacy_ioremapfree(dev->agp_buffer_map, dev);
                                dev->agp_buffer_map = NULL;
                        }
                } else
index 639d668..09e3f39 100644 (file)
@@ -1949,15 +1949,15 @@ int r600_do_cleanup_cp(struct drm_device *dev)
 #if __OS_HAS_AGP
        if (dev_priv->flags & RADEON_IS_AGP) {
                if (dev_priv->cp_ring != NULL) {
-                       drm_core_ioremapfree(dev_priv->cp_ring, dev);
+                       drm_legacy_ioremapfree(dev_priv->cp_ring, dev);
                        dev_priv->cp_ring = NULL;
                }
                if (dev_priv->ring_rptr != NULL) {
-                       drm_core_ioremapfree(dev_priv->ring_rptr, dev);
+                       drm_legacy_ioremapfree(dev_priv->ring_rptr, dev);
                        dev_priv->ring_rptr = NULL;
                }
                if (dev->agp_buffer_map != NULL) {
-                       drm_core_ioremapfree(dev->agp_buffer_map, dev);
+                       drm_legacy_ioremapfree(dev->agp_buffer_map, dev);
                        dev->agp_buffer_map = NULL;
                }
        } else
@@ -1968,7 +1968,7 @@ int r600_do_cleanup_cp(struct drm_device *dev)
                        r600_page_table_cleanup(dev, &dev_priv->gart_info);
 
                if (dev_priv->gart_info.gart_table_location == DRM_ATI_GART_FB) {
-                       drm_core_ioremapfree(&dev_priv->gart_info.mapping, dev);
+                       drm_legacy_ioremapfree(&dev_priv->gart_info.mapping, dev);
                        dev_priv->gart_info.addr = NULL;
                }
        }
@@ -2059,20 +2059,20 @@ int r600_do_init_cp(struct drm_device *dev, drm_radeon_init_t *init,
                return -EINVAL;
        }
 
-       dev_priv->cp_ring = drm_core_findmap(dev, init->ring_offset);
+       dev_priv->cp_ring = drm_legacy_findmap(dev, init->ring_offset);
        if (!dev_priv->cp_ring) {
                DRM_ERROR("could not find cp ring region!\n");
                r600_do_cleanup_cp(dev);
                return -EINVAL;
        }
-       dev_priv->ring_rptr = drm_core_findmap(dev, init->ring_rptr_offset);
+       dev_priv->ring_rptr = drm_legacy_findmap(dev, init->ring_rptr_offset);
        if (!dev_priv->ring_rptr) {
                DRM_ERROR("could not find ring read pointer!\n");
                r600_do_cleanup_cp(dev);
                return -EINVAL;
        }
        dev->agp_buffer_token = init->buffers_offset;
-       dev->agp_buffer_map = drm_core_findmap(dev, init->buffers_offset);
+       dev->agp_buffer_map = drm_legacy_findmap(dev, init->buffers_offset);
        if (!dev->agp_buffer_map) {
                DRM_ERROR("could not find dma buffer region!\n");
                r600_do_cleanup_cp(dev);
@@ -2081,7 +2081,7 @@ int r600_do_init_cp(struct drm_device *dev, drm_radeon_init_t *init,
 
        if (init->gart_textures_offset) {
                dev_priv->gart_textures =
-                   drm_core_findmap(dev, init->gart_textures_offset);
+                   drm_legacy_findmap(dev, init->gart_textures_offset);
                if (!dev_priv->gart_textures) {
                        DRM_ERROR("could not find GART texture region!\n");
                        r600_do_cleanup_cp(dev);
@@ -2092,9 +2092,9 @@ int r600_do_init_cp(struct drm_device *dev, drm_radeon_init_t *init,
 #if __OS_HAS_AGP
        /* XXX */
        if (dev_priv->flags & RADEON_IS_AGP) {
-               drm_core_ioremap_wc(dev_priv->cp_ring, dev);
-               drm_core_ioremap_wc(dev_priv->ring_rptr, dev);
-               drm_core_ioremap_wc(dev->agp_buffer_map, dev);
+               drm_legacy_ioremap_wc(dev_priv->cp_ring, dev);
+               drm_legacy_ioremap_wc(dev_priv->ring_rptr, dev);
+               drm_legacy_ioremap_wc(dev->agp_buffer_map, dev);
                if (!dev_priv->cp_ring->handle ||
                    !dev_priv->ring_rptr->handle ||
                    !dev->agp_buffer_map->handle) {
@@ -2235,7 +2235,7 @@ int r600_do_init_cp(struct drm_device *dev, drm_radeon_init_t *init,
                dev_priv->gart_info.mapping.size =
                        dev_priv->gart_info.table_size;
 
-               drm_core_ioremap_wc(&dev_priv->gart_info.mapping, dev);
+               drm_legacy_ioremap_wc(&dev_priv->gart_info.mapping, dev);
                if (!dev_priv->gart_info.mapping.handle) {
                        DRM_ERROR("ioremap failed.\n");
                        r600_do_cleanup_cp(dev);
index 0c38801..ea134a7 100644 (file)
@@ -1305,20 +1305,20 @@ static int radeon_do_init_cp(struct drm_device *dev, drm_radeon_init_t *init,
                return -EINVAL;
        }
 
-       dev_priv->cp_ring = drm_core_findmap(dev, init->ring_offset);
+       dev_priv->cp_ring = drm_legacy_findmap(dev, init->ring_offset);
        if (!dev_priv->cp_ring) {
                DRM_ERROR("could not find cp ring region!\n");
                radeon_do_cleanup_cp(dev);
                return -EINVAL;
        }
-       dev_priv->ring_rptr = drm_core_findmap(dev, init->ring_rptr_offset);
+       dev_priv->ring_rptr = drm_legacy_findmap(dev, init->ring_rptr_offset);
        if (!dev_priv->ring_rptr) {
                DRM_ERROR("could not find ring read pointer!\n");
                radeon_do_cleanup_cp(dev);
                return -EINVAL;
        }
        dev->agp_buffer_token = init->buffers_offset;
-       dev->agp_buffer_map = drm_core_findmap(dev, init->buffers_offset);
+       dev->agp_buffer_map = drm_legacy_findmap(dev, init->buffers_offset);
        if (!dev->agp_buffer_map) {
                DRM_ERROR("could not find dma buffer region!\n");
                radeon_do_cleanup_cp(dev);
@@ -1327,7 +1327,7 @@ static int radeon_do_init_cp(struct drm_device *dev, drm_radeon_init_t *init,
 
        if (init->gart_textures_offset) {
                dev_priv->gart_textures =
-                   drm_core_findmap(dev, init->gart_textures_offset);
+                   drm_legacy_findmap(dev, init->gart_textures_offset);
                if (!dev_priv->gart_textures) {
                        DRM_ERROR("could not find GART texture region!\n");
                        radeon_do_cleanup_cp(dev);
@@ -1337,9 +1337,9 @@ static int radeon_do_init_cp(struct drm_device *dev, drm_radeon_init_t *init,
 
 #if __OS_HAS_AGP
        if (dev_priv->flags & RADEON_IS_AGP) {
-               drm_core_ioremap_wc(dev_priv->cp_ring, dev);
-               drm_core_ioremap_wc(dev_priv->ring_rptr, dev);
-               drm_core_ioremap_wc(dev->agp_buffer_map, dev);
+               drm_legacy_ioremap_wc(dev_priv->cp_ring, dev);
+               drm_legacy_ioremap_wc(dev_priv->ring_rptr, dev);
+               drm_legacy_ioremap_wc(dev->agp_buffer_map, dev);
                if (!dev_priv->cp_ring->handle ||
                    !dev_priv->ring_rptr->handle ||
                    !dev->agp_buffer_map->handle) {
@@ -1475,7 +1475,7 @@ static int radeon_do_init_cp(struct drm_device *dev, drm_radeon_init_t *init,
                        dev_priv->gart_info.mapping.size =
                            dev_priv->gart_info.table_size;
 
-                       drm_core_ioremap_wc(&dev_priv->gart_info.mapping, dev);
+                       drm_legacy_ioremap_wc(&dev_priv->gart_info.mapping, dev);
                        dev_priv->gart_info.addr =
                            dev_priv->gart_info.mapping.handle;
 
@@ -1569,15 +1569,15 @@ static int radeon_do_cleanup_cp(struct drm_device * dev)
 #if __OS_HAS_AGP
        if (dev_priv->flags & RADEON_IS_AGP) {
                if (dev_priv->cp_ring != NULL) {
-                       drm_core_ioremapfree(dev_priv->cp_ring, dev);
+                       drm_legacy_ioremapfree(dev_priv->cp_ring, dev);
                        dev_priv->cp_ring = NULL;
                }
                if (dev_priv->ring_rptr != NULL) {
-                       drm_core_ioremapfree(dev_priv->ring_rptr, dev);
+                       drm_legacy_ioremapfree(dev_priv->ring_rptr, dev);
                        dev_priv->ring_rptr = NULL;
                }
                if (dev->agp_buffer_map != NULL) {
-                       drm_core_ioremapfree(dev->agp_buffer_map, dev);
+                       drm_legacy_ioremapfree(dev->agp_buffer_map, dev);
                        dev->agp_buffer_map = NULL;
                }
        } else
@@ -1597,7 +1597,7 @@ static int radeon_do_cleanup_cp(struct drm_device * dev)
 
                if (dev_priv->gart_info.gart_table_location == DRM_ATI_GART_FB)
                {
-                       drm_core_ioremapfree(&dev_priv->gart_info.mapping, dev);
+                       drm_legacy_ioremapfree(&dev_priv->gart_info.mapping, dev);
                        dev_priv->gart_info.addr = NULL;
                }
        }
index 9288d30..d47dff9 100644 (file)
@@ -706,7 +706,7 @@ static int savage_do_init_bci(struct drm_device * dev, drm_savage_init_t * init)
                return -EINVAL;
        }
        if (init->status_offset != 0) {
-               dev_priv->status = drm_core_findmap(dev, init->status_offset);
+               dev_priv->status = drm_legacy_findmap(dev, init->status_offset);
                if (!dev_priv->status) {
                        DRM_ERROR("could not find shadow status region!\n");
                        savage_do_cleanup_bci(dev);
@@ -717,14 +717,14 @@ static int savage_do_init_bci(struct drm_device * dev, drm_savage_init_t * init)
        }
        if (dev_priv->dma_type == SAVAGE_DMA_AGP && init->buffers_offset) {
                dev->agp_buffer_token = init->buffers_offset;
-               dev->agp_buffer_map = drm_core_findmap(dev,
+               dev->agp_buffer_map = drm_legacy_findmap(dev,
                                                       init->buffers_offset);
                if (!dev->agp_buffer_map) {
                        DRM_ERROR("could not find DMA buffer region!\n");
                        savage_do_cleanup_bci(dev);
                        return -EINVAL;
                }
-               drm_core_ioremap(dev->agp_buffer_map, dev);
+               drm_legacy_ioremap(dev->agp_buffer_map, dev);
                if (!dev->agp_buffer_map->handle) {
                        DRM_ERROR("failed to ioremap DMA buffer region!\n");
                        savage_do_cleanup_bci(dev);
@@ -733,7 +733,7 @@ static int savage_do_init_bci(struct drm_device * dev, drm_savage_init_t * init)
        }
        if (init->agp_textures_offset) {
                dev_priv->agp_textures =
-                   drm_core_findmap(dev, init->agp_textures_offset);
+                   drm_legacy_findmap(dev, init->agp_textures_offset);
                if (!dev_priv->agp_textures) {
                        DRM_ERROR("could not find agp texture region!\n");
                        savage_do_cleanup_bci(dev);
@@ -756,7 +756,7 @@ static int savage_do_init_bci(struct drm_device * dev, drm_savage_init_t * init)
                        savage_do_cleanup_bci(dev);
                        return -EINVAL;
                }
-               dev_priv->cmd_dma = drm_core_findmap(dev, init->cmd_dma_offset);
+               dev_priv->cmd_dma = drm_legacy_findmap(dev, init->cmd_dma_offset);
                if (!dev_priv->cmd_dma) {
                        DRM_ERROR("could not find command DMA region!\n");
                        savage_do_cleanup_bci(dev);
@@ -769,7 +769,7 @@ static int savage_do_init_bci(struct drm_device * dev, drm_savage_init_t * init)
                                savage_do_cleanup_bci(dev);
                                return -EINVAL;
                        }
-                       drm_core_ioremap(dev_priv->cmd_dma, dev);
+                       drm_legacy_ioremap(dev_priv->cmd_dma, dev);
                        if (!dev_priv->cmd_dma->handle) {
                                DRM_ERROR("failed to ioremap command "
                                          "DMA region!\n");
@@ -895,11 +895,11 @@ static int savage_do_cleanup_bci(struct drm_device * dev)
        } else if (dev_priv->cmd_dma && dev_priv->cmd_dma->handle &&
                   dev_priv->cmd_dma->type == _DRM_AGP &&
                   dev_priv->dma_type == SAVAGE_DMA_AGP)
-               drm_core_ioremapfree(dev_priv->cmd_dma, dev);
+               drm_legacy_ioremapfree(dev_priv->cmd_dma, dev);
 
        if (dev_priv->dma_type == SAVAGE_DMA_AGP &&
            dev->agp_buffer_map && dev->agp_buffer_map->handle) {
-               drm_core_ioremapfree(dev->agp_buffer_map, dev);
+               drm_legacy_ioremapfree(dev->agp_buffer_map, dev);
                /* make sure the next instance (which may be running
                 * in PCI mode) doesn't try to use an old
                 * agp_buffer_map. */
index 6fc0648..d17d8f2 100644 (file)
@@ -161,7 +161,7 @@ int via_dma_cleanup(struct drm_device *dev)
                if (dev_priv->ring.virtual_start) {
                        via_cmdbuf_reset(dev_priv);
 
-                       drm_core_ioremapfree(&dev_priv->ring.map, dev);
+                       drm_legacy_ioremapfree(&dev_priv->ring.map, dev);
                        dev_priv->ring.virtual_start = NULL;
                }
 
@@ -200,7 +200,7 @@ static int via_initialize(struct drm_device *dev,
        dev_priv->ring.map.flags = 0;
        dev_priv->ring.map.mtrr = 0;
 
-       drm_core_ioremap(&dev_priv->ring.map, dev);
+       drm_legacy_ioremap(&dev_priv->ring.map, dev);
 
        if (dev_priv->ring.map.handle == NULL) {
                via_dma_cleanup(dev);
index 67e70e9..0b3522d 100644 (file)
@@ -39,14 +39,14 @@ static int via_do_init_map(struct drm_device *dev, drm_via_init_t *init)
                return -EINVAL;
        }
 
-       dev_priv->fb = drm_core_findmap(dev, init->fb_offset);
+       dev_priv->fb = drm_legacy_findmap(dev, init->fb_offset);
        if (!dev_priv->fb) {
                DRM_ERROR("could not find framebuffer!\n");
                dev->dev_private = (void *)dev_priv;
                via_do_cleanup_map(dev);
                return -EINVAL;
        }
-       dev_priv->mmio = drm_core_findmap(dev, init->mmio_offset);
+       dev_priv->mmio = drm_legacy_findmap(dev, init->mmio_offset);
        if (!dev_priv->mmio) {
                DRM_ERROR("could not find mmio region!\n");
                dev->dev_private = (void *)dev_priv;
index ac4ca4b..4a72db4 100644 (file)
@@ -1310,24 +1310,6 @@ struct drm_gem_object *drm_gem_object_lookup(struct drm_device *dev,
                                             struct drm_file *filp,
                                             u32 handle);
 
-extern void drm_core_ioremap(struct drm_local_map *map, struct drm_device *dev);
-extern void drm_core_ioremap_wc(struct drm_local_map *map, struct drm_device *dev);
-extern void drm_core_ioremapfree(struct drm_local_map *map, struct drm_device *dev);
-
-static __inline__ struct drm_local_map *drm_core_findmap(struct drm_device *dev,
-                                                        unsigned int token)
-{
-       struct drm_map_list *_entry;
-       list_for_each_entry(_entry, &dev->maplist, head)
-           if (_entry->user_token == token)
-               return _entry->map;
-       return NULL;
-}
-
-static __inline__ void drm_core_dropmap(struct drm_local_map *map)
-{
-}
-
 struct drm_device *drm_dev_alloc(struct drm_driver *driver,
                                 struct device *parent);
 void drm_dev_ref(struct drm_device *dev);
index 9862631..cc6e528 100644 (file)
@@ -58,4 +58,19 @@ void drm_legacy_idlelock_release(struct drm_lock_data *lock);
 /* drm_pci.c dma alloc wrappers */
 void __drm_legacy_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah);
 
+/* drm_memory.c */
+void drm_legacy_ioremap(struct drm_local_map *map, struct drm_device *dev);
+void drm_legacy_ioremap_wc(struct drm_local_map *map, struct drm_device *dev);
+void drm_legacy_ioremapfree(struct drm_local_map *map, struct drm_device *dev);
+
+static __inline__ struct drm_local_map *drm_legacy_findmap(struct drm_device *dev,
+                                                          unsigned int token)
+{
+       struct drm_map_list *_entry;
+       list_for_each_entry(_entry, &dev->maplist, head)
+           if (_entry->user_token == token)
+               return _entry->map;
+       return NULL;
+}
+
 #endif /* __DRM_DRM_LEGACY_H__ */