aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/agp/intel-agp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/agp/intel-agp.c')
-rw-r--r--drivers/char/agp/intel-agp.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index 8c9d50db5c3a..21983456d672 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -343,7 +343,7 @@ static int intel_i810_insert_entries(struct agp_memory *mem, off_t pg_start,
343 global_cache_flush(); 343 global_cache_flush();
344 for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { 344 for (i = 0, j = pg_start; i < mem->page_count; i++, j++) {
345 writel(agp_bridge->driver->mask_memory(agp_bridge, 345 writel(agp_bridge->driver->mask_memory(agp_bridge,
346 mem->pages[i], 346 phys_to_gart(page_to_phys(mem->pages[i])),
347 mask_type), 347 mask_type),
348 intel_private.registers+I810_PTE_BASE+(j*4)); 348 intel_private.registers+I810_PTE_BASE+(j*4));
349 } 349 }
@@ -461,9 +461,8 @@ static void intel_i810_free_by_type(struct agp_memory *curr)
461} 461}
462 462
463static unsigned long intel_i810_mask_memory(struct agp_bridge_data *bridge, 463static unsigned long intel_i810_mask_memory(struct agp_bridge_data *bridge,
464 struct page *page, int type) 464 dma_addr_t addr, int type)
465{ 465{
466 unsigned long addr = phys_to_gart(page_to_phys(page));
467 /* Type checking must be done elsewhere */ 466 /* Type checking must be done elsewhere */
468 return addr | bridge->driver->masks[type].mask; 467 return addr | bridge->driver->masks[type].mask;
469} 468}
@@ -851,7 +850,7 @@ static int intel_i830_insert_entries(struct agp_memory *mem, off_t pg_start,
851 850
852 for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { 851 for (i = 0, j = pg_start; i < mem->page_count; i++, j++) {
853 writel(agp_bridge->driver->mask_memory(agp_bridge, 852 writel(agp_bridge->driver->mask_memory(agp_bridge,
854 mem->pages[i], mask_type), 853 phys_to_gart(page_to_phys(mem->pages[i])), mask_type),
855 intel_private.registers+I810_PTE_BASE+(j*4)); 854 intel_private.registers+I810_PTE_BASE+(j*4));
856 } 855 }
857 readl(intel_private.registers+I810_PTE_BASE+((j-1)*4)); 856 readl(intel_private.registers+I810_PTE_BASE+((j-1)*4));
@@ -1081,7 +1080,9 @@ static int intel_i915_insert_entries(struct agp_memory *mem, off_t pg_start,
1081 1080
1082 for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { 1081 for (i = 0, j = pg_start; i < mem->page_count; i++, j++) {
1083 writel(agp_bridge->driver->mask_memory(agp_bridge, 1082 writel(agp_bridge->driver->mask_memory(agp_bridge,
1084 mem->pages[i], mask_type), intel_private.gtt+j); 1083 phys_to_gart(page_to_phys(mem->pages[i])),
1084 mask_type),
1085 intel_private.gtt+j);
1085 } 1086 }
1086 1087
1087 readl(intel_private.gtt+j-1); 1088 readl(intel_private.gtt+j-1);
@@ -1196,9 +1197,8 @@ static int intel_i915_create_gatt_table(struct agp_bridge_data *bridge)
1196 * this conditional. 1197 * this conditional.
1197 */ 1198 */
1198static unsigned long intel_i965_mask_memory(struct agp_bridge_data *bridge, 1199static unsigned long intel_i965_mask_memory(struct agp_bridge_data *bridge,
1199 struct page *page, int type) 1200 dma_addr_t addr, int type)
1200{ 1201{
1201 dma_addr_t addr = phys_to_gart(page_to_phys(page));
1202 /* Shift high bits down */ 1202 /* Shift high bits down */
1203 addr |= (addr >> 28) & 0xf0; 1203 addr |= (addr >> 28) & 0xf0;
1204 1204