diff options
Diffstat (limited to 'drivers/char/agp/backend.c')
-rw-r--r-- | drivers/char/agp/backend.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c index 3c3a487f7b9d..343f102090a0 100644 --- a/drivers/char/agp/backend.c +++ b/drivers/char/agp/backend.c | |||
@@ -149,9 +149,9 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge) | |||
149 | return -ENOMEM; | 149 | return -ENOMEM; |
150 | } | 150 | } |
151 | 151 | ||
152 | bridge->scratch_page_real = phys_to_gart(page_to_phys(page)); | 152 | bridge->scratch_page_page = page; |
153 | if (bridge->driver->agp_map_page) { | 153 | if (bridge->driver->agp_map_page) { |
154 | if (bridge->driver->agp_map_page(phys_to_virt(page_to_phys(page)), | 154 | if (bridge->driver->agp_map_page(page, |
155 | &bridge->scratch_page_dma)) { | 155 | &bridge->scratch_page_dma)) { |
156 | dev_err(&bridge->dev->dev, | 156 | dev_err(&bridge->dev->dev, |
157 | "unable to dma-map scratch page\n"); | 157 | "unable to dma-map scratch page\n"); |
@@ -205,13 +205,12 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge) | |||
205 | err_out: | 205 | err_out: |
206 | if (bridge->driver->needs_scratch_page && | 206 | if (bridge->driver->needs_scratch_page && |
207 | bridge->driver->agp_unmap_page) { | 207 | bridge->driver->agp_unmap_page) { |
208 | void *va = gart_to_virt(bridge->scratch_page_real); | 208 | bridge->driver->agp_unmap_page(bridge->scratch_page_page, |
209 | 209 | bridge->scratch_page_dma); | |
210 | bridge->driver->agp_unmap_page(va, bridge->scratch_page_dma); | ||
211 | } | 210 | } |
212 | err_out_nounmap: | 211 | err_out_nounmap: |
213 | if (bridge->driver->needs_scratch_page) { | 212 | if (bridge->driver->needs_scratch_page) { |
214 | void *va = gart_to_virt(bridge->scratch_page_real); | 213 | void *va = page_address(bridge->scratch_page_page); |
215 | 214 | ||
216 | bridge->driver->agp_destroy_page(va, AGP_PAGE_DESTROY_UNMAP); | 215 | bridge->driver->agp_destroy_page(va, AGP_PAGE_DESTROY_UNMAP); |
217 | bridge->driver->agp_destroy_page(va, AGP_PAGE_DESTROY_FREE); | 216 | bridge->driver->agp_destroy_page(va, AGP_PAGE_DESTROY_FREE); |
@@ -238,11 +237,11 @@ static void agp_backend_cleanup(struct agp_bridge_data *bridge) | |||
238 | 237 | ||
239 | if (bridge->driver->agp_destroy_page && | 238 | if (bridge->driver->agp_destroy_page && |
240 | bridge->driver->needs_scratch_page) { | 239 | bridge->driver->needs_scratch_page) { |
241 | void *va = gart_to_virt(bridge->scratch_page_real); | 240 | void *va = page_address(bridge->scratch_page_page); |
242 | 241 | ||
243 | if (bridge->driver->agp_unmap_page) | 242 | if (bridge->driver->agp_unmap_page) |
244 | bridge->driver->agp_unmap_page(va, | 243 | bridge->driver->agp_unmap_page(bridge->scratch_page_page, |
245 | bridge->scratch_page_dma); | 244 | bridge->scratch_page_dma); |
246 | 245 | ||
247 | bridge->driver->agp_destroy_page(va, AGP_PAGE_DESTROY_UNMAP); | 246 | bridge->driver->agp_destroy_page(va, AGP_PAGE_DESTROY_UNMAP); |
248 | bridge->driver->agp_destroy_page(va, AGP_PAGE_DESTROY_FREE); | 247 | bridge->driver->agp_destroy_page(va, AGP_PAGE_DESTROY_FREE); |