aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/agp/sgi-agp.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-06-12 00:11:41 -0400
committerDave Airlie <airlied@redhat.com>2009-06-18 20:21:42 -0400
commit07613ba2f464f59949266f4337b75b91eb610795 (patch)
tree8e43a82571686492aba2269c2e7a49c323783af1 /drivers/char/agp/sgi-agp.c
parent2908826d045a89805714e0a3055a99dc40565d41 (diff)
agp: switch AGP to use page array instead of unsigned long array
This switches AGP to use an array of pages for tracking the pages allocated to the GART. This should enable GEM on PAE to work a lot better as we can pass highmem pages to the PAT code and it will do the right thing with them. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/char/agp/sgi-agp.c')
-rw-r--r--drivers/char/agp/sgi-agp.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/char/agp/sgi-agp.c b/drivers/char/agp/sgi-agp.c
index b972d83bb1b2..d3ea2e4226b5 100644
--- a/drivers/char/agp/sgi-agp.c
+++ b/drivers/char/agp/sgi-agp.c
@@ -38,7 +38,7 @@ static struct aper_size_info_fixed sgi_tioca_sizes[] = {
38 {0, 0, 0}, 38 {0, 0, 0},
39}; 39};
40 40
41static void *sgi_tioca_alloc_page(struct agp_bridge_data *bridge) 41static struct page *sgi_tioca_alloc_page(struct agp_bridge_data *bridge)
42{ 42{
43 struct page *page; 43 struct page *page;
44 int nid; 44 int nid;
@@ -52,7 +52,7 @@ static void *sgi_tioca_alloc_page(struct agp_bridge_data *bridge)
52 52
53 get_page(page); 53 get_page(page);
54 atomic_inc(&agp_bridge->current_memory_agp); 54 atomic_inc(&agp_bridge->current_memory_agp);
55 return page_address(page); 55 return page;
56} 56}
57 57
58/* 58/*
@@ -71,8 +71,9 @@ static void sgi_tioca_tlbflush(struct agp_memory *mem)
71 */ 71 */
72static unsigned long 72static unsigned long
73sgi_tioca_mask_memory(struct agp_bridge_data *bridge, 73sgi_tioca_mask_memory(struct agp_bridge_data *bridge,
74 unsigned long addr, int type) 74 struct page *page, int type)
75{ 75{
76 unsigned long addr = phys_to_gart(page_to_phys(page));
76 return tioca_physpage_to_gart(addr); 77 return tioca_physpage_to_gart(addr);
77} 78}
78 79
@@ -189,7 +190,7 @@ static int sgi_tioca_insert_memory(struct agp_memory *mem, off_t pg_start,
189 190
190 for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { 191 for (i = 0, j = pg_start; i < mem->page_count; i++, j++) {
191 table[j] = 192 table[j] =
192 bridge->driver->mask_memory(bridge, mem->memory[i], 193 bridge->driver->mask_memory(bridge, mem->pages[i],
193 mem->type); 194 mem->type);
194 } 195 }
195 196