diff options
author | David S. Miller <davem@davemloft.net> | 2010-04-11 13:44:30 +0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-11 13:44:30 +0400 |
commit | 4a1032faac94ebbf647460ae3e06fc21146eb280 (patch) | |
tree | 7f31b97beb0406faa1523e619289ad0ab07c9787 /include/drm/drmP.h | |
parent | ae4e8d63b5619d4d95f1d2bfa2b836caa6e62d06 (diff) | |
parent | 0eddb519b9127c73d53db4bf3ec1d45b13f844d1 (diff) | |
download | linux-4a1032faac94ebbf647460ae3e06fc21146eb280.tar.xz |
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Diffstat (limited to 'include/drm/drmP.h')
-rw-r--r-- | include/drm/drmP.h | 35 |
1 files changed, 2 insertions, 33 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 4a3c4e441027..2f3b3a00b7a3 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -55,6 +55,7 @@ #include <linux/mm.h> #include <linux/cdev.h> #include <linux/mutex.h> +#include <linux/slab.h> #if defined(__alpha__) || defined(__powerpc__) #include <asm/pgtable.h> /* For pte_wrprotect */ #endif @@ -1545,39 +1546,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__ */ |