summaryrefslogtreecommitdiff
path: root/linux-core/drm_memory.c
diff options
context:
space:
mode:
authorStephane Marchesin <marchesin@icps.u-strasbg.fr>2007-01-08 03:50:34 +0100
committerStephane Marchesin <marchesin@icps.u-strasbg.fr>2007-01-08 03:50:34 +0100
commit6eaa1272b4159a547d6da21f14cbcc5b5d0f600c (patch)
tree04dd69ca7fed310a1e5719e738a3b893f782d3b2 /linux-core/drm_memory.c
parent1f0f7d7a180af088d6c79d55da04402f0eff0416 (diff)
parent5bf60c9d6c2e04a65085a0a332de24b06043fcb8 (diff)
Merge branch 'master' of git+ssh://marcheu@git.freedesktop.org/git/mesa/drm
Diffstat (limited to 'linux-core/drm_memory.c')
-rw-r--r--linux-core/drm_memory.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/linux-core/drm_memory.c b/linux-core/drm_memory.c
index 10f43f41..62f54b67 100644
--- a/linux-core/drm_memory.c
+++ b/linux-core/drm_memory.c
@@ -244,3 +244,26 @@ int drm_unbind_agp(DRM_AGP_MEM * handle)
}
#endif /* agp */
#endif /* debug_memory */
+
+void drm_core_ioremap(struct drm_map *map, struct drm_device *dev)
+{
+ if (drm_core_has_AGP(dev) &&
+ 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_GPL(drm_core_ioremap);
+
+void drm_core_ioremapfree(struct drm_map *map, struct drm_device *dev)
+{
+ if (!map->handle || !map->size)
+ return;
+
+ if (drm_core_has_AGP(dev) &&
+ dev->agp && dev->agp->cant_use_aperture && map->type == _DRM_AGP)
+ vunmap(map->handle);
+ else
+ iounmap(map->handle);
+}
+EXPORT_SYMBOL_GPL(drm_core_ioremapfree);