diff options
Diffstat (limited to 'drivers/char/agp/ali-agp.c')
-rw-r--r-- | drivers/char/agp/ali-agp.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/drivers/char/agp/ali-agp.c b/drivers/char/agp/ali-agp.c index 4941ddb78939..aa5ddb716ffb 100644 --- a/drivers/char/agp/ali-agp.c +++ b/drivers/char/agp/ali-agp.c | |||
@@ -156,29 +156,34 @@ static void *m1541_alloc_page(struct agp_bridge_data *bridge) | |||
156 | return addr; | 156 | return addr; |
157 | } | 157 | } |
158 | 158 | ||
159 | static void ali_destroy_page(void * addr) | 159 | static void ali_destroy_page(void * addr, int flags) |
160 | { | 160 | { |
161 | if (addr) { | 161 | if (addr) { |
162 | global_cache_flush(); /* is this really needed? --hch */ | 162 | if (flags & AGP_PAGE_DESTROY_UNMAP) { |
163 | agp_generic_destroy_page(addr); | 163 | global_cache_flush(); /* is this really needed? --hch */ |
164 | global_flush_tlb(); | 164 | agp_generic_destroy_page(addr, flags); |
165 | global_flush_tlb(); | ||
166 | } else | ||
167 | agp_generic_destroy_page(addr, flags); | ||
165 | } | 168 | } |
166 | } | 169 | } |
167 | 170 | ||
168 | static void m1541_destroy_page(void * addr) | 171 | static void m1541_destroy_page(void * addr, int flags) |
169 | { | 172 | { |
170 | u32 temp; | 173 | u32 temp; |
171 | 174 | ||
172 | if (addr == NULL) | 175 | if (addr == NULL) |
173 | return; | 176 | return; |
174 | 177 | ||
175 | global_cache_flush(); | 178 | if (flags & AGP_PAGE_DESTROY_UNMAP) { |
179 | global_cache_flush(); | ||
176 | 180 | ||
177 | pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp); | 181 | pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp); |
178 | pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, | 182 | pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, |
179 | (((temp & ALI_CACHE_FLUSH_ADDR_MASK) | | 183 | (((temp & ALI_CACHE_FLUSH_ADDR_MASK) | |
180 | virt_to_gart(addr)) | ALI_CACHE_FLUSH_EN)); | 184 | virt_to_gart(addr)) | ALI_CACHE_FLUSH_EN)); |
181 | agp_generic_destroy_page(addr); | 185 | } |
186 | agp_generic_destroy_page(addr, flags); | ||
182 | } | 187 | } |
183 | 188 | ||
184 | 189 | ||