diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2009-07-27 05:27:29 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2009-08-03 04:04:44 -0400 |
commit | 2a4ceb6d3e6a566cb4a9dc8f974177f031d27cd7 (patch) | |
tree | a21d2c5ad10522d9a1469e7cd985d5f1d8f5d17f /drivers/char/agp/i460-agp.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/i460-agp.c')
-rw-r--r-- | drivers/char/agp/i460-agp.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/drivers/char/agp/i460-agp.c b/drivers/char/agp/i460-agp.c index 60cc35bb5db7..54191f860539 100644 --- a/drivers/char/agp/i460-agp.c +++ b/drivers/char/agp/i460-agp.c | |||
@@ -61,7 +61,7 @@ | |||
61 | #define WR_FLUSH_GATT(index) RD_GATT(index) | 61 | #define WR_FLUSH_GATT(index) RD_GATT(index) |
62 | 62 | ||
63 | static unsigned long i460_mask_memory (struct agp_bridge_data *bridge, | 63 | static unsigned long i460_mask_memory (struct agp_bridge_data *bridge, |
64 | unsigned long addr, int type); | 64 | dma_addr_t addr, int type); |
65 | 65 | ||
66 | static struct { | 66 | static struct { |
67 | void *gatt; /* ioremap'd GATT area */ | 67 | void *gatt; /* ioremap'd GATT area */ |
@@ -546,20 +546,13 @@ static void i460_destroy_page (struct page *page, int flags) | |||
546 | #endif /* I460_LARGE_IO_PAGES */ | 546 | #endif /* I460_LARGE_IO_PAGES */ |
547 | 547 | ||
548 | static unsigned long i460_mask_memory (struct agp_bridge_data *bridge, | 548 | static unsigned long i460_mask_memory (struct agp_bridge_data *bridge, |
549 | unsigned long addr, int type) | 549 | dma_addr_t addr, int type) |
550 | { | 550 | { |
551 | /* Make sure the returned address is a valid GATT entry */ | 551 | /* Make sure the returned address is a valid GATT entry */ |
552 | return bridge->driver->masks[0].mask | 552 | return bridge->driver->masks[0].mask |
553 | | (((addr & ~((1 << I460_IO_PAGE_SHIFT) - 1)) & 0xfffff000) >> 12); | 553 | | (((addr & ~((1 << I460_IO_PAGE_SHIFT) - 1)) & 0xfffff000) >> 12); |
554 | } | 554 | } |
555 | 555 | ||
556 | static unsigned long i460_page_mask_memory(struct agp_bridge_data *bridge, | ||
557 | struct page *page, int type) | ||
558 | { | ||
559 | unsigned long addr = phys_to_gart(page_to_phys(page)); | ||
560 | return i460_mask_memory(bridge, addr, type); | ||
561 | } | ||
562 | |||
563 | const struct agp_bridge_driver intel_i460_driver = { | 556 | const struct agp_bridge_driver intel_i460_driver = { |
564 | .owner = THIS_MODULE, | 557 | .owner = THIS_MODULE, |
565 | .aperture_sizes = i460_sizes, | 558 | .aperture_sizes = i460_sizes, |
@@ -569,7 +562,7 @@ const struct agp_bridge_driver intel_i460_driver = { | |||
569 | .fetch_size = i460_fetch_size, | 562 | .fetch_size = i460_fetch_size, |
570 | .cleanup = i460_cleanup, | 563 | .cleanup = i460_cleanup, |
571 | .tlb_flush = i460_tlb_flush, | 564 | .tlb_flush = i460_tlb_flush, |
572 | .mask_memory = i460_page_mask_memory, | 565 | .mask_memory = i460_mask_memory, |
573 | .masks = i460_masks, | 566 | .masks = i460_masks, |
574 | .agp_enable = agp_generic_enable, | 567 | .agp_enable = agp_generic_enable, |
575 | .cache_flush = global_cache_flush, | 568 | .cache_flush = global_cache_flush, |