mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-04-01 03:44:08 +00:00
Revert "ttm: Utilize the DMA API for pages that have TTM_PAGE_FLAG_DMA32 set."
This reverts commit 69a07f0b11
.
We've tracked a number of problems back to this, and Thomas
thinks we should redesign this for .40/41 anyways so I'm
happy to revert it.
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
cbf15bdbbd
commit
d87dfdbfc9
1 changed files with 3 additions and 23 deletions
|
@ -683,22 +683,14 @@ int ttm_get_pages(struct list_head *pages, int flags,
|
||||||
gfp_flags |= GFP_HIGHUSER;
|
gfp_flags |= GFP_HIGHUSER;
|
||||||
|
|
||||||
for (r = 0; r < count; ++r) {
|
for (r = 0; r < count; ++r) {
|
||||||
if ((flags & TTM_PAGE_FLAG_DMA32) && dma_address) {
|
p = alloc_page(gfp_flags);
|
||||||
void *addr;
|
|
||||||
addr = dma_alloc_coherent(NULL, PAGE_SIZE,
|
|
||||||
&dma_address[r],
|
|
||||||
gfp_flags);
|
|
||||||
if (addr == NULL)
|
|
||||||
return -ENOMEM;
|
|
||||||
p = virt_to_page(addr);
|
|
||||||
} else
|
|
||||||
p = alloc_page(gfp_flags);
|
|
||||||
if (!p) {
|
if (!p) {
|
||||||
|
|
||||||
printk(KERN_ERR TTM_PFX
|
printk(KERN_ERR TTM_PFX
|
||||||
"Unable to allocate page.");
|
"Unable to allocate page.");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
list_add(&p->lru, pages);
|
list_add(&p->lru, pages);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -746,24 +738,12 @@ void ttm_put_pages(struct list_head *pages, unsigned page_count, int flags,
|
||||||
unsigned long irq_flags;
|
unsigned long irq_flags;
|
||||||
struct ttm_page_pool *pool = ttm_get_pool(flags, cstate);
|
struct ttm_page_pool *pool = ttm_get_pool(flags, cstate);
|
||||||
struct page *p, *tmp;
|
struct page *p, *tmp;
|
||||||
unsigned r;
|
|
||||||
|
|
||||||
if (pool == NULL) {
|
if (pool == NULL) {
|
||||||
/* No pool for this memory type so free the pages */
|
/* No pool for this memory type so free the pages */
|
||||||
|
|
||||||
r = page_count-1;
|
|
||||||
list_for_each_entry_safe(p, tmp, pages, lru) {
|
list_for_each_entry_safe(p, tmp, pages, lru) {
|
||||||
if ((flags & TTM_PAGE_FLAG_DMA32) && dma_address) {
|
__free_page(p);
|
||||||
void *addr = page_address(p);
|
|
||||||
WARN_ON(!addr || !dma_address[r]);
|
|
||||||
if (addr)
|
|
||||||
dma_free_coherent(NULL, PAGE_SIZE,
|
|
||||||
addr,
|
|
||||||
dma_address[r]);
|
|
||||||
dma_address[r] = 0;
|
|
||||||
} else
|
|
||||||
__free_page(p);
|
|
||||||
r--;
|
|
||||||
}
|
}
|
||||||
/* Make the pages list empty */
|
/* Make the pages list empty */
|
||||||
INIT_LIST_HEAD(pages);
|
INIT_LIST_HEAD(pages);
|
||||||
|
|
Loading…
Add table
Reference in a new issue