aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ttm
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2011-04-12 19:15:09 -0400
committerDave Airlie <airlied@redhat.com>2011-04-12 19:15:09 -0400
commitd87dfdbfc91c5e37288e7e8f7afdd992ba61a60d (patch)
tree7d848ddbbcff452d1096f4e6a65d808b8f6823e3 /drivers/gpu/drm/ttm
parentcbf15bdbbdaec3b2e3b4f476803a6149707d1a1f (diff)
Revert "ttm: Utilize the DMA API for pages that have TTM_PAGE_FLAG_DMA32 set."
This reverts commit 69a07f0b117a40fcc1a479358d8e1f41793617f2. 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>
Diffstat (limited to 'drivers/gpu/drm/ttm')
-rw-r--r--drivers/gpu/drm/ttm/ttm_page_alloc.c26
1 files changed, 3 insertions, 23 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c
index 737a2a2e46a5..9d9d92945f8c 100644
--- a/drivers/gpu/drm/ttm/ttm_page_alloc.c
+++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c
@@ -683,22 +683,14 @@ int ttm_get_pages(struct list_head *pages, int flags,
683 gfp_flags |= GFP_HIGHUSER; 683 gfp_flags |= GFP_HIGHUSER;
684 684
685 for (r = 0; r < count; ++r) { 685 for (r = 0; r < count; ++r) {
686 if ((flags & TTM_PAGE_FLAG_DMA32) && dma_address) { 686 p = alloc_page(gfp_flags);
687 void *addr;
688 addr = dma_alloc_coherent(NULL, PAGE_SIZE,
689 &dma_address[r],
690 gfp_flags);
691 if (addr == NULL)
692 return -ENOMEM;
693 p = virt_to_page(addr);
694 } else
695 p = alloc_page(gfp_flags);
696 if (!p) { 687 if (!p) {
697 688
698 printk(KERN_ERR TTM_PFX 689 printk(KERN_ERR TTM_PFX
699 "Unable to allocate page."); 690 "Unable to allocate page.");
700 return -ENOMEM; 691 return -ENOMEM;
701 } 692 }
693
702 list_add(&p->lru, pages); 694 list_add(&p->lru, pages);
703 } 695 }
704 return 0; 696 return 0;
@@ -746,24 +738,12 @@ void ttm_put_pages(struct list_head *pages, unsigned page_count, int flags,
746 unsigned long irq_flags; 738 unsigned long irq_flags;
747 struct ttm_page_pool *pool = ttm_get_pool(flags, cstate); 739 struct ttm_page_pool *pool = ttm_get_pool(flags, cstate);
748 struct page *p, *tmp; 740 struct page *p, *tmp;
749 unsigned r;
750 741
751 if (pool == NULL) { 742 if (pool == NULL) {
752 /* No pool for this memory type so free the pages */ 743 /* No pool for this memory type so free the pages */
753 744
754 r = page_count-1;
755 list_for_each_entry_safe(p, tmp, pages, lru) { 745 list_for_each_entry_safe(p, tmp, pages, lru) {
756 if ((flags & TTM_PAGE_FLAG_DMA32) && dma_address) { 746 __free_page(p);
757 void *addr = page_address(p);
758 WARN_ON(!addr || !dma_address[r]);
759 if (addr)
760 dma_free_coherent(NULL, PAGE_SIZE,
761 addr,
762 dma_address[r]);
763 dma_address[r] = 0;
764 } else
765 __free_page(p);
766 r--;
767 } 747 }
768 /* Make the pages list empty */ 748 /* Make the pages list empty */
769 INIT_LIST_HEAD(pages); 749 INIT_LIST_HEAD(pages);