[PATCH 04/23] agp: Make agp_generic_[alloc|destroy]_pages use the _agp_[alloc|free]_page macro.

From: Konrad Rzeszutek Wilk
Date: Mon Dec 06 2010 - 18:29:25 EST


This way when we want to opt in a platform to use the PCI DMA it
is just the matter of changing the implementation in
arch/<platform>/include/asm/agp.h

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
---
drivers/char/agp/generic.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c
index bcefc66..cf465b5 100644
--- a/drivers/char/agp/generic.c
+++ b/drivers/char/agp/generic.c
@@ -1233,7 +1233,7 @@ int agp_generic_alloc_pages(struct agp_bridge_data *bridge, struct agp_memory *m
int i, ret = -ENOMEM;

for (i = 0; i < num_pages; i++) {
- page = alloc_page(GFP_KERNEL | GFP_DMA32 | __GFP_ZERO);
+ page = _agp_alloc_page(agp_bridge, &mem->dma_addr[i]);
/* agp_free_memory() needs gart address */
if (page == NULL)
goto out;
@@ -1292,7 +1292,7 @@ void agp_generic_destroy_pages(struct agp_memory *mem)
unmap_page_from_agp(page);
#endif
put_page(page);
- __free_page(page);
+ _agp_free_page(agp_bridge, page, &mem->dma_addr[i]);
atomic_dec(&agp_bridge->current_memory_agp);
mem->pages[i] = NULL;
}
--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/