Lines Matching refs:bridge

178 		curr->bridge->driver->free_by_type(curr);
182 if (curr->bridge->driver->agp_destroy_pages) {
183 curr->bridge->driver->agp_destroy_pages(curr);
187 curr->bridge->driver->agp_destroy_page(
192 curr->bridge->driver->agp_destroy_page(
209 * @bridge: an agp_bridge_data struct allocated for the AGP host bridge.
213 * Every agp bridge device will allow you to allocate AGP_NORMAL_MEMORY which
218 struct agp_memory *agp_allocate_memory(struct agp_bridge_data *bridge,
226 if (!bridge)
229 cur_memory = atomic_read(&bridge->current_memory_agp);
230 if ((cur_memory + page_count > bridge->max_memory_agp) ||
237 new->bridge = bridge;
242 new = bridge->driver->alloc_by_type(page_count, type);
244 new->bridge = bridge;
255 if (bridge->driver->agp_alloc_pages) {
256 if (bridge->driver->agp_alloc_pages(bridge, new, page_count)) {
260 new->bridge = bridge;
265 struct page *page = bridge->driver->agp_alloc_page(bridge);
274 new->bridge = bridge;
356 * agp_copy_info - copy bridge state information
358 * @bridge: an agp_bridge_data struct allocated for the AGP host bridge.
361 * This function copies information about the agp bridge device and the state of
364 int agp_copy_info(struct agp_bridge_data *bridge, struct agp_kern_info *info)
367 if (!bridge) {
372 info->version.major = bridge->version->major;
373 info->version.minor = bridge->version->minor;
375 info->device = bridge->dev;
376 if (bridge->mode & AGPSTAT_MODE_3_0)
377 info->mode = bridge->mode & ~AGP3_RESERVED_MASK;
379 info->mode = bridge->mode & ~AGP2_RESERVED_MASK;
380 info->aper_base = bridge->gart_bus_addr;
382 info->max_memory = bridge->max_memory_agp;
383 info->current_memory = atomic_read(&bridge->current_memory_agp);
384 info->cant_use_aperture = bridge->driver->cant_use_aperture;
385 info->vm_ops = bridge->vm_ops;
420 curr->bridge->driver->cache_flush();
424 ret_val = curr->bridge->driver->insert_memory(curr, pg_start, curr->type);
460 ret_val = curr->bridge->driver->remove_memory(curr, curr->pg_start, curr->type);
467 spin_lock(&curr->bridge->mapped_lock);
469 spin_unlock(&curr->bridge->mapped_lock);
502 printk(KERN_INFO PFX "BIOS bug. AGP bridge claims to only support x4 rate. "
507 printk(KERN_INFO PFX "BIOS bug. AGP bridge claims to only support x2 rate. "
579 * bridge_agpstat = PCI_AGP_STATUS from agp bridge.
650 printk(KERN_INFO PFX "%s requested AGPx8 but bridge not capable.\n", current->comm);
659 /* All set, bridge & device can do AGP x8*/
672 * the graphics card, and the bridge can do x8, and use if so.
677 "supported by bridge & card (x8).\n");
683 printk(KERN_INFO PFX "bridge couldn't do x8. bridge_agpstat:%x (orig=%x)\n",
714 * @bridge: an agp_bridge_data struct allocated for the AGP host bridge.
716 * @bridge_agpstat: current agp_stat from AGP bridge.
719 * the requested mode to the capabilities of both the bridge and the card.
721 u32 agp_collect_device_status(struct agp_bridge_data *bridge, u32 requested_mode, u32 bridge_agpstat)
789 void get_agp_version(struct agp_bridge_data *bridge)
794 if (bridge->major_version != 0)
797 pci_read_config_dword(bridge->dev, bridge->capndx, &ncapid);
798 bridge->major_version = (ncapid >> AGP_MAJOR_VERSION_SHIFT) & 0xf;
799 bridge->minor_version = (ncapid >> AGP_MINOR_VERSION_SHIFT) & 0xf;
804 void agp_generic_enable(struct agp_bridge_data *bridge, u32 requested_mode)
810 dev_info(&agp_bridge->dev->dev, "AGP %d.%d bridge\n",
824 if (bridge->major_version >= 3) {
825 if (bridge->mode & AGPSTAT_MODE_3_0) {
827 if (bridge->minor_version >= 5)
828 agp_3_5_enable(bridge);
834 pci_read_config_dword(bridge->dev,
835 bridge->capndx+AGPCTRL, &temp);
837 pci_write_config_dword(bridge->dev,
838 bridge->capndx+AGPCTRL, temp);
840 dev_info(&bridge->dev->dev, "bridge is in legacy mode, falling back to 2.x\n");
850 int agp_generic_create_gatt_table(struct agp_bridge_data *bridge)
861 if (bridge->driver->size_type == LVL2_APER_SIZE)
865 i = bridge->aperture_size_idx;
866 temp = bridge->current_size;
869 if (bridge->driver->size_type != FIXED_APER_SIZE) {
871 switch (bridge->driver->size_type) {
898 switch (bridge->driver->size_type) {
900 bridge->current_size = A_IDX8(bridge);
903 bridge->current_size = A_IDX16(bridge);
906 bridge->current_size = A_IDX32(bridge);
914 temp = bridge->current_size;
916 bridge->aperture_size_idx = i;
918 } while (!table && (i < bridge->driver->num_aperture_sizes));
933 bridge->gatt_table_real = (u32 *) table;
936 bridge->driver->cache_flush();
941 bridge->gatt_table = (u32 __iomem *)table;
943 bridge->gatt_table = ioremap(virt_to_phys(table),
945 bridge->driver->cache_flush();
948 if (bridge->gatt_table == NULL) {
956 bridge->gatt_bus_addr = virt_to_phys(bridge->gatt_table_real);
960 writel(bridge->scratch_page, bridge->gatt_table+i);
961 readl(bridge->gatt_table+i); /* PCI Posting. */
968 int agp_generic_free_gatt_table(struct agp_bridge_data *bridge)
975 temp = bridge->current_size;
977 switch (bridge->driver->size_type) {
1003 set_memory_wb((unsigned long)bridge->gatt_table, 1 << page_order);
1005 iounmap(bridge->gatt_table);
1007 table = (char *) bridge->gatt_table_real;
1013 free_gatt_pages(bridge->gatt_table_real, page_order);
1016 bridge->gatt_table = NULL;
1017 bridge->gatt_table_real = NULL;
1018 bridge->gatt_bus_addr = 0;
1031 struct agp_bridge_data *bridge;
1034 bridge = mem->bridge;
1035 if (!bridge)
1041 temp = bridge->current_size;
1043 switch (bridge->driver->size_type) {
1070 mask_type = bridge->driver->agp_type_to_mask_type(bridge, type);
1083 if (!PGE_EMPTY(bridge, readl(bridge->gatt_table+j)))
1089 bridge->driver->cache_flush();
1094 writel(bridge->driver->mask_memory(bridge,
1097 bridge->gatt_table+j);
1099 readl(bridge->gatt_table+j-1); /* PCI Posting. */
1101 bridge->driver->tlb_flush(mem);
1110 struct agp_bridge_data *bridge;
1113 bridge = mem->bridge;
1114 if (!bridge)
1128 mask_type = bridge->driver->agp_type_to_mask_type(bridge, type);
1136 writel(bridge->scratch_page, bridge->gatt_table+i);
1138 readl(bridge->gatt_table+i-1); /* PCI Posting. */
1140 bridge->driver->tlb_flush(mem);
1187 int agp_generic_alloc_pages(struct agp_bridge_data *bridge, struct agp_memory *mem, size_t num_pages)
1217 struct page *agp_generic_alloc_page(struct agp_bridge_data *bridge)
1281 * @bridge: an agp_bridge_data struct allocated for the AGP host bridge.
1284 void agp_enable(struct agp_bridge_data *bridge, u32 mode)
1286 if (!bridge)
1288 bridge->driver->agp_enable(bridge, mode);
1315 unsigned long agp_generic_mask_memory(struct agp_bridge_data *bridge,
1319 if (bridge->driver->masks)
1320 return addr | bridge->driver->masks[0].mask;
1326 int agp_generic_type_to_mask_type(struct agp_bridge_data *bridge,