aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/agp/backend.c
diff options
context:
space:
mode:
authorKeir Fraser <Keir.Fraser@cl.cam.ac.uk>2005-03-30 16:17:04 -0500
committerDave Jones <davej@redhat.com>2005-06-07 15:35:43 -0400
commit07eee78ea8ba2d0b7b20551c35a3e7dd158d50bb (patch)
treea11d2e705253faaa9779cfd83bb8ca9de311b195 /drivers/char/agp/backend.c
parente29b545cb153f230fbd8ff4c19bc98ab950f9f5c (diff)
[PATCH] AGP fix for Xen VMM
When Linux is running on the Xen virtual machine monitor, physical addresses are virtualised and cannot be directly referenced by the AGP GART. This patch fixes the GART driver for Xen by adding a layer of abstraction between physical addresses and 'GART addresses'. Architecture-specific functions are also defined for allocating and freeing the GATT. Xen requires this to ensure that table really is contiguous from the point of view of the GART. These extra interface functions are defined as 'no-ops' for all existing architectures that use the GART driver. Signed-off-by: Keir Fraser <keir@xensource.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/char/agp/backend.c')
-rw-r--r--drivers/char/agp/backend.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c
index 2f3dfb63bdc6..4d4e602fdc7e 100644
--- a/drivers/char/agp/backend.c
+++ b/drivers/char/agp/backend.c
@@ -148,7 +148,7 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
148 return -ENOMEM; 148 return -ENOMEM;
149 } 149 }
150 150
151 bridge->scratch_page_real = virt_to_phys(addr); 151 bridge->scratch_page_real = virt_to_gart(addr);
152 bridge->scratch_page = 152 bridge->scratch_page =
153 bridge->driver->mask_memory(bridge, bridge->scratch_page_real, 0); 153 bridge->driver->mask_memory(bridge, bridge->scratch_page_real, 0);
154 } 154 }
@@ -189,7 +189,7 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
189err_out: 189err_out:
190 if (bridge->driver->needs_scratch_page) 190 if (bridge->driver->needs_scratch_page)
191 bridge->driver->agp_destroy_page( 191 bridge->driver->agp_destroy_page(
192 phys_to_virt(bridge->scratch_page_real)); 192 gart_to_virt(bridge->scratch_page_real));
193 if (got_gatt) 193 if (got_gatt)
194 bridge->driver->free_gatt_table(bridge); 194 bridge->driver->free_gatt_table(bridge);
195 if (got_keylist) { 195 if (got_keylist) {
@@ -214,7 +214,7 @@ static void agp_backend_cleanup(struct agp_bridge_data *bridge)
214 if (bridge->driver->agp_destroy_page && 214 if (bridge->driver->agp_destroy_page &&
215 bridge->driver->needs_scratch_page) 215 bridge->driver->needs_scratch_page)
216 bridge->driver->agp_destroy_page( 216 bridge->driver->agp_destroy_page(
217 phys_to_virt(bridge->scratch_page_real)); 217 gart_to_virt(bridge->scratch_page_real));
218} 218}
219 219
220/* When we remove the global variable agp_bridge from all drivers 220/* When we remove the global variable agp_bridge from all drivers