aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/agp/ali-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/ali-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/ali-agp.c')
-rw-r--r--drivers/char/agp/ali-agp.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/char/agp/ali-agp.c b/drivers/char/agp/ali-agp.c
index 58f26ed2a96b..201ef3ffd484 100644
--- a/drivers/char/agp/ali-agp.c
+++ b/drivers/char/agp/ali-agp.c
@@ -141,37 +141,37 @@ static void m1541_cache_flush(void)
141 } 141 }
142} 142}
143 143
144static void *m1541_alloc_page(struct agp_bridge_data *bridge) 144static struct page *m1541_alloc_page(struct agp_bridge_data *bridge)
145{ 145{
146 void *addr = agp_generic_alloc_page(agp_bridge); 146 struct page *page = agp_generic_alloc_page(agp_bridge);
147 u32 temp; 147 u32 temp;
148 148
149 if (!addr) 149 if (!page)
150 return NULL; 150 return NULL;
151 151
152 pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp); 152 pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp);
153 pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, 153 pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL,
154 (((temp & ALI_CACHE_FLUSH_ADDR_MASK) | 154 (((temp & ALI_CACHE_FLUSH_ADDR_MASK) |
155 virt_to_gart(addr)) | ALI_CACHE_FLUSH_EN )); 155 phys_to_gart(page_to_phys(page))) | ALI_CACHE_FLUSH_EN ));
156 return addr; 156 return page;
157} 157}
158 158
159static void ali_destroy_page(void * addr, int flags) 159static void ali_destroy_page(struct page *page, int flags)
160{ 160{
161 if (addr) { 161 if (page) {
162 if (flags & AGP_PAGE_DESTROY_UNMAP) { 162 if (flags & AGP_PAGE_DESTROY_UNMAP) {
163 global_cache_flush(); /* is this really needed? --hch */ 163 global_cache_flush(); /* is this really needed? --hch */
164 agp_generic_destroy_page(addr, flags); 164 agp_generic_destroy_page(page, flags);
165 } else 165 } else
166 agp_generic_destroy_page(addr, flags); 166 agp_generic_destroy_page(page, flags);
167 } 167 }
168} 168}
169 169
170static void m1541_destroy_page(void * addr, int flags) 170static void m1541_destroy_page(struct page *page, int flags)
171{ 171{
172 u32 temp; 172 u32 temp;
173 173
174 if (addr == NULL) 174 if (page == NULL)
175 return; 175 return;
176 176
177 if (flags & AGP_PAGE_DESTROY_UNMAP) { 177 if (flags & AGP_PAGE_DESTROY_UNMAP) {
@@ -180,9 +180,9 @@ static void m1541_destroy_page(void * addr, int flags)
180 pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp); 180 pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp);
181 pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, 181 pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL,
182 (((temp & ALI_CACHE_FLUSH_ADDR_MASK) | 182 (((temp & ALI_CACHE_FLUSH_ADDR_MASK) |
183 virt_to_gart(addr)) | ALI_CACHE_FLUSH_EN)); 183 phys_to_gart(page_to_phys(page))) | ALI_CACHE_FLUSH_EN));
184 } 184 }
185 agp_generic_destroy_page(addr, flags); 185 agp_generic_destroy_page(page, flags);
186} 186}
187 187
188 188