diff options
Diffstat (limited to 'drivers/char/agp/backend.c')
-rw-r--r-- | drivers/char/agp/backend.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c index 73f333f491bd..27bca34b4a65 100644 --- a/drivers/char/agp/backend.c +++ b/drivers/char/agp/backend.c | |||
@@ -147,6 +147,7 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge) | |||
147 | printk(KERN_ERR PFX "unable to get memory for scratch page.\n"); | 147 | printk(KERN_ERR PFX "unable to get memory for scratch page.\n"); |
148 | return -ENOMEM; | 148 | return -ENOMEM; |
149 | } | 149 | } |
150 | flush_agp_mappings(); | ||
150 | 151 | ||
151 | bridge->scratch_page_real = virt_to_gart(addr); | 152 | bridge->scratch_page_real = virt_to_gart(addr); |
152 | bridge->scratch_page = | 153 | bridge->scratch_page = |
@@ -187,9 +188,11 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge) | |||
187 | return 0; | 188 | return 0; |
188 | 189 | ||
189 | err_out: | 190 | err_out: |
190 | if (bridge->driver->needs_scratch_page) | 191 | if (bridge->driver->needs_scratch_page) { |
191 | bridge->driver->agp_destroy_page( | 192 | bridge->driver->agp_destroy_page( |
192 | gart_to_virt(bridge->scratch_page_real)); | 193 | gart_to_virt(bridge->scratch_page_real)); |
194 | flush_agp_mappings(); | ||
195 | } | ||
193 | if (got_gatt) | 196 | if (got_gatt) |
194 | bridge->driver->free_gatt_table(bridge); | 197 | bridge->driver->free_gatt_table(bridge); |
195 | if (got_keylist) { | 198 | if (got_keylist) { |
@@ -211,9 +214,11 @@ static void agp_backend_cleanup(struct agp_bridge_data *bridge) | |||
211 | bridge->key_list = NULL; | 214 | bridge->key_list = NULL; |
212 | 215 | ||
213 | if (bridge->driver->agp_destroy_page && | 216 | if (bridge->driver->agp_destroy_page && |
214 | bridge->driver->needs_scratch_page) | 217 | bridge->driver->needs_scratch_page) { |
215 | bridge->driver->agp_destroy_page( | 218 | bridge->driver->agp_destroy_page( |
216 | gart_to_virt(bridge->scratch_page_real)); | 219 | gart_to_virt(bridge->scratch_page_real)); |
220 | flush_agp_mappings(); | ||
221 | } | ||
217 | } | 222 | } |
218 | 223 | ||
219 | /* When we remove the global variable agp_bridge from all drivers | 224 | /* When we remove the global variable agp_bridge from all drivers |