aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/drmP.h
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-03-09 06:33:26 +0000
committerDave Airlie <airlied@redhat.com>2010-03-15 10:31:43 +1000
commit72e942dd846f98e2d35aad5436d77a878ef05c5e (patch)
treebed31b516da9fd80058800caa6161b6e0f880595 /include/drm/drmP.h
parentvga_switcheroo: disable default y by new rules. (diff)
downloadlinux-dev-72e942dd846f98e2d35aad5436d77a878ef05c5e.tar.xz
linux-dev-72e942dd846f98e2d35aad5436d77a878ef05c5e.zip
drm/ttm: use drm calloc large and free large
Now that the drm core can do this, lets just use it, split the code out so TTM doesn't have to drag all of drmP.h in. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/drm/drmP.h')
-rw-r--r--include/drm/drmP.h34
1 files changed, 1 insertions, 33 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 4a3c4e441027..de2f82efb15f 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -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__ */