Skip to content

Commit 6a12235

Browse files
David WoodhouseDavid Woodhouse
authored andcommitted
agp: kill phys_to_gart() and gart_to_phys()
There seems to be no reason for these -- they're a 1:1 mapping on all platforms. Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
1 parent f692775 commit 6a12235

21 files changed

Lines changed: 32 additions & 60 deletions

File tree

‎arch/alpha/include/asm/agp.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
#define unmap_page_from_agp(page)
1010
#define flush_agp_cache() mb()
1111

12-
/* Convert a physical address to an address suitable for the GART. */
13-
#define phys_to_gart(x) (x)
14-
#define gart_to_phys(x) (x)
15-
1612
/* GATT allocation. Returns/accepts GATT kernel virtual address. */
1713
#define alloc_gatt_pages(order) \
1814
((char *)__get_free_pages(GFP_KERNEL, (order)))

‎arch/ia64/include/asm/agp.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@
1717
#define unmap_page_from_agp(page) /* nothing */
1818
#define flush_agp_cache() mb()
1919

20-
/* Convert a physical address to an address suitable for the GART. */
21-
#define phys_to_gart(x) (x)
22-
#define gart_to_phys(x) (x)
23-
2420
/* GATT allocation. Returns/accepts GATT kernel virtual address. */
2521
#define alloc_gatt_pages(order) \
2622
((char *)__get_free_pages(GFP_KERNEL, (order)))

‎arch/parisc/include/asm/agp.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
#define unmap_page_from_agp(page) /* nothing */
1212
#define flush_agp_cache() mb()
1313

14-
/* Convert a physical address to an address suitable for the GART. */
15-
#define phys_to_gart(x) (x)
16-
#define gart_to_phys(x) (x)
17-
1814
/* GATT allocation. Returns/accepts GATT kernel virtual address. */
1915
#define alloc_gatt_pages(order) \
2016
((char *)__get_free_pages(GFP_KERNEL, (order)))

‎arch/powerpc/include/asm/agp.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
#define unmap_page_from_agp(page)
99
#define flush_agp_cache() mb()
1010

11-
/* Convert a physical address to an address suitable for the GART. */
12-
#define phys_to_gart(x) (x)
13-
#define gart_to_phys(x) (x)
14-
1511
/* GATT allocation. Returns/accepts GATT kernel virtual address. */
1612
#define alloc_gatt_pages(order) \
1713
((char *)__get_free_pages(GFP_KERNEL, (order)))

‎arch/sparc/include/asm/agp.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77
#define unmap_page_from_agp(page)
88
#define flush_agp_cache() mb()
99

10-
/* Convert a physical address to an address suitable for the GART. */
11-
#define phys_to_gart(x) (x)
12-
#define gart_to_phys(x) (x)
13-
1410
/* GATT allocation. Returns/accepts GATT kernel virtual address. */
1511
#define alloc_gatt_pages(order) \
1612
((char *)__get_free_pages(GFP_KERNEL, (order)))

‎arch/x86/include/asm/agp.h‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,6 @@
2222
*/
2323
#define flush_agp_cache() wbinvd()
2424

25-
/* Convert a physical address to an address suitable for the GART. */
26-
#define phys_to_gart(x) (x)
27-
#define gart_to_phys(x) (x)
28-
2925
/* GATT allocation. Returns/accepts GATT kernel virtual address. */
3026
#define alloc_gatt_pages(order) \
3127
((char *)__get_free_pages(GFP_KERNEL, (order)))

‎drivers/char/agp/agp.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,6 @@ void agp3_generic_cleanup(void);
318318
#define AGP_GENERIC_SIZES_ENTRIES 11
319319
extern const struct aper_size_info_16 agp3_generic_sizes[];
320320

321-
#define virt_to_gart(x) (phys_to_gart(virt_to_phys(x)))
322-
#define gart_to_virt(x) (phys_to_virt(gart_to_phys(x)))
323-
324321
extern int agp_off;
325322
extern int agp_try_unsupported_boot;
326323

‎drivers/char/agp/ali-agp.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ static struct page *m1541_alloc_page(struct agp_bridge_data *bridge)
152152
pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp);
153153
pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL,
154154
(((temp & ALI_CACHE_FLUSH_ADDR_MASK) |
155-
phys_to_gart(page_to_phys(page))) | ALI_CACHE_FLUSH_EN ));
155+
page_to_phys(page)) | ALI_CACHE_FLUSH_EN ));
156156
return page;
157157
}
158158

