From 737c73d1a081823f5c95a6fd68173b56a304eae5 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 19 Dec 2006 22:10:34 +1100 Subject: add kcalloc compat for before 2.6.10 --- linux-core/drm_memory.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'linux-core/drm_memory.c') diff --git a/linux-core/drm_memory.c b/linux-core/drm_memory.c index 3370c279..10f43f41 100644 --- a/linux-core/drm_memory.c +++ b/linux-core/drm_memory.c @@ -134,13 +134,7 @@ int drm_mem_info(char *buf, char **start, off_t offset, /** Wrapper around kmalloc() */ void *drm_calloc(size_t nmemb, size_t size, int area) { - void *addr; - - addr = kmalloc(size * nmemb, GFP_KERNEL); - if (addr != NULL) - memset((void *)addr, 0, size * nmemb); - - return addr; + return kcalloc(nmemb, size, GFP_KERNEL); } EXPORT_SYMBOL(drm_calloc); -- cgit v1.2.3 From b147c3926352e4dcb9dbf53b8b12baae8ce34254 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Mon, 8 Jan 2007 10:55:49 +1100 Subject: drm: remove drm_follow_page, and drm_ioremap and ioremapfree This comes from the Re: [patch] paravirt: isolate module ops on lkml It needs some testing, please report any regressions caused. Signed-off-by: Dave Airlie --- linux-core/drm_memory.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'linux-core/drm_memory.c') 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); -- cgit v1.2.3