]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - include/drm/drmP.h
drm/ttm: use drm calloc large and free large
[net-next-2.6.git] / include / drm / drmP.h
index 4a3c4e441027be39da3d37b8a817ff9f918661dd..de2f82efb15f9cfe384658f97571e25b6ad16d34 100644 (file)
@@ -1545,39 +1545,7 @@ static __inline__ void drm_core_dropmap(struct drm_local_map *map)
 {
 }
 
-
-static __inline__ void *drm_calloc_large(size_t nmemb, size_t size)
-{
-       if (size != 0 && nmemb > ULONG_MAX / size)
-               return NULL;
-
-       if (size * nmemb <= PAGE_SIZE)
-           return kcalloc(nmemb, size, GFP_KERNEL);
-
-       return __vmalloc(size * nmemb,
-                        GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, PAGE_KERNEL);
-}
-
-/* Modeled after cairo's malloc_ab, it's like calloc but without the zeroing. */
-static __inline__ void *drm_malloc_ab(size_t nmemb, size_t size)
-{
-       if (size != 0 && nmemb > ULONG_MAX / size)
-               return NULL;
-
-       if (size * nmemb <= PAGE_SIZE)
-           return kmalloc(nmemb * size, GFP_KERNEL);
-
-       return __vmalloc(size * nmemb,
-                        GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL);
-}
-
-static __inline void drm_free_large(void *ptr)
-{
-       if (!is_vmalloc_addr(ptr))
-               return kfree(ptr);
-
-       vfree(ptr);
-}
+#include "drm_mem_util.h"
 /*@}*/
 
 #endif                         /* __KERNEL__ */