X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=include%2Fdrm%2FdrmP.h;h=2f3b3a00b7a39ccf97ff839f0eb9034a1873a6af;hb=aa86f26bd81a46985f1b32e513638d1c36cf3104;hp=4a3c4e441027be39da3d37b8a817ff9f918661dd;hpb=7de4a9a73563e5f6f3c153015fadee433a443241;p=mv-sheeva.git diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 4a3c4e44102..2f3b3a00b7a 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -55,6 +55,7 @@ #include #include #include +#include #if defined(__alpha__) || defined(__powerpc__) #include /* 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__ */