@@ -180,7 +180,7 @@ static void m1541_destroy_page(struct page *page, int flags)
180180
pci_read_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL, &temp);
181181
pci_write_config_dword(agp_bridge->dev, ALI_CACHE_FLUSH_CTRL,
182182
(((temp & ALI_CACHE_FLUSH_ADDR_MASK) |
183-
phys_to_gart(page_to_phys(page))) | ALI_CACHE_FLUSH_EN));
183+
page_to_phys(page)) | ALI_CACHE_FLUSH_EN));
184184
}
185185
agp_generic_destroy_page(page, flags);
186186
}

‎drivers/char/agp/amd-k7-agp.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ static int amd_create_page_map(struct amd_page_map *page_map)
4444
#ifndef CONFIG_X86
4545
SetPageReserved(virt_to_page(page_map->real));
4646
global_cache_flush();
47-
page_map->remapped = ioremap_nocache(virt_to_gart(page_map->real),
47+
page_map->remapped = ioremap_nocache(virt_to_phys(page_map->real),
4848
PAGE_SIZE);
4949
if (page_map->remapped == NULL) {
5050
ClearPageReserved(virt_to_page(page_map->real));
@@ -160,7 +160,7 @@ static int amd_create_gatt_table(struct agp_bridge_data *bridge)
160160

161161
agp_bridge->gatt_table_real = (u32 *)page_dir.real;
162162
agp_bridge->gatt_table = (u32 __iomem *)page_dir.remapped;
163-
agp_bridge->gatt_bus_addr = virt_to_gart(page_dir.real);
163+
agp_bridge->gatt_bus_addr = virt_to_phys(page_dir.real);
164164

165165
/* Get the address for the gart region.
166166
* This is a bus address even on the alpha, b/c its
@@ -173,7 +173,7 @@ static int amd_create_gatt_table(struct agp_bridge_data *bridge)
173173

174174
/* Calculate the agp offset */
175175
for (i = 0; i < value->num_entries / 1024; i++, addr += 0x00400000) {
176-
writel(virt_to_gart(amd_irongate_private.gatt_pages[i]->real) | 1,
176+
writel(virt_to_phys(amd_irongate_private.gatt_pages[i]->real) | 1,
177177
page_dir.remapped+GET_PAGE_DIR_OFF(addr));
178178
readl(page_dir.remapped+GET_PAGE_DIR_OFF(addr)); /* PCI Posting. */
179179
}
@@ -325,7 +325,7 @@ static int amd_insert_memory(struct agp_memory *mem, off_t pg_start, int type)
325325
addr = (j * PAGE_SIZE) + agp_bridge->gart_bus_addr;
326326
cur_gatt = GET_GATT(addr);
327327
writel(agp_generic_mask_memory(agp_bridge,
328-
phys_to_gart(page_to_phys(mem->pages[i])),
328+
page_to_phys(mem->pages[i]),
329329
mem->type),
330330
cur_gatt+GET_GATT_OFF(addr));
331331
readl(cur_gatt+GET_GATT_OFF(addr)); /* PCI Posting. */

‎drivers/char/agp/amd64-agp.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static int amd64_insert_memory(struct agp_memory *mem, off_t pg_start, int type)
7979

8080
for (i = 0, j = pg_start; i < mem->page_count; i++, j++) {
8181
tmp = agp_bridge->driver->mask_memory(agp_bridge,
82-
phys_to_gart(page_to_phys(mem->pages[i])),
82+
page_to_phys(mem->pages[i]),
8383
mask_type);
8484

8585
BUG_ON(tmp & 0xffffff0000000ffcULL);
@@ -178,7 +178,7 @@ static const struct aper_size_info_32 amd_8151_sizes[7] =
178178

179179
static int amd_8151_configure(void)
180180
{
181-
unsigned long gatt_bus = virt_to_gart(agp_bridge->gatt_table_real);
181+
unsigned long gatt_bus = virt_to_phys(agp_bridge->gatt_table_real);
182182
int i;
183183

184184
/* Configure AGP regs in each x86-64 host bridge. */
@@ -558,7 +558,7 @@ static void __devexit agp_amd64_remove(struct pci_dev *pdev)
558558
{
559559
struct agp_bridge_data *bridge = pci_get_drvdata(pdev);
560560

561-
release_mem_region(virt_to_gart(bridge->gatt_table_real),
561+
release_mem_region(virt_to_phys(bridge->gatt_table_real),
562562
amd64_aperture_sizes[bridge->aperture_size_idx].size);
563563
agp_remove_bridge(bridge);
564564
agp_put_bridge(bridge);

0 commit comments

Comments
 (0)