diff options
author | Keir Fraser <Keir.Fraser@cl.cam.ac.uk> | 2005-03-30 16:17:04 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2005-06-07 15:35:43 -0400 |
commit | 07eee78ea8ba2d0b7b20551c35a3e7dd158d50bb (patch) | |
tree | a11d2e705253faaa9779cfd83bb8ca9de311b195 /drivers/char/agp/sworks-agp.c | |
parent | e29b545cb153f230fbd8ff4c19bc98ab950f9f5c (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/sworks-agp.c')
-rw-r--r-- | drivers/char/agp/sworks-agp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/char/agp/sworks-agp.c b/drivers/char/agp/sworks-agp.c index 10c23302dd8..a9fb12c20eb 100644 --- a/drivers/char/agp/sworks-agp.c +++ b/drivers/char/agp/sworks-agp.c | |||
@@ -51,7 +51,7 @@ static int serverworks_create_page_map(struct serverworks_page_map *page_map) | |||
51 | } | 51 | } |
52 | SetPageReserved(virt_to_page(page_map->real)); | 52 | SetPageReserved(virt_to_page(page_map->real)); |
53 | global_cache_flush(); | 53 | global_cache_flush(); |
54 | page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real), | 54 | page_map->remapped = ioremap_nocache(virt_to_gart(page_map->real), |
55 | PAGE_SIZE); | 55 | PAGE_SIZE); |
56 | if (page_map->remapped == NULL) { | 56 | if (page_map->remapped == NULL) { |
57 | ClearPageReserved(virt_to_page(page_map->real)); | 57 | ClearPageReserved(virt_to_page(page_map->real)); |
@@ -162,7 +162,7 @@ static int serverworks_create_gatt_table(struct agp_bridge_data *bridge) | |||
162 | /* Create a fake scratch directory */ | 162 | /* Create a fake scratch directory */ |
163 | for(i = 0; i < 1024; i++) { | 163 | for(i = 0; i < 1024; i++) { |
164 | writel(agp_bridge->scratch_page, serverworks_private.scratch_dir.remapped+i); | 164 | writel(agp_bridge->scratch_page, serverworks_private.scratch_dir.remapped+i); |
165 | writel(virt_to_phys(serverworks_private.scratch_dir.real) | 1, page_dir.remapped+i); | 165 | writel(virt_to_gart(serverworks_private.scratch_dir.real) | 1, page_dir.remapped+i); |
166 | } | 166 | } |
167 | 167 | ||
168 | retval = serverworks_create_gatt_pages(value->num_entries / 1024); | 168 | retval = serverworks_create_gatt_pages(value->num_entries / 1024); |
@@ -174,7 +174,7 @@ static int serverworks_create_gatt_table(struct agp_bridge_data *bridge) | |||
174 | 174 | ||
175 | agp_bridge->gatt_table_real = (u32 *)page_dir.real; | 175 | agp_bridge->gatt_table_real = (u32 *)page_dir.real; |
176 | agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped; | 176 | agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped; |
177 | agp_bridge->gatt_bus_addr = virt_to_phys(page_dir.real); | 177 | agp_bridge->gatt_bus_addr = virt_to_gart(page_dir.real); |
178 | 178 | ||
179 | /* Get the address for the gart region. | 179 | /* Get the address for the gart region. |
180 | * This is a bus address even on the alpha, b/c its | 180 | * This is a bus address even on the alpha, b/c its |
@@ -187,7 +187,7 @@ static int serverworks_create_gatt_table(struct agp_bridge_data *bridge) | |||
187 | /* Calculate the agp offset */ | 187 | /* Calculate the agp offset */ |
188 | 188 | ||
189 | for(i = 0; i < value->num_entries / 1024; i++) | 189 | for(i = 0; i < value->num_entries / 1024; i++) |
190 | writel(virt_to_phys(serverworks_private.gatt_pages[i]->real)|1, page_dir.remapped+i); | 190 | writel(virt_to_gart(serverworks_private.gatt_pages[i]->real)|1, page_dir.remapped+i); |
191 | 191 | ||
192 | return 0; | 192 | return 0; |
193 | } | 193 | } |