diff options
author | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2006-10-18 15:26:52 +0200 |
---|---|---|
committer | Thomas Hellstrom <thomas-at-tungstengraphics-dot-com> | 2006-10-18 15:26:52 +0200 |
commit | e8b1faef7798d6dee88c16e7b9949c45792560bf (patch) | |
tree | b3f0b26413cede6e6322d3ce5458bfb43f118b55 | |
parent | eeae75acd6ec94b6959c98a6b2c9ddcffc9a6cd0 (diff) |
Remove the pre-2.6.12 version of struct agp_bridge_driver.
-rw-r--r-- | agp.h | 36 | ||||
-rw-r--r-- | generic.c | 31 | ||||
-rw-r--r-- | intel-agp.c | 72 |
3 files changed, 5 insertions, 134 deletions
@@ -92,32 +92,6 @@ struct aper_size_info_fixed { int page_order; }; -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) -struct agp_bridge_driver { - struct module *owner; - void *aperture_sizes; - int num_aperture_sizes; - enum aper_size_type size_type; - int cant_use_aperture; - int needs_scratch_page; - struct gatt_mask *masks; - int (*fetch_size)(void); - int (*configure)(void); - void (*agp_enable)(u32); - void (*cleanup)(void); - void (*tlb_flush)(struct agp_memory *); - unsigned long (*mask_memory)(unsigned long, int); - void (*cache_flush)(void); - int (*create_gatt_table)(void); - int (*free_gatt_table)(void); - int (*insert_memory)(struct agp_memory *, off_t, int); - int (*remove_memory)(struct agp_memory *, off_t, int); - struct agp_memory *(*alloc_by_type) (size_t, int); - void (*free_by_type)(struct agp_memory *); - void *(*agp_alloc_page)(void); - void (*agp_destroy_page)(void *); -}; -#else struct agp_bridge_driver { struct module *owner; void *aperture_sizes; @@ -143,7 +117,6 @@ struct agp_bridge_driver { void *(*agp_alloc_page)(struct agp_bridge_data *); void (*agp_destroy_page)(void *); }; -#endif struct agp_bridge_data { struct agp_version *version; @@ -283,14 +256,6 @@ int agp_frontend_initialize(void); void agp_frontend_cleanup(void); /* Generic routines. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) -void agp_generic_enable(u32 mode); -int agp_generic_create_gatt_table(void); -int agp_generic_free_gatt_table(void); -void *agp_generic_alloc_page(void); -u32 agp_collect_device_status(u32 mode, u32 command); -unsigned long agp_generic_mask_memory(unsigned long addr, int type); -#else void agp_generic_enable(struct agp_bridge_data *bridge, u32 mode); int agp_generic_create_gatt_table(struct agp_bridge_data *bridge); int agp_generic_free_gatt_table(struct agp_bridge_data *bridge); @@ -300,7 +265,6 @@ u32 agp_collect_device_status(struct agp_bridge_data *bridge, unsigned long agp_generic_mask_memory(struct agp_bridge_data *bridge, unsigned long addr, int type); -#endif struct agp_memory *agp_create_memory(int scratch_pages); @@ -930,14 +930,8 @@ void get_agp_version(struct agp_bridge_data *bridge) } EXPORT_SYMBOL(get_agp_version); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) -void agp_generic_enable(u32 requested_mode) -{ - struct agp_bridge_data *bridge = agp_bridge; -#else void agp_generic_enable(struct agp_bridge_data *bridge, u32 requested_mode) { -#endif u32 bridge_agpstat, temp; get_agp_version(agp_bridge); @@ -988,14 +982,8 @@ void agp_generic_enable(struct agp_bridge_data *bridge, u32 requested_mode) } EXPORT_SYMBOL(agp_generic_enable); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) -int agp_generic_create_gatt_table( void ) -{ - struct agp_bridge_data *bridge = agp_bridge; -#else int agp_generic_create_gatt_table(struct agp_bridge_data *bridge) { -#endif char *table; char *table_end; int size; @@ -1125,14 +1113,8 @@ int agp_generic_create_gatt_table(struct agp_bridge_data *bridge) } EXPORT_SYMBOL(agp_generic_create_gatt_table); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) -int agp_generic_free_gatt_table( void ) -{ - struct agp_bridge_data *bridge = agp_bridge; -#else int agp_generic_free_gatt_table(struct agp_bridge_data *bridge) { -#endif int page_order; char *table, *table_end; void *temp; @@ -1323,13 +1305,8 @@ EXPORT_SYMBOL(agp_generic_free_by_type); * against a maximum value. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) -void *agp_generic_alloc_page( void ) -{ -#else void *agp_generic_alloc_page(struct agp_bridge_data *bridge) { -#endif struct page * page; page = alloc_page(GFP_KERNEL); @@ -1375,7 +1352,7 @@ void agp_enable(u32 mode) { if (agp_bridge->type == NOT_SUPPORTED) return; - agp_bridge->driver->agp_enable(mode); + agp_bridge->driver->agp_enable(agp_bridge, mode); } #else void agp_enable(struct agp_bridge_data *bridge, u32 mode) @@ -1414,15 +1391,9 @@ void global_cache_flush(void) } EXPORT_SYMBOL(global_cache_flush); -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) -unsigned long agp_generic_mask_memory(unsigned long addr, int type) -{ - struct agp_bridge_data *bridge = agp_bridge; -#else unsigned long agp_generic_mask_memory(struct agp_bridge_data *bridge, unsigned long addr, int type) { -#endif /* memory type is ignored in the generic routine */ if (bridge->driver->masks) return addr | bridge->driver->masks[0].mask; diff --git a/intel-agp.c b/intel-agp.c index 3fe6cbc..4ac5cb9 100644 --- a/intel-agp.c +++ b/intel-agp.c @@ -197,14 +197,9 @@ static int intel_generic_insert_memory(struct agp_memory * mem, global_cache_flush(); for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) - writel(bridge->driver->mask_memory(mem->memory[i], mem->type), + writel(bridge->driver->mask_memory(bridge, + mem->memory[i], mem->type), bridge->gatt_table+j); -#else - writel(bridge->driver->mask_memory(bridge, mem->memory[i], - mem->type), - bridge->gatt_table+j); -#endif } readl(bridge->gatt_table+mem->page_count-1); bridge->driver->tlb_flush(mem); @@ -336,11 +331,7 @@ static void intel_i810_tlbflush(struct agp_memory *mem) return; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) -static void intel_i810_agp_enable(u32 mode) -#else static void intel_i810_agp_enable(struct agp_bridge_data *bridge, u32 mode) -#endif { return; } @@ -434,17 +425,10 @@ static int intel_i810_insert_entries(struct agp_memory *mem, off_t pg_start, if (!mem->is_flushed) global_cache_flush(); for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) - writel(bridge->driver->mask_memory(mem->memory[i], + writel(bridge->driver->mask_memory(bridge, + mem->memory[i], mem->type), intel_i810_private.registers+I810_PTE_BASE+(j*4)); - -#else - writel(bridge->driver->mask_memory(bridge, - mem->memory[i], - mem->type), - intel_i810_private.registers+I810_PTE_BASE+(j*4)); -#endif } readl(intel_i810_private.registers+I810_PTE_BASE+((j-1)*4)); break; @@ -491,11 +475,7 @@ static struct agp_memory *alloc_agpphysmem_i8xx(size_t pg_count, int type) return NULL; switch (pg_count) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) - case 1: addr = agp_bridge->driver->agp_alloc_page(); -#else case 1: addr = agp_bridge->driver->agp_alloc_page(agp_bridge); -#endif flush_agp_mappings(); break; case 4: @@ -572,20 +552,12 @@ static void intel_i810_free_by_type(struct agp_memory *curr) kfree(curr); } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) -static unsigned long intel_i810_mask_memory(unsigned long addr, int type) -{ - /* Type checking must be done elsewhere */ - return addr | agp_bridge->driver->masks[type].mask; -} -#else static unsigned long intel_i810_mask_memory(struct agp_bridge_data *bridge, unsigned long addr, int type) { /* Type checking must be done elsewhere */ return addr | bridge->driver->masks[type].mask; } -#endif static struct aper_size_info_fixed intel_i830_sizes[] = { @@ -703,13 +675,8 @@ static void intel_i830_init_gtt_entries(void) /* The intel i830 automatically initializes the agp aperture during POST. * Use the memory already set aside for in the GTT. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) -static int intel_i830_create_gatt_table( void ) -{ -#else static int intel_i830_create_gatt_table(struct agp_bridge_data *bridge) { -#endif int page_order; struct aper_size_info_fixed *size; int num_entries; @@ -743,11 +710,7 @@ static int intel_i830_create_gatt_table(struct agp_bridge_data *bridge) /* Return the gatt table to a sane state. Use the top of stolen * memory for the GTT. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) -static int intel_i830_free_gatt_table(void) -#else static int intel_i830_free_gatt_table(struct agp_bridge_data *bridge) -#endif { return 0; } @@ -866,14 +829,9 @@ static int intel_i830_insert_entries(struct agp_memory *mem,off_t pg_start, int global_cache_flush(); for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) - writel(bridge->driver->mask_memory(mem->memory[i], mem->type), - intel_i830_private.registers+I810_PTE_BASE+(j*4)); -#else writel(bridge->driver->mask_memory(bridge, mem->memory[i], mem->type), intel_i830_private.registers+I810_PTE_BASE+(j*4)); -#endif } readl(intel_i830_private.registers+I810_PTE_BASE+((j-1)*4)); bridge->driver->tlb_flush(mem); @@ -904,15 +862,8 @@ static int intel_i830_remove_entries(struct agp_memory *mem,off_t pg_start, return 0; } -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) -static void *intel_alloc_page( void ) -{ - struct agp_bridge_data *bridge = agp_bridge; - -#else static void *intel_alloc_page(struct agp_bridge_data *bridge) { -#endif struct page * page; page = alloc_page(GFP_KERNEL); @@ -1056,15 +1007,9 @@ static int intel_i915_insert_entries(struct agp_memory *mem,off_t pg_start, global_cache_flush(); for (i = 0, j = pg_start; i < mem->page_count; i++, j++) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) - writel(bridge->driver->mask_memory(mem->memory[i], mem->type), - intel_i830_private.gtt+j); -#else writel(bridge->driver->mask_memory(bridge, mem->memory[i], mem->type), intel_i830_private.gtt+j); - -#endif } readl(intel_i830_private.gtt+j-1); bridge->driver->tlb_flush(mem); @@ -1116,13 +1061,8 @@ static int intel_i915_fetch_size(void) /* The intel i915 automatically initializes the agp aperture during POST. * Use the memory already set aside for in the GTT. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) -static int intel_i915_create_gatt_table( void ) -{ -#else static int intel_i915_create_gatt_table(struct agp_bridge_data *bridge) { -#endif int page_order; struct aper_size_info_fixed *size; int num_entries; @@ -1192,11 +1132,7 @@ static int intel_i965_fetch_size(void) /* The intel i965 automatically initializes the agp aperture during POST. * Use the memory already set aside for in the GTT. */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) -static int intel_i965_create_gatt_table(void) -#else static int intel_i965_create_gatt_table(struct agp_bridge_data *bridge) -#endif { int page_order; struct aper_size_info_fixed *size; |