aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2010-06-14 19:52:37 -0400
committerDave Airlie <airlied@redhat.com>2010-06-14 19:56:01 -0400
commitda931a931da85218add949266238c54b5fecd37f (patch)
tree63f4e081715b00b403bf45d705a636a29d80a7e9
parentf5c5f040b565435e9a85898dc87ab365395e0603 (diff)
agp: drop vmalloc flag.
Since the code that was too ugly to live is upstream, we can use it now, instead of rolling our own. Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/char/agp/generic.c4
-rw-r--r--include/linux/agp_backend.h1
2 files changed, 1 insertions, 4 deletions
diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
index 4b51982fd23a..4e414417730b 100644
--- a/drivers/char/agp/generic.c
+++ b/drivers/char/agp/generic.c
@@ -97,20 +97,18 @@ EXPORT_SYMBOL(agp_flush_chipset);
97void agp_alloc_page_array(size_t size, struct agp_memory *mem) 97void agp_alloc_page_array(size_t size, struct agp_memory *mem)
98{ 98{
99 mem->pages = NULL; 99 mem->pages = NULL;
100 mem->vmalloc_flag = false;
101 100
102 if (size <= 2*PAGE_SIZE) 101 if (size <= 2*PAGE_SIZE)
103 mem->pages = kmalloc(size, GFP_KERNEL | __GFP_NORETRY); 102 mem->pages = kmalloc(size, GFP_KERNEL | __GFP_NORETRY);
104 if (mem->pages == NULL) { 103 if (mem->pages == NULL) {
105 mem->pages = vmalloc(size); 104 mem->pages = vmalloc(size);
106 mem->vmalloc_flag = true;
107 } 105 }
108} 106}
109EXPORT_SYMBOL(agp_alloc_page_array); 107EXPORT_SYMBOL(agp_alloc_page_array);
110 108
111void agp_free_page_array(struct agp_memory *mem) 109void agp_free_page_array(struct agp_memory *mem)
112{ 110{
113 if (mem->vmalloc_flag) { 111 if (is_vmalloc_addr(mem->pages)) {
114 vfree(mem->pages); 112 vfree(mem->pages);
115 } else { 113 } else {
116 kfree(mem->pages); 114 kfree(mem->pages);
diff --git a/include/linux/agp_backend.h b/include/linux/agp_backend.h
index 9101ed64f803..09ea4a1e9505 100644
--- a/include/linux/agp_backend.h
+++ b/include/linux/agp_backend.h
@@ -79,7 +79,6 @@ struct agp_memory {
79 u32 physical; 79 u32 physical;
80 bool is_bound; 80 bool is_bound;
81 bool is_flushed; 81 bool is_flushed;
82 bool vmalloc_flag;
83 /* list of agp_memory mapped to the aperture */ 82 /* list of agp_memory mapped to the aperture */
84 struct list_head mapped_list; 83 struct list_head mapped_list;
85 /* DMA-mapped addresses */ 84 /* DMA-mapped addresses */