[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1291677875-30493-22-git-send-email-konrad.wilk@oracle.com>
Date: Mon, 6 Dec 2010 18:24:33 -0500
From: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
To: airlied@...ux.ie, tglx@...utronix.de, hpa@...or.com,
airlied@...hat.com, linux-kernel@...r.kernel.org, konrad@...nel.org
Cc: Jeremy Fitzhardinge <jeremy@...p.org>,
Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>,
Russ Anderson <rja@....com>
Subject: [PATCH 21/23] agp/sgi: Use PCI API for inserting/creating pages on SGI Altix.
The SGI Altix code sets its own GATT up, but rulies on
agp_generic_destroy_page[|s] functions, which use the PCI API.
Interestingly the sgi_tioca_alloc_page, which this patch removes,
had an optimization to allocate pages from a specific node. This optimization
also exists in the SGI sn/pci/pci_dma.c code when setting up a page
and since agp_generic_alloc_page uses that, we end up using it
in the generic allocation path.
The other change is that this patch is to utilize the dma_addr[]
field instead of doing page_to_phys(mem->pages[]) as that has
already been done in the PCI API.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
CC: Russ Anderson <rja@....com>
---
drivers/char/agp/sgi-agp.c | 22 ++--------------------
1 files changed, 2 insertions(+), 20 deletions(-)
diff --git a/drivers/char/agp/sgi-agp.c b/drivers/char/agp/sgi-agp.c
index 4436438..fcaf16a 100644
--- a/drivers/char/agp/sgi-agp.c
+++ b/drivers/char/agp/sgi-agp.c
@@ -39,24 +39,6 @@ static struct aper_size_info_fixed sgi_tioca_sizes[] = {
{0, 0, 0},
};
-static struct page *sgi_tioca_alloc_page(struct agp_bridge_data *bridge,
- dma_addr_t *dma_addr)
-{
- struct page *page;
- int nid;
- struct tioca_kernel *info =
- (struct tioca_kernel *)bridge->dev_private_data;
-
- nid = info->ca_closest_node;
- page = alloc_pages_node(nid, GFP_KERNEL, 0);
- if (!page)
- return NULL;
-
- get_page(page);
- atomic_inc(&agp_bridge->current_memory_agp);
- return page;
-}
-
/*
* Flush GART tlb's. Cannot selectively flush based on memory so the mem
* arg is ignored.
@@ -192,7 +174,7 @@ static int sgi_tioca_insert_memory(struct agp_memory *mem, off_t pg_start,
for (i = 0, j = pg_start; i < mem->page_count; i++, j++) {
table[j] =
bridge->driver->mask_memory(bridge,
- page_to_phys(mem->pages[i]),
+ mem->dma_addr[i],
mem->type);
}
@@ -264,7 +246,7 @@ const struct agp_bridge_driver sgi_tioca_driver = {
.remove_memory = sgi_tioca_remove_memory,
.alloc_by_type = agp_generic_alloc_by_type,
.free_by_type = agp_generic_free_by_type,
- .agp_alloc_page = sgi_tioca_alloc_page,
+ .agp_alloc_page = agp_generic_alloc_page,
.agp_destroy_page = agp_generic_destroy_page,
.agp_type_to_mask_type = agp_generic_type_to_mask_type,
.cant_use_aperture = true,
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists