summaryrefslogtreecommitdiff
path: root/linux-core/drm_ttm.c
diff options
context:
space:
mode:
authorJerome Glisse <glisse@freedesktop.org>2008-03-10 23:36:27 +0100
committerJohn Doe <glisse@freedesktop.org>2008-03-10 23:36:27 +0100
commita7e6ca62ad0d9c3c45fd9e1d81b59c2db2d714cf (patch)
tree8f757eeaa2c234af14ca1df515de7810e770ed91 /linux-core/drm_ttm.c
parenta7dc4d08b9b4f8fe6fcaa4c778f6dd3718d1e36a (diff)
parent9f19e79f955281b9de393219e4ad9835ffe29c49 (diff)
Merge branch 'modesetting-101' of ssh://git.freedesktop.org/git/mesa/drm into modesetting-101
Diffstat (limited to 'linux-core/drm_ttm.c')
-rw-r--r--linux-core/drm_ttm.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/linux-core/drm_ttm.c b/linux-core/drm_ttm.c
index a9d87338..cc80b132 100644
--- a/linux-core/drm_ttm.c
+++ b/linux-core/drm_ttm.c
@@ -42,11 +42,12 @@ void drm_ttm_cache_flush(void)
}
EXPORT_SYMBOL(drm_ttm_cache_flush);
-/*
- * Use kmalloc if possible. Otherwise fall back to vmalloc.
+/**
+ * Allocates storage for pointers to the pages that back the ttm.
+ *
+ * Uses kmalloc if possible. Otherwise falls back to vmalloc.
*/
-
-static void drm_ttm_alloc_pages(struct drm_ttm *ttm)
+static void drm_ttm_alloc_page_directory(struct drm_ttm *ttm)
{
unsigned long size = ttm->num_pages * sizeof(*ttm->pages);
ttm->pages = NULL;
@@ -60,19 +61,19 @@ static void drm_ttm_alloc_pages(struct drm_ttm *ttm)
if (!ttm->pages) {
ttm->pages = vmalloc_user(size);
if (ttm->pages)
- ttm->page_flags |= DRM_TTM_PAGE_VMALLOC;
+ ttm->page_flags |= DRM_TTM_PAGEDIR_VMALLOC;
}
if (!ttm->pages)
drm_free_memctl(size);
}
-static void drm_ttm_free_pages(struct drm_ttm *ttm)
+static void drm_ttm_free_page_directory(struct drm_ttm *ttm)
{
unsigned long size = ttm->num_pages * sizeof(*ttm->pages);
- if (ttm->page_flags & DRM_TTM_PAGE_VMALLOC) {
+ if (ttm->page_flags & DRM_TTM_PAGEDIR_VMALLOC) {
vfree(ttm->pages);
- ttm->page_flags &= ~DRM_TTM_PAGE_VMALLOC;
+ ttm->page_flags &= ~DRM_TTM_PAGEDIR_VMALLOC;
} else {
drm_free(ttm->pages, size, DRM_MEM_TTM);
}
@@ -215,7 +216,7 @@ int drm_ttm_destroy(struct drm_ttm *ttm)
else
drm_ttm_free_alloced_pages(ttm);
- drm_ttm_free_pages(ttm);
+ drm_ttm_free_page_directory(ttm);
}
drm_ctl_free(ttm, sizeof(*ttm), DRM_MEM_TTM);
@@ -349,7 +350,7 @@ struct drm_ttm *drm_ttm_create(struct drm_device *dev, unsigned long size,
* Account also for AGP module memory usage.
*/
- drm_ttm_alloc_pages(ttm);
+ drm_ttm_alloc_page_directory(ttm);
if (!ttm->pages) {
drm_ttm_destroy(ttm);
DRM_ERROR("Failed allocating page table\n");