summaryrefslogtreecommitdiff
path: root/linux-core/drm_ttm.c
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2008-12-10 15:47:28 -0800
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-12-10 15:50:22 -0800
commit9583c099b4a08b49e03f7b461c344b6d277fd262 (patch)
treee3c17d4b9ee2c2a063c3e30e0a650fc0c9b6cfa7 /linux-core/drm_ttm.c
parentc34539e8bb5568b1d6059abf139dd08e07e84eea (diff)
Revert "Merge branch 'modesetting-gem'"
This reverts commit 6656db10551bbb8770dd945b6d81d5138521f208. We really just want the libdrm and ioctl bits, not all the driver stuff.
Diffstat (limited to 'linux-core/drm_ttm.c')
-rw-r--r--linux-core/drm_ttm.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/linux-core/drm_ttm.c b/linux-core/drm_ttm.c
index 4067b9e1..054a7ce8 100644
--- a/linux-core/drm_ttm.c
+++ b/linux-core/drm_ttm.c
@@ -120,18 +120,14 @@ static void drm_ttm_free_page_directory(struct drm_ttm *ttm)
ttm->pages = NULL;
}
-static struct page *drm_ttm_alloc_page(struct drm_ttm *ttm)
+static struct page *drm_ttm_alloc_page(void)
{
struct page *page;
if (drm_alloc_memctl(PAGE_SIZE))
return NULL;
- if (ttm->dev->bm.allocator_type == _DRM_BM_ALLOCATOR_UNCACHED)
- page = drm_get_uncached_page();
- else
- page = alloc_page(GFP_KERNEL | __GFP_ZERO | GFP_DMA32);
-
+ page = alloc_page(GFP_KERNEL | __GFP_ZERO | GFP_DMA32);
if (!page) {
drm_free_memctl(PAGE_SIZE);
return NULL;
@@ -153,9 +149,6 @@ static int drm_ttm_set_caching(struct drm_ttm *ttm, int noncached)
struct page **cur_page;
int do_tlbflush = 0;
- if (ttm->dev->bm.allocator_type == _DRM_BM_ALLOCATOR_UNCACHED)
- return 0;
-
if ((ttm->page_flags & DRM_TTM_PAGE_UNCACHED) == noncached)
return 0;
@@ -222,18 +215,14 @@ static void drm_ttm_free_alloced_pages(struct drm_ttm *ttm)
for (i = 0; i < ttm->num_pages; ++i) {
cur_page = ttm->pages + i;
if (*cur_page) {
- if (ttm->dev->bm.allocator_type == _DRM_BM_ALLOCATOR_UNCACHED)
- drm_put_uncached_page(*cur_page);
- else {
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,15))
- ClearPageReserved(*cur_page);
+ ClearPageReserved(*cur_page);
#endif
- if (page_count(*cur_page) != 1)
- DRM_ERROR("Erroneous page count. Leaking pages.\n");
- if (page_mapped(*cur_page))
- DRM_ERROR("Erroneous map count. Leaking page mappings.\n");
- __free_page(*cur_page);
- }
+ if (page_count(*cur_page) != 1)
+ DRM_ERROR("Erroneous page count. Leaking pages.\n");
+ if (page_mapped(*cur_page))
+ DRM_ERROR("Erroneous map count. Leaking page mappings.\n");
+ __free_page(*cur_page);
drm_free_memctl(PAGE_SIZE);
--bm->cur_pages;
}
@@ -279,7 +268,7 @@ struct page *drm_ttm_get_page(struct drm_ttm *ttm, int index)
struct drm_buffer_manager *bm = &ttm->dev->bm;
while(NULL == (p = ttm->pages[index])) {
- p = drm_ttm_alloc_page(ttm);
+ p = drm_ttm_alloc_page();
if (!p)
return NULL;