Lines Matching refs:bridge

194 		curr->bridge->driver->free_by_type(curr);
198 if (curr->bridge->driver->agp_destroy_pages) {
199 curr->bridge->driver->agp_destroy_pages(curr);
203 curr->bridge->driver->agp_destroy_page(
208 curr->bridge->driver->agp_destroy_page(
228 * Every agp bridge device will allow you to allocate AGP_NORMAL_MEMORY which
233 struct agp_memory *agp_allocate_memory(struct agp_bridge_data *bridge,
241 if (!bridge)
244 cur_memory = atomic_read(&bridge->current_memory_agp);
245 if ((cur_memory + page_count > bridge->max_memory_agp) ||
252 new->bridge = bridge;
257 new = bridge->driver->alloc_by_type(page_count, type);
259 new->bridge = bridge;
270 if (bridge->driver->agp_alloc_pages) {
271 if (bridge->driver->agp_alloc_pages(bridge, new, page_count)) {
275 new->bridge = bridge;
280 struct page *page = bridge->driver->agp_alloc_page(bridge);
289 new->bridge = bridge;
371 * agp_copy_info - copy bridge state information
375 * This function copies information about the agp bridge device and the state of
378 int agp_copy_info(struct agp_bridge_data *bridge, struct agp_kern_info *info)
381 if (!bridge) {
386 info->version.major = bridge->version->major;
387 info->version.minor = bridge->version->minor;
389 info->device = bridge->dev;
390 if (bridge->mode & AGPSTAT_MODE_3_0)
391 info->mode = bridge->mode & ~AGP3_RESERVED_MASK;
393 info->mode = bridge->mode & ~AGP2_RESERVED_MASK;
394 info->aper_base = bridge->gart_bus_addr;
396 info->max_memory = bridge->max_memory_agp;
397 info->current_memory = atomic_read(&bridge->current_memory_agp);
398 info->cant_use_aperture = bridge->driver->cant_use_aperture;
399 info->vm_ops = bridge->vm_ops;
434 curr->bridge->driver->cache_flush();
438 ret_val = curr->bridge->driver->insert_memory(curr, pg_start, curr->type);
474 ret_val = curr->bridge->driver->remove_memory(curr, curr->pg_start, curr->type);
481 spin_lock(&curr->bridge->mapped_lock);
483 spin_unlock(&curr->bridge->mapped_lock);
516 printk(KERN_INFO PFX "BIOS bug. AGP bridge claims to only support x4 rate. "
521 printk(KERN_INFO PFX "BIOS bug. AGP bridge claims to only support x2 rate. "
593 * bridge_agpstat = PCI_AGP_STATUS from agp bridge.
664 printk(KERN_INFO PFX "%s requested AGPx8 but bridge not capable.\n", current->comm);
673 /* All set, bridge & device can do AGP x8*/
686 * the graphics card, and the bridge can do x8, and use if so.
691 "supported by bridge & card (x8).\n");
697 printk(KERN_INFO PFX "bridge couldn't do x8. bridge_agpstat:%x (orig=%x)\n",
728 * @bridge: an agp_bridge_data struct allocated for the AGP host bridge.
730 * @bridge_agpstat: current agp_stat from AGP bridge.
733 * the requested mode to the capabilities of both the bridge and the card.
735 u32 agp_collect_device_status(struct agp_bridge_data *bridge, u32 requested_mode, u32 bridge_agpstat)
803 void get_agp_version(struct agp_bridge_data *bridge)
808 if (bridge->major_version != 0)
811 pci_read_config_dword(bridge->dev, bridge->capndx, &ncapid);
812 bridge->major_version = (ncapid >> AGP_MAJOR_VERSION_SHIFT) & 0xf;
813 bridge->minor_version = (ncapid >> AGP_MINOR_VERSION_SHIFT) & 0xf;
818 void agp_generic_enable(struct agp_bridge_data *bridge, u32 requested_mode)
824 dev_info(&agp_bridge->dev->dev, "AGP %d.%d bridge\n",
838 if (bridge->major_version >= 3) {
839 if (bridge->mode & AGPSTAT_MODE_3_0) {
841 if (bridge->minor_version >= 5)
842 agp_3_5_enable(bridge);
848 pci_read_config_dword(bridge->dev,
849 bridge->capndx+AGPCTRL, &temp);
851 pci_write_config_dword(bridge->dev,
852 bridge->capndx+AGPCTRL, temp);
854 dev_info(&bridge->dev->dev, "bridge is in legacy mode, falling back to 2.x\n");
864 int agp_generic_create_gatt_table(struct agp_bridge_data *bridge)
876 if (bridge->driver->size_type == LVL2_APER_SIZE)
880 i = bridge->aperture_size_idx;
881 temp = bridge->current_size;
884 if (bridge->driver->size_type != FIXED_APER_SIZE) {
886 switch (bridge->driver->size_type) {
916 switch (bridge->driver->size_type) {
918 bridge->current_size = A_IDX8(bridge);
921 bridge->current_size = A_IDX16(bridge);
924 bridge->current_size = A_IDX32(bridge);
932 temp = bridge->current_size;
934 bridge->aperture_size_idx = i;
936 } while (!table && (i < bridge->driver->num_aperture_sizes));
952 bridge->gatt_table_real = (u32 *) table;
955 bridge->driver->cache_flush();
960 bridge->gatt_table = (u32 __iomem *)table;
962 bridge->gatt_table = ioremap_nocache(virt_to_phys(table),
964 bridge->driver->cache_flush();
967 if (bridge->gatt_table == NULL) {
975 bridge->gatt_bus_addr = virt_to_phys(bridge->gatt_table_real);
979 writel(bridge->scratch_page, bridge->gatt_table+i);
980 readl(bridge->gatt_table+i); /* PCI Posting. */
987 int agp_generic_free_gatt_table(struct agp_bridge_data *bridge)
994 temp = bridge->current_size;
996 switch (bridge->driver->size_type) {
1022 set_memory_wb((unsigned long)bridge->gatt_table, 1 << page_order);
1024 iounmap(bridge->gatt_table);
1026 table = (char *) bridge->gatt_table_real;
1032 free_gatt_pages(bridge->gatt_table_real, page_order);
1035 bridge->gatt_table = NULL;
1036 bridge->gatt_table_real = NULL;
1037 bridge->gatt_bus_addr = 0;
1050 struct agp_bridge_data *bridge;
1053 bridge = mem->bridge;
1054 if (!bridge)
1060 temp = bridge->current_size;
1062 switch (bridge->driver->size_type) {
1089 mask_type = bridge->driver->agp_type_to_mask_type(bridge, type);
1102 if (!PGE_EMPTY(bridge, readl(bridge->gatt_table+j)))
1108 bridge->driver->cache_flush();
1113 writel(bridge->driver->mask_memory(bridge,
1116 bridge->gatt_table+j);
1118 readl(bridge->gatt_table+j-1); /* PCI Posting. */
1120 bridge->driver->tlb_flush(mem);
1129 struct agp_bridge_data *bridge;
1132 bridge = mem->bridge;
1133 if (!bridge)
1147 mask_type = bridge->driver->agp_type_to_mask_type(bridge, type);
1155 writel(bridge->scratch_page, bridge->gatt_table+i);
1157 readl(bridge->gatt_table+i-1); /* PCI Posting. */
1159 bridge->driver->tlb_flush(mem);
1206 int agp_generic_alloc_pages(struct agp_bridge_data *bridge, struct agp_memory *mem, size_t num_pages)
1236 struct page *agp_generic_alloc_page(struct agp_bridge_data *bridge)
1302 void agp_enable(struct agp_bridge_data *bridge, u32 mode)
1304 if (!bridge)
1306 bridge->driver->agp_enable(bridge, mode);
1334 unsigned long agp_generic_mask_memory(struct agp_bridge_data *bridge,
1338 if (bridge->driver->masks)
1339 return addr | bridge->driver->masks[0].mask;
1345 int agp_generic_type_to_mask_type(struct agp_bridge_data *bridge,