diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2009-07-27 10:27:29 +0100 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-08-03 09:04:44 +0100 |
commit | 2a4ceb6d3e6a566cb4a9dc8f974177f031d27cd7 (patch) | |
tree | a21d2c5ad10522d9a1469e7cd985d5f1d8f5d17f /drivers/char/agp/generic.c | |
parent | ed680c4ad478d0fee9740f7d029087f181346564 (diff) |
agp: Switch mask_memory() method to take address argument again, not page
In commit 07613ba2 ("agp: switch AGP to use page array instead of
unsigned long array") we switched the mask_memory() method to take a
'struct page *' instead of an address. This is painful, because in some
cases it has to be an IOMMU-mapped virtual bus address (in fact,
shouldn't it _always_ be a dma_addr_t returned from pci_map_xxx(), and
we just happen to get lucky most of the time?)
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/char/agp/generic.c')
-rw-r--r-- | drivers/char/agp/generic.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/char/agp/generic.c b/drivers/char/agp/generic.c index 1e8b461b91f..a3bcc7ef42f 100644 --- a/drivers/char/agp/generic.c +++ b/drivers/char/agp/generic.c @@ -1132,7 +1132,9 @@ int agp_generic_insert_memory(struct agp_memory * mem, off_t pg_start, int type) } for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { - writel(bridge->driver->mask_memory(bridge, mem->pages[i], mask_type), + writel(bridge->driver->mask_memory(bridge, + phys_to_gart(page_to_phys(mem->pages[i])), + mask_type), bridge->gatt_table+j); } readl(bridge->gatt_table+j-1); /* PCI Posting. */ @@ -1347,9 +1349,8 @@ void global_cache_flush(void) EXPORT_SYMBOL(global_cache_flush); unsigned long agp_generic_mask_memory(struct agp_bridge_data *bridge, - struct page *page, int type) + dma_addr_t addr, int type) { - unsigned long addr = phys_to_gart(page_to_phys(page)); /* memory type is ignored in the generic routine */ if (bridge->driver->masks) return addr | bridge->driver->masks[0].mask; |