提交 da931a93 编写于 作者: D Dave Airlie

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: NDave Airlie <airlied@redhat.com>
上级 f5c5f040
...@@ -97,20 +97,18 @@ EXPORT_SYMBOL(agp_flush_chipset); ...@@ -97,20 +97,18 @@ EXPORT_SYMBOL(agp_flush_chipset);
void agp_alloc_page_array(size_t size, struct agp_memory *mem) void agp_alloc_page_array(size_t size, struct agp_memory *mem)
{ {
mem->pages = NULL; mem->pages = NULL;
mem->vmalloc_flag = false;
if (size <= 2*PAGE_SIZE) if (size <= 2*PAGE_SIZE)
mem->pages = kmalloc(size, GFP_KERNEL | __GFP_NORETRY); mem->pages = kmalloc(size, GFP_KERNEL | __GFP_NORETRY);
if (mem->pages == NULL) { if (mem->pages == NULL) {
mem->pages = vmalloc(size); mem->pages = vmalloc(size);
mem->vmalloc_flag = true;
} }
} }
EXPORT_SYMBOL(agp_alloc_page_array); EXPORT_SYMBOL(agp_alloc_page_array);
void agp_free_page_array(struct agp_memory *mem) void agp_free_page_array(struct agp_memory *mem)
{ {
if (mem->vmalloc_flag) { if (is_vmalloc_addr(mem->pages)) {
vfree(mem->pages); vfree(mem->pages);
} else { } else {
kfree(mem->pages); kfree(mem->pages);
......
...@@ -79,7 +79,6 @@ struct agp_memory { ...@@ -79,7 +79,6 @@ struct agp_memory {
u32 physical; u32 physical;
bool is_bound; bool is_bound;
bool is_flushed; bool is_flushed;
bool vmalloc_flag;
/* list of agp_memory mapped to the aperture */ /* list of agp_memory mapped to the aperture */
struct list_head mapped_list; struct list_head mapped_list;
/* DMA-mapped addresses */ /* DMA-mapped addresses */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册