Lines Matching refs:bridge

178 		curr->bridge->driver->free_by_type(curr);  in agp_free_memory()
182 if (curr->bridge->driver->agp_destroy_pages) { in agp_free_memory()
183 curr->bridge->driver->agp_destroy_pages(curr); in agp_free_memory()
187 curr->bridge->driver->agp_destroy_page( in agp_free_memory()
192 curr->bridge->driver->agp_destroy_page( in agp_free_memory()
218 struct agp_memory *agp_allocate_memory(struct agp_bridge_data *bridge, in agp_allocate_memory() argument
226 if (!bridge) in agp_allocate_memory()
229 cur_memory = atomic_read(&bridge->current_memory_agp); in agp_allocate_memory()
230 if ((cur_memory + page_count > bridge->max_memory_agp) || in agp_allocate_memory()
237 new->bridge = bridge; in agp_allocate_memory()
242 new = bridge->driver->alloc_by_type(page_count, type); in agp_allocate_memory()
244 new->bridge = bridge; in agp_allocate_memory()
255 if (bridge->driver->agp_alloc_pages) { in agp_allocate_memory()
256 if (bridge->driver->agp_alloc_pages(bridge, new, page_count)) { in agp_allocate_memory()
260 new->bridge = bridge; in agp_allocate_memory()
265 struct page *page = bridge->driver->agp_alloc_page(bridge); in agp_allocate_memory()
274 new->bridge = bridge; in agp_allocate_memory()
364 int agp_copy_info(struct agp_bridge_data *bridge, struct agp_kern_info *info) in agp_copy_info() argument
367 if (!bridge) { in agp_copy_info()
372 info->version.major = bridge->version->major; in agp_copy_info()
373 info->version.minor = bridge->version->minor; in agp_copy_info()
375 info->device = bridge->dev; in agp_copy_info()
376 if (bridge->mode & AGPSTAT_MODE_3_0) in agp_copy_info()
377 info->mode = bridge->mode & ~AGP3_RESERVED_MASK; in agp_copy_info()
379 info->mode = bridge->mode & ~AGP2_RESERVED_MASK; in agp_copy_info()
380 info->aper_base = bridge->gart_bus_addr; in agp_copy_info()
382 info->max_memory = bridge->max_memory_agp; in agp_copy_info()
383 info->current_memory = atomic_read(&bridge->current_memory_agp); in agp_copy_info()
384 info->cant_use_aperture = bridge->driver->cant_use_aperture; in agp_copy_info()
385 info->vm_ops = bridge->vm_ops; in agp_copy_info()
420 curr->bridge->driver->cache_flush(); in agp_bind_memory()
424 ret_val = curr->bridge->driver->insert_memory(curr, pg_start, curr->type); in agp_bind_memory()
460 ret_val = curr->bridge->driver->remove_memory(curr, curr->pg_start, curr->type); in agp_unbind_memory()
467 spin_lock(&curr->bridge->mapped_lock); in agp_unbind_memory()
469 spin_unlock(&curr->bridge->mapped_lock); in agp_unbind_memory()
721 u32 agp_collect_device_status(struct agp_bridge_data *bridge, u32 requested_mode, u32 bridge_agpsta… in agp_collect_device_status() argument
789 void get_agp_version(struct agp_bridge_data *bridge) in get_agp_version() argument
794 if (bridge->major_version != 0) in get_agp_version()
797 pci_read_config_dword(bridge->dev, bridge->capndx, &ncapid); in get_agp_version()
798 bridge->major_version = (ncapid >> AGP_MAJOR_VERSION_SHIFT) & 0xf; in get_agp_version()
799 bridge->minor_version = (ncapid >> AGP_MINOR_VERSION_SHIFT) & 0xf; in get_agp_version()
804 void agp_generic_enable(struct agp_bridge_data *bridge, u32 requested_mode) in agp_generic_enable() argument
824 if (bridge->major_version >= 3) { in agp_generic_enable()
825 if (bridge->mode & AGPSTAT_MODE_3_0) { in agp_generic_enable()
827 if (bridge->minor_version >= 5) in agp_generic_enable()
828 agp_3_5_enable(bridge); in agp_generic_enable()
834 pci_read_config_dword(bridge->dev, in agp_generic_enable()
835 bridge->capndx+AGPCTRL, &temp); in agp_generic_enable()
837 pci_write_config_dword(bridge->dev, in agp_generic_enable()
838 bridge->capndx+AGPCTRL, temp); in agp_generic_enable()
840 dev_info(&bridge->dev->dev, "bridge is in legacy mode, falling back to 2.x\n"); in agp_generic_enable()
850 int agp_generic_create_gatt_table(struct agp_bridge_data *bridge) in agp_generic_create_gatt_table() argument
861 if (bridge->driver->size_type == LVL2_APER_SIZE) in agp_generic_create_gatt_table()
865 i = bridge->aperture_size_idx; in agp_generic_create_gatt_table()
866 temp = bridge->current_size; in agp_generic_create_gatt_table()
869 if (bridge->driver->size_type != FIXED_APER_SIZE) { in agp_generic_create_gatt_table()
871 switch (bridge->driver->size_type) { in agp_generic_create_gatt_table()
898 switch (bridge->driver->size_type) { in agp_generic_create_gatt_table()
900 bridge->current_size = A_IDX8(bridge); in agp_generic_create_gatt_table()
903 bridge->current_size = A_IDX16(bridge); in agp_generic_create_gatt_table()
906 bridge->current_size = A_IDX32(bridge); in agp_generic_create_gatt_table()
914 temp = bridge->current_size; in agp_generic_create_gatt_table()
916 bridge->aperture_size_idx = i; in agp_generic_create_gatt_table()
918 } while (!table && (i < bridge->driver->num_aperture_sizes)); in agp_generic_create_gatt_table()
933 bridge->gatt_table_real = (u32 *) table; in agp_generic_create_gatt_table()
936 bridge->driver->cache_flush(); in agp_generic_create_gatt_table()
941 bridge->gatt_table = (u32 __iomem *)table; in agp_generic_create_gatt_table()
943 bridge->gatt_table = ioremap(virt_to_phys(table), in agp_generic_create_gatt_table()
945 bridge->driver->cache_flush(); in agp_generic_create_gatt_table()
948 if (bridge->gatt_table == NULL) { in agp_generic_create_gatt_table()
956 bridge->gatt_bus_addr = virt_to_phys(bridge->gatt_table_real); in agp_generic_create_gatt_table()
960 writel(bridge->scratch_page, bridge->gatt_table+i); in agp_generic_create_gatt_table()
961 readl(bridge->gatt_table+i); /* PCI Posting. */ in agp_generic_create_gatt_table()
968 int agp_generic_free_gatt_table(struct agp_bridge_data *bridge) in agp_generic_free_gatt_table() argument
975 temp = bridge->current_size; in agp_generic_free_gatt_table()
977 switch (bridge->driver->size_type) { in agp_generic_free_gatt_table()
1003 set_memory_wb((unsigned long)bridge->gatt_table, 1 << page_order); in agp_generic_free_gatt_table()
1005 iounmap(bridge->gatt_table); in agp_generic_free_gatt_table()
1007 table = (char *) bridge->gatt_table_real; in agp_generic_free_gatt_table()
1013 free_gatt_pages(bridge->gatt_table_real, page_order); in agp_generic_free_gatt_table()
1016 bridge->gatt_table = NULL; in agp_generic_free_gatt_table()
1017 bridge->gatt_table_real = NULL; in agp_generic_free_gatt_table()
1018 bridge->gatt_bus_addr = 0; in agp_generic_free_gatt_table()
1031 struct agp_bridge_data *bridge; in agp_generic_insert_memory() local
1034 bridge = mem->bridge; in agp_generic_insert_memory()
1035 if (!bridge) in agp_generic_insert_memory()
1041 temp = bridge->current_size; in agp_generic_insert_memory()
1043 switch (bridge->driver->size_type) { in agp_generic_insert_memory()
1070 mask_type = bridge->driver->agp_type_to_mask_type(bridge, type); in agp_generic_insert_memory()
1083 if (!PGE_EMPTY(bridge, readl(bridge->gatt_table+j))) in agp_generic_insert_memory()
1089 bridge->driver->cache_flush(); in agp_generic_insert_memory()
1094 writel(bridge->driver->mask_memory(bridge, in agp_generic_insert_memory()
1097 bridge->gatt_table+j); in agp_generic_insert_memory()
1099 readl(bridge->gatt_table+j-1); /* PCI Posting. */ in agp_generic_insert_memory()
1101 bridge->driver->tlb_flush(mem); in agp_generic_insert_memory()
1110 struct agp_bridge_data *bridge; in agp_generic_remove_memory() local
1113 bridge = mem->bridge; in agp_generic_remove_memory()
1114 if (!bridge) in agp_generic_remove_memory()
1128 mask_type = bridge->driver->agp_type_to_mask_type(bridge, type); in agp_generic_remove_memory()
1136 writel(bridge->scratch_page, bridge->gatt_table+i); in agp_generic_remove_memory()
1138 readl(bridge->gatt_table+i-1); /* PCI Posting. */ in agp_generic_remove_memory()
1140 bridge->driver->tlb_flush(mem); in agp_generic_remove_memory()
1187 int agp_generic_alloc_pages(struct agp_bridge_data *bridge, struct agp_memory *mem, size_t num_page… in agp_generic_alloc_pages() argument
1217 struct page *agp_generic_alloc_page(struct agp_bridge_data *bridge) in agp_generic_alloc_page() argument
1284 void agp_enable(struct agp_bridge_data *bridge, u32 mode) in agp_enable() argument
1286 if (!bridge) in agp_enable()
1288 bridge->driver->agp_enable(bridge, mode); in agp_enable()
1315 unsigned long agp_generic_mask_memory(struct agp_bridge_data *bridge, in agp_generic_mask_memory() argument
1319 if (bridge->driver->masks) in agp_generic_mask_memory()
1320 return addr | bridge->driver->masks[0].mask; in agp_generic_mask_memory()
1326 int agp_generic_type_to_mask_type(struct agp_bridge_data *bridge, in agp_generic_type_to_mask_type() argument