summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--linux-core/drmP.h82
-rw-r--r--linux-core/drm_memory.h1
-rw-r--r--linux-core/i810_dma.c4
-rw-r--r--linux-core/i830_dma.c4
-rw-r--r--linux/drmP.h82
-rw-r--r--linux/drm_memory.h1
-rw-r--r--linux/gamma_dma.c19
-rw-r--r--linux/i810_dma.c4
-rw-r--r--linux/i830_dma.c4
-rw-r--r--shared-core/i915_dma.c8
-rw-r--r--shared-core/mach64_dma.c19
-rw-r--r--shared-core/mga_dma.c23
-rw-r--r--shared-core/r128_cce.c23
-rw-r--r--shared-core/radeon_cp.c22
-rw-r--r--shared-core/via_map.c4
-rw-r--r--shared/i915_dma.c8
-rw-r--r--shared/mach64_dma.c19
-rw-r--r--shared/mga_dma.c23
-rw-r--r--shared/r128_cce.c23
-rw-r--r--shared/radeon_cp.c22
-rw-r--r--shared/via_map.c4
21 files changed, 183 insertions, 216 deletions
diff --git a/linux-core/drmP.h b/linux-core/drmP.h
index d50bb2d98..2f5bc8fdc 100644
--- a/linux-core/drmP.h
+++ b/linux-core/drmP.h
@@ -219,54 +219,6 @@
/***********************************************************************/
-/** \name Mapping helper macros */
-/*@{*/
-
-#define DRM_IOREMAP(map, dev) \
- (map)->handle = DRM(ioremap)( (map)->offset, (map)->size, (dev) )
-
-#define DRM_IOREMAP_NOCACHE(map, dev) \
- (map)->handle = DRM(ioremap_nocache)((map)->offset, (map)->size, (dev))
-
-#define DRM_IOREMAPFREE(map, dev) \
- do { \
- if ( (map)->handle && (map)->size ) \
- DRM(ioremapfree)( (map)->handle, (map)->size, (dev) ); \
- } while (0)
-
-/**
- * Find mapping.
- *
- * \param _map matching mapping if found, untouched otherwise.
- * \param _o offset.
- *
- * Expects the existence of a local variable named \p dev pointing to the
- * drm_device structure.
- */
-#define DRM_FIND_MAP(_map, _o) \
-do { \
- struct list_head *_list; \
- list_for_each( _list, &dev->maplist->head ) { \
- drm_map_list_t *_entry = list_entry( _list, drm_map_list_t, head ); \
- if ( _entry->map && \
- _entry->map->offset == (_o) ) { \
- (_map) = _entry->map; \
- break; \
- } \
- } \
-} while(0)
-
-/**
- * Drop mapping.
- *
- * \sa #DRM_FIND_MAP.
- */
-#define DRM_DROP_MAP(_map)
-
-/*@}*/
-
-
-/***********************************************************************/
/** \name Internal types and structures */
/*@{*/
@@ -985,6 +937,40 @@ extern void *DRM(pci_alloc)(drm_device_t *dev, size_t size,
extern void DRM(pci_free)(drm_device_t *dev, size_t size,
void *vaddr, dma_addr_t busaddr);
+
+/* Inline replacements for DRM_IOREMAP macros */
+static __inline__ void drm_core_ioremap(struct drm_map *map, struct drm_device *dev)
+{
+ map->handle = DRM(ioremap)( map->offset, map->size, dev );
+}
+
+static __inline__ void drm_core_ioremap_nocache(struct drm_map *map, struct drm_device *dev)
+{
+ map->handle = DRM(ioremap_nocache)(map->offset, map->size, dev);
+}
+
+static __inline__ void drm_core_ioremapfree(struct drm_map *map, struct drm_device *dev)
+{
+ if ( map->handle && map->size )
+ DRM(ioremapfree)( map->handle, map->size, dev );
+}
+
+static __inline__ struct drm_map *drm_core_findmap(struct drm_device *dev, unsigned long offset)
+{
+ struct list_head *_list;
+ list_for_each( _list, &dev->maplist->head ) {
+ drm_map_list_t *_entry = list_entry( _list, drm_map_list_t, head );
+ if ( _entry->map &&
+ _entry->map->offset == offset ) {
+ return _entry->map;
+ }
+ }
+ return NULL;
+}
+
+static __inline__ void drm_core_dropmap(struct drm_map *map)
+{
+}
/*@}*/
#endif /* __KERNEL__ */
diff --git a/linux-core/drm_memory.h b/linux-core/drm_memory.h
index c6ea1fcc5..d1c4b23a6 100644
--- a/linux-core/drm_memory.h
+++ b/linux-core/drm_memory.h
@@ -199,6 +199,7 @@ static inline void drm_ioremapfree(void *pt, unsigned long size, drm_device_t *d
iounmap(pt);
}
+
#if DEBUG_MEMORY
#include "drm_memory_debug.h"
#else
diff --git a/linux-core/i810_dma.c b/linux-core/i810_dma.c
index b09487e85..d558988f7 100644
--- a/linux-core/i810_dma.c
+++ b/linux-core/i810_dma.c
@@ -371,14 +371,14 @@ static int i810_dma_initialize(drm_device_t *dev,
DRM_ERROR("can not find sarea!\n");
return -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;
i810_dma_cleanup(dev);
DRM_ERROR("can not find mmio map!\n");
return -EINVAL;
}
- DRM_FIND_MAP( dev->agp_buffer_map, init->buffers_offset );
+ dev->agp_buffer_map = drm_core_findmap(dev, init->buffers_offset);
if (!dev->agp_buffer_map) {
dev->dev_private = (void *)dev_priv;
i810_dma_cleanup(dev);
diff --git a/linux-core/i830_dma.c b/linux-core/i830_dma.c
index 220056046..1a8c6336d 100644
--- a/linux-core/i830_dma.c
+++ b/linux-core/i830_dma.c
@@ -378,14 +378,14 @@ static int i830_dma_initialize(drm_device_t *dev,
DRM_ERROR("can not find sarea!\n");
return -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;
i830_dma_cleanup(dev);
DRM_ERROR("can not find mmio map!\n");
return -EINVAL;
}
- DRM_FIND_MAP( dev->agp_buffer_map, init->buffers_offset );
+ dev->agp_buffer_map = drm_core_findmap(dev, init->buffers_offset);
if(!dev->agp_buffer_map) {
dev->dev_private = (void *)dev_priv;
i830_dma_cleanup(dev);
diff --git a/linux/drmP.h b/linux/drmP.h
index d50bb2d98..2f5bc8fdc 100644
--- a/linux/drmP.h
+++ b/linux/drmP.h
@@ -219,54 +219,6 @@
/***********************************************************************/
-/** \name Mapping helper macros */
-/*@{*/
-
-#define DRM_IOREMAP(map, dev) \
- (map)->handle = DRM(ioremap)( (map)->offset, (map)->size, (dev) )
-
-#define DRM_IOREMAP_NOCACHE(map, dev) \
- (map)->handle = DRM(ioremap_nocache)((map)->offset, (map)->size, (dev))
-
-#define DRM_IOREMAPFREE(map, dev) \
- do { \
- if ( (map)->handle && (map)->size ) \
- DRM(ioremapfree)( (map)->handle, (map)->size, (dev) ); \
- } while (0)
-
-/**
- * Find mapping.
- *
- * \param _map matching mapping if found, untouched otherwise.
- * \param _o offset.
- *
- * Expects the existence of a local variable named \p dev pointing to the
- * drm_device structure.
- */
-#define DRM_FIND_MAP(_map, _o) \
-do { \
- struct list_head *_list; \
- list_for_each( _list, &dev->maplist->head ) { \
- drm_map_list_t *_entry = list_entry( _list, drm_map_list_t, head ); \
- if ( _entry->map && \
- _entry->map->offset == (_o) ) { \
- (_map) = _entry->map; \
- break; \
- } \
- } \
-} while(0)
-
-/**
- * Drop mapping.
- *
- * \sa #DRM_FIND_MAP.
- */
-#define DRM_DROP_MAP(_map)
-
-/*@}*/
-
-
-/***********************************************************************/
/** \name Internal types and structures */
/*@{*/
@@ -985,6 +937,40 @@ extern void *DRM(pci_alloc)(drm_device_t *dev, size_t size,
extern void DRM(pci_free)(drm_device_t *dev, size_t size,
void *vaddr, dma_addr_t busaddr);
+
+/* Inline replacements for DRM_IOREMAP macros */
+static __inline__ void drm_core_ioremap(struct drm_map *map, struct drm_device *dev)
+{
+ map->handle = DRM(ioremap)( map->offset, map->size, dev );
+}
+
+static __inline__ void drm_core_ioremap_nocache(struct drm_map *map, struct drm_device *dev)
+{
+ map->handle = DRM(ioremap_nocache)(map->offset, map->size, dev);
+}
+
+static __inline__ void drm_core_ioremapfree(struct drm_map *map, struct drm_device *dev)
+{
+ if ( map->handle && map->size )
+ DRM(ioremapfree)( map->handle, map->size, dev );
+}
+
+static __inline__ struct drm_map *drm_core_findmap(struct drm_device *dev, unsigned long offset)
+{
+ struct list_head *_list;
+ list_for_each( _list, &dev->maplist->head ) {
+ drm_map_list_t *_entry = list_entry( _list, drm_map_list_t, head );
+ if ( _entry->map &&
+ _entry->map->offset == offset ) {
+ return _entry->map;
+ }
+ }
+ return NULL;
+}
+
+static __inline__ void drm_core_dropmap(struct drm_map *map)
+{
+}
/*@}*/
#endif /* __KERNEL__ */
diff --git a/linux/drm_memory.h b/linux/drm_memory.h
index c6ea1fcc5..d1c4b23a6 100644
--- a/linux/drm_memory.h
+++ b/linux/drm_memory.h
@@ -199,6 +199,7 @@ static inline void drm_ioremapfree(void *pt, unsigned long size, drm_device_t *d
iounmap(pt);
}
+
#if DEBUG_MEMORY
#include "drm_memory_debug.h"
#else
diff --git a/linux/gamma_dma.c b/linux/gamma_dma.c
index 0167e43ad..9b58a44a3 100644
--- a/linux/gamma_dma.c
+++ b/linux/gamma_dma.c
@@ -646,12 +646,12 @@ static int gamma_do_init_dma( drm_device_t *dev, drm_gamma_init_t *init )
break;
}
}
-
- DRM_FIND_MAP( dev_priv->mmio0, init->mmio0 );
- DRM_FIND_MAP( dev_priv->mmio1, init->mmio1 );
- DRM_FIND_MAP( dev_priv->mmio2, init->mmio2 );
- DRM_FIND_MAP( dev_priv->mmio3, init->mmio3 );
-
+
+ dev_priv->mmio0 = drm_core_findmap(dev, init->mmio0);
+ dev_priv->mmio1 = drm_core_findmap(dev, init->mmio1);
+ dev_priv->mmio2 = drm_core_findmap(dev, init->mmio2);
+ dev_priv->mmio3 = drm_core_findmap(dev, init->mmio3);
+
dev_priv->sarea_priv = (drm_gamma_sarea_t *)
((u8 *)dev_priv->sarea->handle +
init->sarea_priv_offset);
@@ -668,9 +668,8 @@ static int gamma_do_init_dma( drm_device_t *dev, drm_gamma_init_t *init )
buf = dma->buflist[GLINT_DRI_BUF_COUNT];
} else {
- DRM_FIND_MAP( dev->agp_buffer_map, init->buffers_offset );
-
- DRM_IOREMAP( dev->agp_buffer_map, dev );
+ dev->agp_buffer_map = drm_core_findmap(dev, init->buffers_offset);
+ drm_core_ioremap( dev->agp_buffer_map, dev);
buf = dma->buflist[GLINT_DRI_BUF_COUNT];
pgt = buf->address;
@@ -708,7 +707,7 @@ int gamma_do_cleanup_dma( drm_device_t *dev )
if ( dev->dev_private ) {
if ( dev->agp_buffer_map != NULL )
- DRM_IOREMAPFREE( dev->agp_buffer_map, dev );
+ drm_core_ioremapfree( dev->agp_buffer_map, dev );
DRM(free)( dev->dev_private, sizeof(drm_gamma_private_t),
DRM_MEM_DRIVER );
diff --git a/linux/i810_dma.c b/linux/i810_dma.c
index b09487e85..d558988f7 100644
--- a/linux/i810_dma.c
+++ b/linux/i810_dma.c
@@ -371,14 +371,14 @@ static int i810_dma_initialize(drm_device_t *dev,
DRM_ERROR("can not find sarea!\n");
return -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;
i810_dma_cleanup(dev);
DRM_ERROR("can not find mmio map!\n");
return -EINVAL;
}
- DRM_FIND_MAP( dev->agp_buffer_map, init->buffers_offset );
+ dev->agp_buffer_map = drm_core_findmap(dev, init->buffers_offset);
if (!dev->agp_buffer_map) {
dev->dev_private = (void *)dev_priv;
i810_dma_cleanup(dev);
diff --git a/linux/i830_dma.c b/linux/i830_dma.c
index 220056046..1a8c6336d 100644
--- a/linux/i830_dma.c
+++ b/linux/i830_dma.c
@@ -378,14 +378,14 @@ static int i830_dma_initialize(drm_device_t *dev,
DRM_ERROR("can not find sarea!\n");
return -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;
i830_dma_cleanup(dev);
DRM_ERROR("can not find mmio map!\n");
return -EINVAL;
}
- DRM_FIND_MAP( dev->agp_buffer_map, init->buffers_offset );
+ dev->agp_buffer_map = drm_core_findmap(dev, init->buffers_offset);
if(!dev->agp_buffer_map) {
dev->dev_private = (void *)dev_priv;
i830_dma_cleanup(dev);
diff --git a/shared-core/i915_dma.c b/shared-core/i915_dma.c
index ec3e19a16..72573cbb2 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;
diff --git a/shared-core/mach64_dma.c b/shared-core/mach64_dma.c
index bafbdc407..0acb784d0 100644
--- a/shared-core/mach64_dma.c
+++ b/shared-core/mach64_dma.c
@@ -655,14 +655,14 @@ static int mach64_do_dma_init( drm_device_t *dev, drm_mach64_init_t *init )
mach64_do_cleanup_dma(dev);
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->fb, init->fb_offset );
+ dev_priv->fb = drm_core_findmap(dev, init->fb_offset);
if (!dev_priv->fb) {
DRM_ERROR("can not find frame buffer map!\n");
dev->dev_private = (void *)dev_priv;
mach64_do_cleanup_dma(dev);
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->mmio, init->mmio_offset );
+ dev_priv->mmio = drm_core_findmap(dev, init->mmio_offset);
if (!dev_priv->mmio) {
DRM_ERROR("can not find mmio map!\n");
dev->dev_private = (void *)dev_priv;
@@ -675,14 +675,14 @@ static int mach64_do_dma_init( drm_device_t *dev, drm_mach64_init_t *init )
init->sarea_priv_offset);
if( !dev_priv->is_pci ) {
- DRM_FIND_MAP( dev_priv->ring_map, init->ring_offset );
+ dev_priv->ring_map = drm_core_findmap(dev, init->ring_offset);
if ( !dev_priv->ring_map ) {
DRM_ERROR( "can not find ring map!\n" );
dev->dev_private = (void *)dev_priv;
mach64_do_cleanup_dma(dev);
return DRM_ERR(EINVAL);
}
- DRM_IOREMAP( dev_priv->ring_map, dev );
+ drm_core_ioremap( dev_priv->ring_map, dev );
if ( !dev_priv->ring_map->handle ) {
DRM_ERROR( "can not ioremap virtual address for"
" descriptor ring\n" );
@@ -690,7 +690,7 @@ static int mach64_do_dma_init( drm_device_t *dev, drm_mach64_init_t *init )
mach64_do_cleanup_dma( dev );
return DRM_ERR(ENOMEM);
}
- DRM_FIND_MAP( dev->agp_buffer_map, init->buffers_offset );
+ dev->agp_buffer_map = drm_core_findmap(dev, init->buffers_offset);
if ( !dev->agp_buffer_map ) {
DRM_ERROR( "can not find dma buffer map!\n" );
dev->dev_private = (void *)dev_priv;
@@ -701,7 +701,7 @@ static int mach64_do_dma_init( drm_device_t *dev, drm_mach64_init_t *init )
dev isn't passed all the way though the mach64 - DA */
dev_priv->dev_buffers = dev->agp_buffer_map;
- DRM_IOREMAP( dev->agp_buffer_map, dev );
+ drm_core_ioremap( dev->agp_buffer_map, dev );
if ( !dev->agp_buffer_map->handle ) {
DRM_ERROR( "can not ioremap virtual address for"
" dma buffer\n" );
@@ -709,8 +709,7 @@ static int mach64_do_dma_init( drm_device_t *dev, drm_mach64_init_t *init )
mach64_do_cleanup_dma( dev );
return DRM_ERR(ENOMEM);
}
- DRM_FIND_MAP( dev_priv->agp_textures,
- init->agp_textures_offset );
+ dev_priv->agp_textures = drm_core_findmap(dev, init->agp_textures_offset);
if (!dev_priv->agp_textures) {
DRM_ERROR( "can not find agp texture region!\n" );
dev->dev_private = (void *)dev_priv;
@@ -991,11 +990,11 @@ int mach64_do_cleanup_dma( drm_device_t *dev )
}
} else {
if ( dev_priv->ring_map )
- DRM_IOREMAPFREE( dev_priv->ring_map, dev );
+ drm_core_ioremapfree( dev_priv->ring_map, dev );
}
if ( dev->agp_buffer_map )
- DRM_IOREMAPFREE( dev->agp_buffer_map, dev );
+ drm_core_ioremapfree( dev->agp_buffer_map, dev );
mach64_destroy_freelist( dev );
diff --git a/shared-core/mga_dma.c b/shared-core/mga_dma.c
index 7854a1d20..4a38b7d9d 100644
--- a/shared-core/mga_dma.c
+++ b/shared-core/mga_dma.c
@@ -500,7 +500,7 @@ static int mga_do_init_dma( drm_device_t *dev, drm_mga_init_t *init )
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->mmio, init->mmio_offset );
+ dev_priv->mmio = drm_core_findmap(dev, init->mmio_offset);
if(!dev_priv->mmio) {
DRM_ERROR( "failed to find mmio region!\n" );
/* Assign dev_private so we can do cleanup. */
@@ -508,7 +508,7 @@ static int mga_do_init_dma( drm_device_t *dev, drm_mga_init_t *init )
mga_do_cleanup_dma( dev );
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->status, init->status_offset );
+ dev_priv->status = drm_core_findmap(dev, init->status_offset);
if(!dev_priv->status) {
DRM_ERROR( "failed to find status page!\n" );
/* Assign dev_private so we can do cleanup. */
@@ -516,8 +516,7 @@ static int mga_do_init_dma( drm_device_t *dev, drm_mga_init_t *init )
mga_do_cleanup_dma( dev );
return DRM_ERR(EINVAL);
}
-
- DRM_FIND_MAP( dev_priv->warp, init->warp_offset );
+ dev_priv->warp = drm_core_findmap(dev, init->warp_offset);
if(!dev_priv->warp) {
DRM_ERROR( "failed to find warp microcode region!\n" );
/* Assign dev_private so we can do cleanup. */
@@ -525,7 +524,7 @@ static int mga_do_init_dma( drm_device_t *dev, drm_mga_init_t *init )
mga_do_cleanup_dma( dev );
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->primary, init->primary_offset );
+ dev_priv->primary = drm_core_findmap(dev, init->primary_offset);
if(!dev_priv->primary) {
DRM_ERROR( "failed to find primary dma region!\n" );
/* Assign dev_private so we can do cleanup. */
@@ -533,7 +532,7 @@ static int mga_do_init_dma( drm_device_t *dev, drm_mga_init_t *init )
mga_do_cleanup_dma( dev );
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev->agp_buffer_map, init->buffers_offset );
+ dev->agp_buffer_map = drm_core_findmap(dev, init->buffers_offset);
if(!dev->agp_buffer_map) {
DRM_ERROR( "failed to find dma buffer region!\n" );
/* Assign dev_private so we can do cleanup. */
@@ -546,9 +545,9 @@ static int mga_do_init_dma( drm_device_t *dev, drm_mga_init_t *init )
(drm_mga_sarea_t *)((u8 *)dev_priv->sarea->handle +
init->sarea_priv_offset);
- DRM_IOREMAP( dev_priv->warp, dev );
- DRM_IOREMAP( dev_priv->primary, dev );
- DRM_IOREMAP( dev->agp_buffer_map, dev );
+ drm_core_ioremap( dev_priv->warp, dev );
+ drm_core_ioremap( dev_priv->primary, dev );
+ drm_core_ioremap( dev->agp_buffer_map, dev );
if(!dev_priv->warp->handle ||
!dev_priv->primary->handle ||
@@ -643,11 +642,11 @@ int mga_do_cleanup_dma( drm_device_t *dev )
drm_mga_private_t *dev_priv = dev->dev_private;
if ( dev_priv->warp != NULL )
- DRM_IOREMAPFREE( dev_priv->warp, dev );
+ drm_core_ioremapfree( dev_priv->warp, dev );
if ( dev_priv->primary != NULL )
- DRM_IOREMAPFREE( dev_priv->primary, dev );
+ drm_core_ioremapfree( dev_priv->primary, dev );
if ( dev->agp_buffer_map != NULL )
- DRM_IOREMAPFREE( dev->agp_buffer_map, dev );
+ drm_core_ioremapfree( dev->agp_buffer_map, dev );
if ( dev_priv->head != NULL ) {
mga_freelist_cleanup( dev );
diff --git a/shared-core/r128_cce.c b/shared-core/r128_cce.c
index 83612e571..43fa9b512 100644
--- a/shared-core/r128_cce.c
+++ b/shared-core/r128_cce.c
@@ -467,28 +467,28 @@ static int r128_do_init_cce( drm_device_t *dev, drm_r128_init_t *init )
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->mmio, init->mmio_offset );
+ dev_priv->mmio = drm_core_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 DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->cce_ring, init->ring_offset );
+ dev_priv->cce_ring = drm_core_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 DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->ring_rptr, init->ring_rptr_offset );
+ dev_priv->ring_rptr = drm_core_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;
r128_do_cleanup_cce( dev );
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev->agp_buffer_map, init->buffers_offset );
+ dev->agp_buffer_map = drm_core_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;
@@ -497,8 +497,7 @@ static int r128_do_init_cce( drm_device_t *dev, drm_r128_init_t *init )
}
if ( !dev_priv->is_pci ) {
- DRM_FIND_MAP( dev_priv->agp_textures,
- init->agp_textures_offset );
+ dev_priv->agp_textures = drm_core_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;
@@ -513,9 +512,9 @@ static int r128_do_init_cce( drm_device_t *dev, drm_r128_init_t *init )
#if __REALLY_HAVE_AGP
if ( !dev_priv->is_pci ) {
- DRM_IOREMAP( dev_priv->cce_ring, dev );
- DRM_IOREMAP( dev_priv->ring_rptr, dev );
- DRM_IOREMAP( dev->agp_buffer_map, dev );
+ drm_core_ioremap( dev_priv->cce_ring, dev );
+ drm_core_ioremap( dev_priv->ring_rptr, dev );
+ drm_core_ioremap( dev->agp_buffer_map, dev );
if(!dev_priv->cce_ring->handle ||
!dev_priv->ring_rptr->handle ||
!dev->agp_buffer_map->handle) {
@@ -601,11 +600,11 @@ int r128_do_cleanup_cce( drm_device_t *dev )
#if __REALLY_HAVE_AGP
if ( !dev_priv->is_pci ) {
if ( dev_priv->cce_ring != NULL )
- DRM_IOREMAPFREE( dev_priv->cce_ring, dev );
+ drm_core_ioremapfree( dev_priv->cce_ring, dev );
if ( dev_priv->ring_rptr != NULL )
- DRM_IOREMAPFREE( dev_priv->ring_rptr, dev );
+ drm_core_ioremapfree( dev_priv->ring_rptr, dev );
if ( dev->agp_buffer_map != NULL )
- DRM_IOREMAPFREE( dev->agp_buffer_map, dev );
+ drm_core_ioremapfree( dev->agp_buffer_map, dev );
} else
#endif
{
diff --git a/shared-core/radeon_cp.c b/shared-core/radeon_cp.c
index 1c172b282..fc859825a 100644
--- a/shared-core/radeon_cp.c
+++ b/shared-core/radeon_cp.c
@@ -1118,28 +1118,28 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init )
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->mmio, init->mmio_offset );
+ dev_priv->mmio = drm_core_findmap(dev, init->mmio_offset);
if(!dev_priv->mmio) {
DRM_ERROR("could not find mmio region!\n");
dev->dev_private = (void *)dev_priv;
radeon_do_cleanup_cp(dev);
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->cp_ring, init->ring_offset );
+ dev_priv->cp_ring = drm_core_findmap(dev, init->ring_offset);
if(!dev_priv->cp_ring) {
DRM_ERROR("could not find cp ring region!\n");
dev->dev_private = (void *)dev_priv;
radeon_do_cleanup_cp(dev);
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->ring_rptr, init->ring_rptr_offset );
+ dev_priv->ring_rptr = drm_core_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;
radeon_do_cleanup_cp(dev);
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev->agp_buffer_map, init->buffers_offset );
+ dev->agp_buffer_map = drm_core_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;
@@ -1148,7 +1148,7 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init )
}
if ( init->gart_textures_offset ) {
- DRM_FIND_MAP( dev_priv->gart_textures, init->gart_textures_offset );
+ dev_priv->gart_textures = drm_core_findmap(dev, init->gart_textures_offset);
if ( !dev_priv->gart_textures ) {
DRM_ERROR("could not find GART texture region!\n");
dev->dev_private = (void *)dev_priv;
@@ -1163,9 +1163,9 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init )
#if __REALLY_HAVE_AGP
if ( !dev_priv->is_pci ) {
- DRM_IOREMAP( dev_priv->cp_ring, dev );
- DRM_IOREMAP( dev_priv->ring_rptr, dev );
- DRM_IOREMAP( dev->agp_buffer_map, dev );
+ drm_core_ioremap( dev_priv->cp_ring, dev );
+ drm_core_ioremap( dev_priv->ring_rptr, dev );
+ drm_core_ioremap( dev->agp_buffer_map, dev );
if(!dev_priv->cp_ring->handle ||
!dev_priv->ring_rptr->handle ||
!dev->agp_buffer_map->handle) {
@@ -1289,11 +1289,11 @@ int radeon_do_cleanup_cp( drm_device_t *dev )
#if __REALLY_HAVE_AGP
if ( !dev_priv->is_pci ) {
if ( dev_priv->cp_ring != NULL )
- DRM_IOREMAPFREE( dev_priv->cp_ring, dev );
+ drm_core_ioremapfree( dev_priv->cp_ring, dev );
if ( dev_priv->ring_rptr != NULL )
- DRM_IOREMAPFREE( dev_priv->ring_rptr, dev );
+ drm_core_ioremapfree( dev_priv->ring_rptr, dev );
if ( dev->agp_buffer_map != NULL )
- DRM_IOREMAPFREE( dev->agp_buffer_map, dev );
+ drm_core_ioremapfree( dev->agp_buffer_map, dev );
} else
#endif
{
diff --git a/shared-core/via_map.c b/shared-core/via_map.c
index 532609274..afafadf16 100644
--- a/shared-core/via_map.c
+++ b/shared-core/via_map.c
@@ -47,14 +47,14 @@ int via_do_init_map(drm_device_t *dev, drm_via_init_t *init)
return -EINVAL;
}
- DRM_FIND_MAP(dev_priv->fb, init->fb_offset);
+ dev_priv->fb = drm_core_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;
}
- DRM_FIND_MAP(dev_priv->mmio, init->mmio_offset);
+ dev_priv->mmio = drm_core_findmap(dev, init->mmio_offset);
if (!dev_priv->mmio) {
DRM_ERROR("could not find mmio region!\n");
dev->dev_private = (void *)dev_priv;
diff --git a/shared/i915_dma.c b/shared/i915_dma.c
index ec3e19a16..72573cbb2 100644
--- a/shared/i915_dma.c
+++ b/shared/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;
diff --git a/shared/mach64_dma.c b/shared/mach64_dma.c
index bafbdc407..0acb784d0 100644
--- a/shared/mach64_dma.c
+++ b/shared/mach64_dma.c
@@ -655,14 +655,14 @@ static int mach64_do_dma_init( drm_device_t *dev, drm_mach64_init_t *init )
mach64_do_cleanup_dma(dev);
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->fb, init->fb_offset );
+ dev_priv->fb = drm_core_findmap(dev, init->fb_offset);
if (!dev_priv->fb) {
DRM_ERROR("can not find frame buffer map!\n");
dev->dev_private = (void *)dev_priv;
mach64_do_cleanup_dma(dev);
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->mmio, init->mmio_offset );
+ dev_priv->mmio = drm_core_findmap(dev, init->mmio_offset);
if (!dev_priv->mmio) {
DRM_ERROR("can not find mmio map!\n");
dev->dev_private = (void *)dev_priv;
@@ -675,14 +675,14 @@ static int mach64_do_dma_init( drm_device_t *dev, drm_mach64_init_t *init )
init->sarea_priv_offset);
if( !dev_priv->is_pci ) {
- DRM_FIND_MAP( dev_priv->ring_map, init->ring_offset );
+ dev_priv->ring_map = drm_core_findmap(dev, init->ring_offset);
if ( !dev_priv->ring_map ) {
DRM_ERROR( "can not find ring map!\n" );
dev->dev_private = (void *)dev_priv;
mach64_do_cleanup_dma(dev);
return DRM_ERR(EINVAL);
}
- DRM_IOREMAP( dev_priv->ring_map, dev );
+ drm_core_ioremap( dev_priv->ring_map, dev );
if ( !dev_priv->ring_map->handle ) {
DRM_ERROR( "can not ioremap virtual address for"
" descriptor ring\n" );
@@ -690,7 +690,7 @@ static int mach64_do_dma_init( drm_device_t *dev, drm_mach64_init_t *init )
mach64_do_cleanup_dma( dev );
return DRM_ERR(ENOMEM);
}
- DRM_FIND_MAP( dev->agp_buffer_map, init->buffers_offset );
+ dev->agp_buffer_map = drm_core_findmap(dev, init->buffers_offset);
if ( !dev->agp_buffer_map ) {
DRM_ERROR( "can not find dma buffer map!\n" );
dev->dev_private = (void *)dev_priv;
@@ -701,7 +701,7 @@ static int mach64_do_dma_init( drm_device_t *dev, drm_mach64_init_t *init )
dev isn't passed all the way though the mach64 - DA */
dev_priv->dev_buffers = dev->agp_buffer_map;
- DRM_IOREMAP( dev->agp_buffer_map, dev );
+ drm_core_ioremap( dev->agp_buffer_map, dev );
if ( !dev->agp_buffer_map->handle ) {
DRM_ERROR( "can not ioremap virtual address for"
" dma buffer\n" );
@@ -709,8 +709,7 @@ static int mach64_do_dma_init( drm_device_t *dev, drm_mach64_init_t *init )
mach64_do_cleanup_dma( dev );
return DRM_ERR(ENOMEM);
}
- DRM_FIND_MAP( dev_priv->agp_textures,
- init->agp_textures_offset );
+ dev_priv->agp_textures = drm_core_findmap(dev, init->agp_textures_offset);
if (!dev_priv->agp_textures) {
DRM_ERROR( "can not find agp texture region!\n" );
dev->dev_private = (void *)dev_priv;
@@ -991,11 +990,11 @@ int mach64_do_cleanup_dma( drm_device_t *dev )
}
} else {
if ( dev_priv->ring_map )
- DRM_IOREMAPFREE( dev_priv->ring_map, dev );
+ drm_core_ioremapfree( dev_priv->ring_map, dev );
}
if ( dev->agp_buffer_map )
- DRM_IOREMAPFREE( dev->agp_buffer_map, dev );
+ drm_core_ioremapfree( dev->agp_buffer_map, dev );
mach64_destroy_freelist( dev );
diff --git a/shared/mga_dma.c b/shared/mga_dma.c
index 7854a1d20..4a38b7d9d 100644
--- a/shared/mga_dma.c
+++ b/shared/mga_dma.c
@@ -500,7 +500,7 @@ static int mga_do_init_dma( drm_device_t *dev, drm_mga_init_t *init )
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->mmio, init->mmio_offset );
+ dev_priv->mmio = drm_core_findmap(dev, init->mmio_offset);
if(!dev_priv->mmio) {
DRM_ERROR( "failed to find mmio region!\n" );
/* Assign dev_private so we can do cleanup. */
@@ -508,7 +508,7 @@ static int mga_do_init_dma( drm_device_t *dev, drm_mga_init_t *init )
mga_do_cleanup_dma( dev );
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->status, init->status_offset );
+ dev_priv->status = drm_core_findmap(dev, init->status_offset);
if(!dev_priv->status) {
DRM_ERROR( "failed to find status page!\n" );
/* Assign dev_private so we can do cleanup. */
@@ -516,8 +516,7 @@ static int mga_do_init_dma( drm_device_t *dev, drm_mga_init_t *init )
mga_do_cleanup_dma( dev );
return DRM_ERR(EINVAL);
}
-
- DRM_FIND_MAP( dev_priv->warp, init->warp_offset );
+ dev_priv->warp = drm_core_findmap(dev, init->warp_offset);
if(!dev_priv->warp) {
DRM_ERROR( "failed to find warp microcode region!\n" );
/* Assign dev_private so we can do cleanup. */
@@ -525,7 +524,7 @@ static int mga_do_init_dma( drm_device_t *dev, drm_mga_init_t *init )
mga_do_cleanup_dma( dev );
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->primary, init->primary_offset );
+ dev_priv->primary = drm_core_findmap(dev, init->primary_offset);
if(!dev_priv->primary) {
DRM_ERROR( "failed to find primary dma region!\n" );
/* Assign dev_private so we can do cleanup. */
@@ -533,7 +532,7 @@ static int mga_do_init_dma( drm_device_t *dev, drm_mga_init_t *init )
mga_do_cleanup_dma( dev );
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev->agp_buffer_map, init->buffers_offset );
+ dev->agp_buffer_map = drm_core_findmap(dev, init->buffers_offset);
if(!dev->agp_buffer_map) {
DRM_ERROR( "failed to find dma buffer region!\n" );
/* Assign dev_private so we can do cleanup. */
@@ -546,9 +545,9 @@ static int mga_do_init_dma( drm_device_t *dev, drm_mga_init_t *init )
(drm_mga_sarea_t *)((u8 *)dev_priv->sarea->handle +
init->sarea_priv_offset);
- DRM_IOREMAP( dev_priv->warp, dev );
- DRM_IOREMAP( dev_priv->primary, dev );
- DRM_IOREMAP( dev->agp_buffer_map, dev );
+ drm_core_ioremap( dev_priv->warp, dev );
+ drm_core_ioremap( dev_priv->primary, dev );
+ drm_core_ioremap( dev->agp_buffer_map, dev );
if(!dev_priv->warp->handle ||
!dev_priv->primary->handle ||
@@ -643,11 +642,11 @@ int mga_do_cleanup_dma( drm_device_t *dev )
drm_mga_private_t *dev_priv = dev->dev_private;
if ( dev_priv->warp != NULL )
- DRM_IOREMAPFREE( dev_priv->warp, dev );
+ drm_core_ioremapfree( dev_priv->warp, dev );
if ( dev_priv->primary != NULL )
- DRM_IOREMAPFREE( dev_priv->primary, dev );
+ drm_core_ioremapfree( dev_priv->primary, dev );
if ( dev->agp_buffer_map != NULL )
- DRM_IOREMAPFREE( dev->agp_buffer_map, dev );
+ drm_core_ioremapfree( dev->agp_buffer_map, dev );
if ( dev_priv->head != NULL ) {
mga_freelist_cleanup( dev );
diff --git a/shared/r128_cce.c b/shared/r128_cce.c
index 83612e571..43fa9b512 100644
--- a/shared/r128_cce.c
+++ b/shared/r128_cce.c
@@ -467,28 +467,28 @@ static int r128_do_init_cce( drm_device_t *dev, drm_r128_init_t *init )
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->mmio, init->mmio_offset );
+ dev_priv->mmio = drm_core_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 DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->cce_ring, init->ring_offset );
+ dev_priv->cce_ring = drm_core_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 DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->ring_rptr, init->ring_rptr_offset );
+ dev_priv->ring_rptr = drm_core_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;
r128_do_cleanup_cce( dev );
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev->agp_buffer_map, init->buffers_offset );
+ dev->agp_buffer_map = drm_core_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;
@@ -497,8 +497,7 @@ static int r128_do_init_cce( drm_device_t *dev, drm_r128_init_t *init )
}
if ( !dev_priv->is_pci ) {
- DRM_FIND_MAP( dev_priv->agp_textures,
- init->agp_textures_offset );
+ dev_priv->agp_textures = drm_core_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;
@@ -513,9 +512,9 @@ static int r128_do_init_cce( drm_device_t *dev, drm_r128_init_t *init )
#if __REALLY_HAVE_AGP
if ( !dev_priv->is_pci ) {
- DRM_IOREMAP( dev_priv->cce_ring, dev );
- DRM_IOREMAP( dev_priv->ring_rptr, dev );
- DRM_IOREMAP( dev->agp_buffer_map, dev );
+ drm_core_ioremap( dev_priv->cce_ring, dev );
+ drm_core_ioremap( dev_priv->ring_rptr, dev );
+ drm_core_ioremap( dev->agp_buffer_map, dev );
if(!dev_priv->cce_ring->handle ||
!dev_priv->ring_rptr->handle ||
!dev->agp_buffer_map->handle) {
@@ -601,11 +600,11 @@ int r128_do_cleanup_cce( drm_device_t *dev )
#if __REALLY_HAVE_AGP
if ( !dev_priv->is_pci ) {
if ( dev_priv->cce_ring != NULL )
- DRM_IOREMAPFREE( dev_priv->cce_ring, dev );
+ drm_core_ioremapfree( dev_priv->cce_ring, dev );
if ( dev_priv->ring_rptr != NULL )
- DRM_IOREMAPFREE( dev_priv->ring_rptr, dev );
+ drm_core_ioremapfree( dev_priv->ring_rptr, dev );
if ( dev->agp_buffer_map != NULL )
- DRM_IOREMAPFREE( dev->agp_buffer_map, dev );
+ drm_core_ioremapfree( dev->agp_buffer_map, dev );
} else
#endif
{
diff --git a/shared/radeon_cp.c b/shared/radeon_cp.c
index 1c172b282..fc859825a 100644
--- a/shared/radeon_cp.c
+++ b/shared/radeon_cp.c
@@ -1118,28 +1118,28 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init )
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->mmio, init->mmio_offset );
+ dev_priv->mmio = drm_core_findmap(dev, init->mmio_offset);
if(!dev_priv->mmio) {
DRM_ERROR("could not find mmio region!\n");
dev->dev_private = (void *)dev_priv;
radeon_do_cleanup_cp(dev);
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->cp_ring, init->ring_offset );
+ dev_priv->cp_ring = drm_core_findmap(dev, init->ring_offset);
if(!dev_priv->cp_ring) {
DRM_ERROR("could not find cp ring region!\n");
dev->dev_private = (void *)dev_priv;
radeon_do_cleanup_cp(dev);
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev_priv->ring_rptr, init->ring_rptr_offset );
+ dev_priv->ring_rptr = drm_core_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;
radeon_do_cleanup_cp(dev);
return DRM_ERR(EINVAL);
}
- DRM_FIND_MAP( dev->agp_buffer_map, init->buffers_offset );
+ dev->agp_buffer_map = drm_core_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;
@@ -1148,7 +1148,7 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init )
}
if ( init->gart_textures_offset ) {
- DRM_FIND_MAP( dev_priv->gart_textures, init->gart_textures_offset );
+ dev_priv->gart_textures = drm_core_findmap(dev, init->gart_textures_offset);
if ( !dev_priv->gart_textures ) {
DRM_ERROR("could not find GART texture region!\n");
dev->dev_private = (void *)dev_priv;
@@ -1163,9 +1163,9 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init )
#if __REALLY_HAVE_AGP
if ( !dev_priv->is_pci ) {
- DRM_IOREMAP( dev_priv->cp_ring, dev );
- DRM_IOREMAP( dev_priv->ring_rptr, dev );
- DRM_IOREMAP( dev->agp_buffer_map, dev );
+ drm_core_ioremap( dev_priv->cp_ring, dev );
+ drm_core_ioremap( dev_priv->ring_rptr, dev );
+ drm_core_ioremap( dev->agp_buffer_map, dev );
if(!dev_priv->cp_ring->handle ||
!dev_priv->ring_rptr->handle ||
!dev->agp_buffer_map->handle) {
@@ -1289,11 +1289,11 @@ int radeon_do_cleanup_cp( drm_device_t *dev )
#if __REALLY_HAVE_AGP
if ( !dev_priv->is_pci ) {
if ( dev_priv->cp_ring != NULL )
- DRM_IOREMAPFREE( dev_priv->cp_ring, dev );
+ drm_core_ioremapfree( dev_priv->cp_ring, dev );
if ( dev_priv->ring_rptr != NULL )
- DRM_IOREMAPFREE( dev_priv->ring_rptr, dev );
+ drm_core_ioremapfree( dev_priv->ring_rptr, dev );
if ( dev->agp_buffer_map != NULL )
- DRM_IOREMAPFREE( dev->agp_buffer_map, dev );
+ drm_core_ioremapfree( dev->agp_buffer_map, dev );
} else
#endif
{
diff --git a/shared/via_map.c b/shared/via_map.c
index 532609274..afafadf16 100644
--- a/shared/via_map.c
+++ b/shared/via_map.c
@@ -47,14 +47,14 @@ int via_do_init_map(drm_device_t *dev, drm_via_init_t *init)
return -EINVAL;
}
- DRM_FIND_MAP(dev_priv->fb, init->fb_offset);
+ dev_priv->fb = drm_core_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;
}
- DRM_FIND_MAP(dev_priv->mmio, init->mmio_offset);
+ dev_priv->mmio = drm_core_findmap(dev, init->mmio_offset);
if (!dev_priv->mmio) {
DRM_ERROR("could not find mmio region!\n");
dev->dev_private = (void *)dev_priv;