Merge branch 'agp-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/agp-2.6

* 'agp-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/agp-2.6:
agp: fix SIS 5591/5592 wrong PCI id
intel/agp: rewrite GTT on resume
agp: use dev_printk when possible
amd64-agp: run fallback when no bridges found, not when driver registration fails
intel_agp: official name for GM45 chipset

+205 -144
+3
drivers/char/agp/agp.h
··· 148 char minor_version; 149 struct list_head list; 150 u32 apbase_config; 151 }; 152 153 #define KB(x) ((x) * 1024)
··· 148 char minor_version; 149 struct list_head list; 150 u32 apbase_config; 151 + /* list of agp_memory mapped to the aperture */ 152 + struct list_head mapped_list; 153 + spinlock_t mapped_lock; 154 }; 155 156 #define KB(x) ((x) * 1024)
+5 -5
drivers/char/agp/ali-agp.c
··· 110 111 nlvm_addr+= agp_bridge->gart_bus_addr; 112 nlvm_addr|=(agp_bridge->gart_bus_addr>>12); 113 - printk(KERN_INFO PFX "nlvm top &base = %8x\n",nlvm_addr); 114 } 115 #endif 116 ··· 316 goto found; 317 } 318 319 - printk(KERN_ERR PFX "Unsupported ALi chipset (device id: %04x)\n", 320 - pdev->device); 321 return -ENODEV; 322 323 ··· 362 bridge->driver = &ali_generic_bridge; 363 } 364 365 - printk(KERN_INFO PFX "Detected ALi %s chipset\n", 366 - devs[j].chipset_name); 367 368 /* Fill in the mode register */ 369 pci_read_config_dword(pdev,
··· 110 111 nlvm_addr+= agp_bridge->gart_bus_addr; 112 nlvm_addr|=(agp_bridge->gart_bus_addr>>12); 113 + dev_info(&agp_bridge->dev->dev, "nlvm top &base = %8x\n", 114 + nlvm_addr); 115 } 116 #endif 117 ··· 315 goto found; 316 } 317 318 + dev_err(&pdev->dev, "unsupported ALi chipset [%04x/%04x])\n", 319 + pdev->vendor, pdev->device); 320 return -ENODEV; 321 322 ··· 361 bridge->driver = &ali_generic_bridge; 362 } 363 364 + dev_info(&pdev->dev, "ALi %s chipset\n", devs[j].chipset_name); 365 366 /* Fill in the mode register */ 367 pci_read_config_dword(pdev,
+5 -5
drivers/char/agp/amd-k7-agp.c
··· 419 return -ENODEV; 420 421 j = ent - agp_amdk7_pci_table; 422 - printk(KERN_INFO PFX "Detected AMD %s chipset\n", 423 - amd_agp_device_ids[j].chipset_name); 424 425 bridge = agp_alloc_bridge(); 426 if (!bridge) ··· 442 while (!cap_ptr) { 443 gfxcard = pci_get_class(PCI_CLASS_DISPLAY_VGA<<8, gfxcard); 444 if (!gfxcard) { 445 - printk (KERN_INFO PFX "Couldn't find an AGP VGA controller.\n"); 446 return -ENODEV; 447 } 448 cap_ptr = pci_find_capability(gfxcard, PCI_CAP_ID_AGP); ··· 453 (if necessary at all). */ 454 if (gfxcard->vendor == PCI_VENDOR_ID_NVIDIA) { 455 agp_bridge->flags |= AGP_ERRATA_1X; 456 - printk (KERN_INFO PFX "AMD 751 chipset with NVidia GeForce detected. Forcing to 1X due to errata.\n"); 457 } 458 pci_dev_put(gfxcard); 459 } ··· 469 agp_bridge->flags = AGP_ERRATA_FASTWRITES; 470 agp_bridge->flags |= AGP_ERRATA_SBA; 471 agp_bridge->flags |= AGP_ERRATA_1X; 472 - printk (KERN_INFO PFX "AMD 761 chipset with errata detected - disabling AGP fast writes & SBA and forcing to 1X.\n"); 473 } 474 } 475
··· 419 return -ENODEV; 420 421 j = ent - agp_amdk7_pci_table; 422 + dev_info(&pdev->dev, "AMD %s chipset\n", 423 + amd_agp_device_ids[j].chipset_name); 424 425 bridge = agp_alloc_bridge(); 426 if (!bridge) ··· 442 while (!cap_ptr) { 443 gfxcard = pci_get_class(PCI_CLASS_DISPLAY_VGA<<8, gfxcard); 444 if (!gfxcard) { 445 + dev_info(&pdev->dev, "no AGP VGA controller\n"); 446 return -ENODEV; 447 } 448 cap_ptr = pci_find_capability(gfxcard, PCI_CAP_ID_AGP); ··· 453 (if necessary at all). */ 454 if (gfxcard->vendor == PCI_VENDOR_ID_NVIDIA) { 455 agp_bridge->flags |= AGP_ERRATA_1X; 456 + dev_info(&pdev->dev, "AMD 751 chipset with NVidia GeForce; forcing 1X due to errata\n"); 457 } 458 pci_dev_put(gfxcard); 459 } ··· 469 agp_bridge->flags = AGP_ERRATA_FASTWRITES; 470 agp_bridge->flags |= AGP_ERRATA_SBA; 471 agp_bridge->flags |= AGP_ERRATA_1X; 472 + dev_info(&pdev->dev, "AMD 761 chipset with errata; disabling AGP fast writes & SBA and forcing to 1X\n"); 473 } 474 } 475
+31 -20
drivers/char/agp/amd64-agp.c
··· 34 35 static struct resource *aperture_resource; 36 static int __initdata agp_try_unsupported = 1; 37 38 static void amd64_tlbflush(struct agp_memory *temp) 39 { ··· 294 * so let double check that order, and lets trust the AMD NB settings 295 */ 296 if (order >=0 && aper + (32ULL<<(20 + order)) > 0x100000000ULL) { 297 - printk(KERN_INFO "Aperture size %u MB is not right, using settings from NB\n", 298 - 32 << order); 299 order = nb_order; 300 } 301 302 - printk(KERN_INFO PFX "Aperture from AGP @ %Lx size %u MB\n", aper, 32 << order); 303 if (order < 0 || !agp_aperture_valid(aper, (32*1024*1024)<<order)) 304 return -1; 305 ··· 321 for (i = 0; i < num_k8_northbridges; i++) { 322 struct pci_dev *dev = k8_northbridges[i]; 323 if (fix_northbridge(dev, pdev, cap_ptr) < 0) { 324 - printk(KERN_ERR PFX "No usable aperture found.\n"); 325 #ifdef __x86_64__ 326 /* should port this to i386 */ 327 - printk(KERN_ERR PFX "Consider rebooting with iommu=memaper=2 to get a good aperture.\n"); 328 #endif 329 return -1; 330 } ··· 347 default: revstring="??"; break; 348 } 349 350 - printk (KERN_INFO PFX "Detected AMD 8151 AGP Bridge rev %s\n", revstring); 351 352 /* 353 * Work around errata. 354 * Chips before B2 stepping incorrectly reporting v3.5 355 */ 356 if (pdev->revision < 0x13) { 357 - printk (KERN_INFO PFX "Correcting AGP revision (reports 3.5, is really 3.0)\n"); 358 bridge->major_version = 3; 359 bridge->minor_version = 0; 360 } ··· 377 struct pci_dev *dev1; 378 int i; 379 unsigned size = amd64_fetch_size(); 380 - printk(KERN_INFO "Setting up ULi AGP.\n"); 381 dev1 = pci_get_slot (pdev->bus,PCI_DEVFN(0,0)); 382 if (dev1 == NULL) { 383 - printk(KERN_INFO PFX "Detected a ULi chipset, " 384 - "but could not fine the secondary device.\n"); 385 return -ENODEV; 386 } 387 ··· 390 break; 391 392 if (i == ARRAY_SIZE(uli_sizes)) { 393 - printk(KERN_INFO PFX "No ULi size found for %d\n", size); 394 return -ENODEV; 395 } 396 ··· 435 int i; 436 unsigned size = amd64_fetch_size(); 437 438 - printk(KERN_INFO PFX "Setting up Nforce3 AGP.\n"); 439 440 dev1 = pci_get_slot(pdev->bus, PCI_DEVFN(11, 0)); 441 if (dev1 == NULL) { 442 - printk(KERN_INFO PFX "agpgart: Detected an NVIDIA " 443 - "nForce3 chipset, but could not find " 444 - "the secondary device.\n"); 445 return -ENODEV; 446 } 447 ··· 448 break; 449 450 if (i == ARRAY_SIZE(nforce3_sizes)) { 451 - printk(KERN_INFO PFX "No NForce3 size found for %d\n", size); 452 return -ENODEV; 453 } 454 ··· 462 463 /* if x86-64 aperture base is beyond 4G, exit here */ 464 if ( (apbase & 0x7fff) >> (32 - 25) ) { 465 - printk(KERN_INFO PFX "aperture base > 4G\n"); 466 return -ENODEV; 467 } 468 ··· 489 { 490 struct agp_bridge_data *bridge; 491 u8 cap_ptr; 492 493 cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP); 494 if (!cap_ptr) ··· 505 pdev->device == PCI_DEVICE_ID_AMD_8151_0) { 506 amd8151_init(pdev, bridge); 507 } else { 508 - printk(KERN_INFO PFX "Detected AGP bridge %x\n", pdev->devfn); 509 } 510 511 bridge->driver = &amd_8151_driver; ··· 538 } 539 540 pci_set_drvdata(pdev, bridge); 541 - return agp_add_bridge(bridge); 542 } 543 544 static void __devexit agp_amd64_remove(struct pci_dev *pdev) ··· 720 721 if (agp_off) 722 return -EINVAL; 723 - if (pci_register_driver(&agp_amd64_pci_driver) < 0) { 724 struct pci_dev *dev; 725 if (!agp_try_unsupported && !agp_try_unsupported_boot) { 726 printk(KERN_INFO PFX "No supported AGP bridge found.\n");
··· 34 35 static struct resource *aperture_resource; 36 static int __initdata agp_try_unsupported = 1; 37 + static int agp_bridges_found; 38 39 static void amd64_tlbflush(struct agp_memory *temp) 40 { ··· 293 * so let double check that order, and lets trust the AMD NB settings 294 */ 295 if (order >=0 && aper + (32ULL<<(20 + order)) > 0x100000000ULL) { 296 + dev_info(&agp->dev, "aperture size %u MB is not right, using settings from NB\n", 297 + 32 << order); 298 order = nb_order; 299 } 300 301 + dev_info(&agp->dev, "aperture from AGP @ %Lx size %u MB\n", 302 + aper, 32 << order); 303 if (order < 0 || !agp_aperture_valid(aper, (32*1024*1024)<<order)) 304 return -1; 305 ··· 319 for (i = 0; i < num_k8_northbridges; i++) { 320 struct pci_dev *dev = k8_northbridges[i]; 321 if (fix_northbridge(dev, pdev, cap_ptr) < 0) { 322 + dev_err(&dev->dev, "no usable aperture found\n"); 323 #ifdef __x86_64__ 324 /* should port this to i386 */ 325 + dev_err(&dev->dev, "consider rebooting with iommu=memaper=2 to get a good aperture\n"); 326 #endif 327 return -1; 328 } ··· 345 default: revstring="??"; break; 346 } 347 348 + dev_info(&pdev->dev, "AMD 8151 AGP Bridge rev %s\n", revstring); 349 350 /* 351 * Work around errata. 352 * Chips before B2 stepping incorrectly reporting v3.5 353 */ 354 if (pdev->revision < 0x13) { 355 + dev_info(&pdev->dev, "correcting AGP revision (reports 3.5, is really 3.0)\n"); 356 bridge->major_version = 3; 357 bridge->minor_version = 0; 358 } ··· 375 struct pci_dev *dev1; 376 int i; 377 unsigned size = amd64_fetch_size(); 378 + 379 + dev_info(&pdev->dev, "setting up ULi AGP\n"); 380 dev1 = pci_get_slot (pdev->bus,PCI_DEVFN(0,0)); 381 if (dev1 == NULL) { 382 + dev_info(&pdev->dev, "can't find ULi secondary device\n"); 383 return -ENODEV; 384 } 385 ··· 388 break; 389 390 if (i == ARRAY_SIZE(uli_sizes)) { 391 + dev_info(&pdev->dev, "no ULi size found for %d\n", size); 392 return -ENODEV; 393 } 394 ··· 433 int i; 434 unsigned size = amd64_fetch_size(); 435 436 + dev_info(&pdev->dev, "setting up Nforce3 AGP\n"); 437 438 dev1 = pci_get_slot(pdev->bus, PCI_DEVFN(11, 0)); 439 if (dev1 == NULL) { 440 + dev_info(&pdev->dev, "can't find Nforce3 secondary device\n"); 441 return -ENODEV; 442 } 443 ··· 448 break; 449 450 if (i == ARRAY_SIZE(nforce3_sizes)) { 451 + dev_info(&pdev->dev, "no NForce3 size found for %d\n", size); 452 return -ENODEV; 453 } 454 ··· 462 463 /* if x86-64 aperture base is beyond 4G, exit here */ 464 if ( (apbase & 0x7fff) >> (32 - 25) ) { 465 + dev_info(&pdev->dev, "aperture base > 4G\n"); 466 return -ENODEV; 467 } 468 ··· 489 { 490 struct agp_bridge_data *bridge; 491 u8 cap_ptr; 492 + int err; 493 494 cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP); 495 if (!cap_ptr) ··· 504 pdev->device == PCI_DEVICE_ID_AMD_8151_0) { 505 amd8151_init(pdev, bridge); 506 } else { 507 + dev_info(&pdev->dev, "AGP bridge [%04x/%04x]\n", 508 + pdev->vendor, pdev->device); 509 } 510 511 bridge->driver = &amd_8151_driver; ··· 536 } 537 538 pci_set_drvdata(pdev, bridge); 539 + err = agp_add_bridge(bridge); 540 + if (err < 0) 541 + return err; 542 + 543 + agp_bridges_found++; 544 + return 0; 545 } 546 547 static void __devexit agp_amd64_remove(struct pci_dev *pdev) ··· 713 714 if (agp_off) 715 return -EINVAL; 716 + err = pci_register_driver(&agp_amd64_pci_driver); 717 + if (err < 0) 718 + return err; 719 + 720 + if (agp_bridges_found == 0) { 721 struct pci_dev *dev; 722 if (!agp_try_unsupported && !agp_try_unsupported_boot) { 723 printk(KERN_INFO PFX "No supported AGP bridge found.\n");
+3 -4
drivers/char/agp/ati-agp.c
··· 486 goto found; 487 } 488 489 - printk(KERN_ERR PFX 490 - "Unsupported Ati chipset (device id: %04x)\n", pdev->device); 491 return -ENODEV; 492 493 found: ··· 500 501 bridge->driver = &ati_generic_bridge; 502 503 - printk(KERN_INFO PFX "Detected Ati %s chipset\n", 504 - devs[j].chipset_name); 505 506 /* Fill in the mode register */ 507 pci_read_config_dword(pdev,
··· 486 goto found; 487 } 488 489 + dev_err(&pdev->dev, "unsupported Ati chipset [%04x/%04x])\n", 490 + pdev->vendor, pdev->device); 491 return -ENODEV; 492 493 found: ··· 500 501 bridge->driver = &ati_generic_bridge; 502 503 + dev_info(&pdev->dev, "Ati %s chipset\n", devs[j].chipset_name); 504 505 /* Fill in the mode register */ 506 pci_read_config_dword(pdev,
+17 -11
drivers/char/agp/backend.c
··· 144 void *addr = bridge->driver->agp_alloc_page(bridge); 145 146 if (!addr) { 147 - printk(KERN_ERR PFX "unable to get memory for scratch page.\n"); 148 return -ENOMEM; 149 } 150 ··· 156 157 size_value = bridge->driver->fetch_size(); 158 if (size_value == 0) { 159 - printk(KERN_ERR PFX "unable to determine aperture size.\n"); 160 rc = -EINVAL; 161 goto err_out; 162 } 163 if (bridge->driver->create_gatt_table(bridge)) { 164 - printk(KERN_ERR PFX 165 - "unable to get memory for graphics translation table.\n"); 166 rc = -ENOMEM; 167 goto err_out; 168 } ··· 170 171 bridge->key_list = vmalloc(PAGE_SIZE * 4); 172 if (bridge->key_list == NULL) { 173 - printk(KERN_ERR PFX "error allocating memory for key lists.\n"); 174 rc = -ENOMEM; 175 goto err_out; 176 } ··· 181 memset(bridge->key_list, 0, PAGE_SIZE * 4); 182 183 if (bridge->driver->configure()) { 184 - printk(KERN_ERR PFX "error configuring host chipset.\n"); 185 rc = -EINVAL; 186 goto err_out; 187 } 188 189 return 0; 190 ··· 273 274 /* Grab reference on the chipset driver. */ 275 if (!try_module_get(bridge->driver->owner)) { 276 - printk (KERN_INFO PFX "Couldn't lock chipset driver.\n"); 277 return -EINVAL; 278 } 279 280 error = agp_backend_initialize(bridge); 281 if (error) { 282 - printk (KERN_INFO PFX "agp_backend_initialize() failed.\n"); 283 goto err_out; 284 } 285 286 if (list_empty(&agp_bridges)) { 287 error = agp_frontend_initialize(); 288 if (error) { 289 - printk (KERN_INFO PFX "agp_frontend_initialize() failed.\n"); 290 goto frontend_err; 291 } 292 293 - printk(KERN_INFO PFX "AGP aperture is %dM @ 0x%lx\n", 294 - bridge->driver->fetch_size(), bridge->gart_bus_addr); 295 296 } 297
··· 144 void *addr = bridge->driver->agp_alloc_page(bridge); 145 146 if (!addr) { 147 + dev_err(&bridge->dev->dev, 148 + "can't get memory for scratch page\n"); 149 return -ENOMEM; 150 } 151 ··· 155 156 size_value = bridge->driver->fetch_size(); 157 if (size_value == 0) { 158 + dev_err(&bridge->dev->dev, "can't determine aperture size\n"); 159 rc = -EINVAL; 160 goto err_out; 161 } 162 if (bridge->driver->create_gatt_table(bridge)) { 163 + dev_err(&bridge->dev->dev, 164 + "can't get memory for graphics translation table\n"); 165 rc = -ENOMEM; 166 goto err_out; 167 } ··· 169 170 bridge->key_list = vmalloc(PAGE_SIZE * 4); 171 if (bridge->key_list == NULL) { 172 + dev_err(&bridge->dev->dev, 173 + "can't allocate memory for key lists\n"); 174 rc = -ENOMEM; 175 goto err_out; 176 } ··· 179 memset(bridge->key_list, 0, PAGE_SIZE * 4); 180 181 if (bridge->driver->configure()) { 182 + dev_err(&bridge->dev->dev, "error configuring host chipset\n"); 183 rc = -EINVAL; 184 goto err_out; 185 } 186 + INIT_LIST_HEAD(&bridge->mapped_list); 187 + spin_lock_init(&bridge->mapped_lock); 188 189 return 0; 190 ··· 269 270 /* Grab reference on the chipset driver. */ 271 if (!try_module_get(bridge->driver->owner)) { 272 + dev_info(&bridge->dev->dev, "can't lock chipset driver\n"); 273 return -EINVAL; 274 } 275 276 error = agp_backend_initialize(bridge); 277 if (error) { 278 + dev_info(&bridge->dev->dev, 279 + "agp_backend_initialize() failed\n"); 280 goto err_out; 281 } 282 283 if (list_empty(&agp_bridges)) { 284 error = agp_frontend_initialize(); 285 if (error) { 286 + dev_info(&bridge->dev->dev, 287 + "agp_frontend_initialize() failed\n"); 288 goto frontend_err; 289 } 290 291 + dev_info(&bridge->dev->dev, "AGP aperture is %dM @ 0x%lx\n", 292 + bridge->driver->fetch_size(), bridge->gart_bus_addr); 293 294 } 295
+33 -8
drivers/char/agp/generic.c
··· 429 430 curr->is_bound = true; 431 curr->pg_start = pg_start; 432 return 0; 433 } 434 EXPORT_SYMBOL(agp_bind_memory); ··· 465 466 curr->is_bound = false; 467 curr->pg_start = 0; 468 return 0; 469 } 470 EXPORT_SYMBOL(agp_unbind_memory); 471 472 /* End - Routines for handling swapping of agp_memory into the GATT */ 473 ··· 799 if (!agp) 800 continue; 801 802 - printk(KERN_INFO PFX "Putting AGP V%d device at %s into %dx mode\n", 803 - agp_v3 ? 3 : 2, pci_name(device), mode); 804 pci_write_config_dword(device, agp + PCI_AGP_COMMAND, bridge_agpstat); 805 } 806 } ··· 828 829 get_agp_version(agp_bridge); 830 831 - printk(KERN_INFO PFX "Found an AGP %d.%d compliant device at %s.\n", 832 - agp_bridge->major_version, 833 - agp_bridge->minor_version, 834 - pci_name(agp_bridge->dev)); 835 836 pci_read_config_dword(agp_bridge->dev, 837 agp_bridge->capndx + PCI_AGP_STATUS, &bridge_agpstat); ··· 858 pci_write_config_dword(bridge->dev, 859 bridge->capndx+AGPCTRL, temp); 860 861 - printk(KERN_INFO PFX "Device is in legacy mode," 862 - " falling back to 2.x\n"); 863 } 864 } 865
··· 429 430 curr->is_bound = true; 431 curr->pg_start = pg_start; 432 + spin_lock(&agp_bridge->mapped_lock); 433 + list_add(&curr->mapped_list, &agp_bridge->mapped_list); 434 + spin_unlock(&agp_bridge->mapped_lock); 435 + 436 return 0; 437 } 438 EXPORT_SYMBOL(agp_bind_memory); ··· 461 462 curr->is_bound = false; 463 curr->pg_start = 0; 464 + spin_lock(&curr->bridge->mapped_lock); 465 + list_del(&curr->mapped_list); 466 + spin_unlock(&curr->bridge->mapped_lock); 467 return 0; 468 } 469 EXPORT_SYMBOL(agp_unbind_memory); 470 + 471 + /** 472 + * agp_rebind_emmory - Rewrite the entire GATT, useful on resume 473 + */ 474 + int agp_rebind_memory(void) 475 + { 476 + struct agp_memory *curr; 477 + int ret_val = 0; 478 + 479 + spin_lock(&agp_bridge->mapped_lock); 480 + list_for_each_entry(curr, &agp_bridge->mapped_list, mapped_list) { 481 + ret_val = curr->bridge->driver->insert_memory(curr, 482 + curr->pg_start, 483 + curr->type); 484 + if (ret_val != 0) 485 + break; 486 + } 487 + spin_unlock(&agp_bridge->mapped_lock); 488 + return ret_val; 489 + } 490 + EXPORT_SYMBOL(agp_rebind_memory); 491 492 /* End - Routines for handling swapping of agp_memory into the GATT */ 493 ··· 771 if (!agp) 772 continue; 773 774 + dev_info(&device->dev, "putting AGP V%d device into %dx mode\n", 775 + agp_v3 ? 3 : 2, mode); 776 pci_write_config_dword(device, agp + PCI_AGP_COMMAND, bridge_agpstat); 777 } 778 } ··· 800 801 get_agp_version(agp_bridge); 802 803 + dev_info(&agp_bridge->dev->dev, "AGP %d.%d bridge\n", 804 + agp_bridge->major_version, agp_bridge->minor_version); 805 806 pci_read_config_dword(agp_bridge->dev, 807 agp_bridge->capndx + PCI_AGP_STATUS, &bridge_agpstat); ··· 832 pci_write_config_dword(bridge->dev, 833 bridge->capndx+AGPCTRL, temp); 834 835 + dev_info(&bridge->dev->dev, "bridge is in legacy mode, falling back to 2.x\n"); 836 } 837 } 838
+47 -36
drivers/char/agp/intel-agp.c
··· 32 #define PCI_DEVICE_ID_INTEL_Q35_IG 0x29B2 33 #define PCI_DEVICE_ID_INTEL_Q33_HB 0x29D0 34 #define PCI_DEVICE_ID_INTEL_Q33_IG 0x29D2 35 - #define PCI_DEVICE_ID_INTEL_IGD_HB 0x2A40 36 - #define PCI_DEVICE_ID_INTEL_IGD_IG 0x2A42 37 #define PCI_DEVICE_ID_INTEL_IGD_E_HB 0x2E00 38 #define PCI_DEVICE_ID_INTEL_IGD_E_IG 0x2E02 39 #define PCI_DEVICE_ID_INTEL_Q45_HB 0x2E10 ··· 55 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965G_HB || \ 56 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965GM_HB || \ 57 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965GME_HB || \ 58 - agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IGD_HB) 59 60 #define IS_G33 (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_G33_HB || \ 61 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_Q35_HB || \ ··· 161 values = A_SIZE_FIX(agp_bridge->driver->aperture_sizes); 162 163 if ((smram_miscc & I810_GMS) == I810_GMS_DISABLE) { 164 - printk(KERN_WARNING PFX "i810 is disabled\n"); 165 return 0; 166 } 167 if ((smram_miscc & I810_GFX_MEM_WIN_SIZE) == I810_GFX_MEM_WIN_32M) { ··· 193 194 intel_private.registers = ioremap(temp, 128 * 4096); 195 if (!intel_private.registers) { 196 - printk(KERN_ERR PFX "Unable to remap memory.\n"); 197 return -ENOMEM; 198 } 199 } ··· 202 if ((readl(intel_private.registers+I810_DRAM_CTL) 203 & I810_DRAM_ROW_0) == I810_DRAM_ROW_0_SDRAM) { 204 /* This will need to be dynamically assigned */ 205 - printk(KERN_INFO PFX "detected 4MB dedicated video ram.\n"); 206 intel_private.num_dcache_entries = 1024; 207 } 208 pci_read_config_dword(intel_private.pcidev, I810_GMADDR, &temp); ··· 502 size = 1024 + 512; 503 break; 504 default: 505 - printk(KERN_INFO PFX "Unknown page table size, " 506 - "assuming 512KB\n"); 507 size = 512; 508 } 509 size += 4; /* add in BIOS popup space */ ··· 517 size = 2048; 518 break; 519 default: 520 - printk(KERN_INFO PFX "Unknown page table size 0x%x, " 521 - "assuming 512KB\n", 522 (gmch_ctrl & G33_PGETBL_SIZE_MASK)); 523 size = 512; 524 } ··· 629 } 630 } 631 if (gtt_entries > 0) 632 - printk(KERN_INFO PFX "Detected %dK %s memory.\n", 633 gtt_entries / KB(1), local ? "local" : "stolen"); 634 else 635 - printk(KERN_INFO PFX 636 - "No pre-allocated video memory detected.\n"); 637 gtt_entries /= KB(4); 638 639 intel_private.gtt_entries = gtt_entries; ··· 803 num_entries = A_SIZE_FIX(temp)->num_entries; 804 805 if (pg_start < intel_private.gtt_entries) { 806 - printk(KERN_DEBUG PFX "pg_start == 0x%.8lx,intel_private.gtt_entries == 0x%.8x\n", 807 - pg_start, intel_private.gtt_entries); 808 809 - printk(KERN_INFO PFX "Trying to insert into local/stolen memory\n"); 810 goto out_err; 811 } 812 ··· 855 return 0; 856 857 if (pg_start < intel_private.gtt_entries) { 858 - printk(KERN_INFO PFX "Trying to disable local/stolen memory\n"); 859 return -EINVAL; 860 } 861 ··· 962 if (intel_private.ifp_resource.start) { 963 intel_private.i9xx_flush_page = ioremap_nocache(intel_private.ifp_resource.start, PAGE_SIZE); 964 if (!intel_private.i9xx_flush_page) 965 - printk(KERN_INFO "unable to ioremap flush page - no chipset flushing"); 966 } 967 } 968 ··· 1033 num_entries = A_SIZE_FIX(temp)->num_entries; 1034 1035 if (pg_start < intel_private.gtt_entries) { 1036 - printk(KERN_DEBUG PFX "pg_start == 0x%.8lx,intel_private.gtt_entries == 0x%.8x\n", 1037 - pg_start, intel_private.gtt_entries); 1038 1039 - printk(KERN_INFO PFX "Trying to insert into local/stolen memory\n"); 1040 goto out_err; 1041 } 1042 ··· 1085 return 0; 1086 1087 if (pg_start < intel_private.gtt_entries) { 1088 - printk(KERN_INFO PFX "Trying to disable local/stolen memory\n"); 1089 return -EINVAL; 1090 } 1091 ··· 1190 static void intel_i965_get_gtt_range(int *gtt_offset, int *gtt_size) 1191 { 1192 switch (agp_bridge->dev->device) { 1193 - case PCI_DEVICE_ID_INTEL_IGD_HB: 1194 case PCI_DEVICE_ID_INTEL_IGD_E_HB: 1195 case PCI_DEVICE_ID_INTEL_Q45_HB: 1196 case PCI_DEVICE_ID_INTEL_G45_HB: ··· 1387 /* the Intel 815 chipset spec. says that bits 29-31 in the 1388 * ATTBASE register are reserved -> try not to write them */ 1389 if (agp_bridge->gatt_bus_addr & INTEL_815_ATTBASE_MASK) { 1390 - printk(KERN_EMERG PFX "gatt bus addr too high"); 1391 return -EINVAL; 1392 } 1393 ··· 2125 NULL, &intel_g33_driver }, 2126 { PCI_DEVICE_ID_INTEL_Q33_HB, PCI_DEVICE_ID_INTEL_Q33_IG, 0, "Q33", 2127 NULL, &intel_g33_driver }, 2128 - { PCI_DEVICE_ID_INTEL_IGD_HB, PCI_DEVICE_ID_INTEL_IGD_IG, 0, 2129 - "Intel Integrated Graphics Device", NULL, &intel_i965_driver }, 2130 { PCI_DEVICE_ID_INTEL_IGD_E_HB, PCI_DEVICE_ID_INTEL_IGD_E_IG, 0, 2131 "Intel Integrated Graphics Device", NULL, &intel_i965_driver }, 2132 { PCI_DEVICE_ID_INTEL_Q45_HB, PCI_DEVICE_ID_INTEL_Q45_IG, 0, ··· 2171 2172 if (intel_agp_chipsets[i].name == NULL) { 2173 if (cap_ptr) 2174 - printk(KERN_WARNING PFX "Unsupported Intel chipset" 2175 - "(device id: %04x)\n", pdev->device); 2176 agp_put_bridge(bridge); 2177 return -ENODEV; 2178 } ··· 2180 if (bridge->driver == NULL) { 2181 /* bridge has no AGP and no IGD detected */ 2182 if (cap_ptr) 2183 - printk(KERN_WARNING PFX "Failed to find bridge device " 2184 - "(chip_id: %04x)\n", 2185 - intel_agp_chipsets[i].gmch_chip_id); 2186 agp_put_bridge(bridge); 2187 return -ENODEV; 2188 } ··· 2190 bridge->capndx = cap_ptr; 2191 bridge->dev_private_data = &intel_private; 2192 2193 - printk(KERN_INFO PFX "Detected an Intel %s Chipset.\n", 2194 - intel_agp_chipsets[i].name); 2195 2196 /* 2197 * The following fixes the case where the BIOS has "forgotten" to ··· 2200 r = &pdev->resource[0]; 2201 if (!r->start && r->end) { 2202 if (pci_assign_resource(pdev, 0)) { 2203 - printk(KERN_ERR PFX "could not assign resource 0\n"); 2204 agp_put_bridge(bridge); 2205 return -ENODEV; 2206 } ··· 2212 * 20030610 - hamish@zot.org 2213 */ 2214 if (pci_enable_device(pdev)) { 2215 - printk(KERN_ERR PFX "Unable to Enable PCI device\n"); 2216 agp_put_bridge(bridge); 2217 return -ENODEV; 2218 } ··· 2244 static int agp_intel_resume(struct pci_dev *pdev) 2245 { 2246 struct agp_bridge_data *bridge = pci_get_drvdata(pdev); 2247 2248 pci_restore_state(pdev); 2249 ··· 2271 intel_i810_configure(); 2272 else if (bridge->driver == &intel_i965_driver) 2273 intel_i915_configure(); 2274 2275 return 0; 2276 } ··· 2326 ID(PCI_DEVICE_ID_INTEL_G33_HB), 2327 ID(PCI_DEVICE_ID_INTEL_Q35_HB), 2328 ID(PCI_DEVICE_ID_INTEL_Q33_HB), 2329 - ID(PCI_DEVICE_ID_INTEL_IGD_HB), 2330 ID(PCI_DEVICE_ID_INTEL_IGD_E_HB), 2331 ID(PCI_DEVICE_ID_INTEL_Q45_HB), 2332 ID(PCI_DEVICE_ID_INTEL_G45_HB),
··· 32 #define PCI_DEVICE_ID_INTEL_Q35_IG 0x29B2 33 #define PCI_DEVICE_ID_INTEL_Q33_HB 0x29D0 34 #define PCI_DEVICE_ID_INTEL_Q33_IG 0x29D2 35 + #define PCI_DEVICE_ID_INTEL_GM45_HB 0x2A40 36 + #define PCI_DEVICE_ID_INTEL_GM45_IG 0x2A42 37 #define PCI_DEVICE_ID_INTEL_IGD_E_HB 0x2E00 38 #define PCI_DEVICE_ID_INTEL_IGD_E_IG 0x2E02 39 #define PCI_DEVICE_ID_INTEL_Q45_HB 0x2E10 ··· 55 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965G_HB || \ 56 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965GM_HB || \ 57 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82965GME_HB || \ 58 + agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_GM45_HB) 59 60 #define IS_G33 (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_G33_HB || \ 61 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_Q35_HB || \ ··· 161 values = A_SIZE_FIX(agp_bridge->driver->aperture_sizes); 162 163 if ((smram_miscc & I810_GMS) == I810_GMS_DISABLE) { 164 + dev_warn(&agp_bridge->dev->dev, "i810 is disabled\n"); 165 return 0; 166 } 167 if ((smram_miscc & I810_GFX_MEM_WIN_SIZE) == I810_GFX_MEM_WIN_32M) { ··· 193 194 intel_private.registers = ioremap(temp, 128 * 4096); 195 if (!intel_private.registers) { 196 + dev_err(&intel_private.pcidev->dev, 197 + "can't remap memory\n"); 198 return -ENOMEM; 199 } 200 } ··· 201 if ((readl(intel_private.registers+I810_DRAM_CTL) 202 & I810_DRAM_ROW_0) == I810_DRAM_ROW_0_SDRAM) { 203 /* This will need to be dynamically assigned */ 204 + dev_info(&intel_private.pcidev->dev, 205 + "detected 4MB dedicated video ram\n"); 206 intel_private.num_dcache_entries = 1024; 207 } 208 pci_read_config_dword(intel_private.pcidev, I810_GMADDR, &temp); ··· 500 size = 1024 + 512; 501 break; 502 default: 503 + dev_info(&intel_private.pcidev->dev, 504 + "unknown page table size, assuming 512KB\n"); 505 size = 512; 506 } 507 size += 4; /* add in BIOS popup space */ ··· 515 size = 2048; 516 break; 517 default: 518 + dev_info(&agp_bridge->dev->dev, 519 + "unknown page table size 0x%x, assuming 512KB\n", 520 (gmch_ctrl & G33_PGETBL_SIZE_MASK)); 521 size = 512; 522 } ··· 627 } 628 } 629 if (gtt_entries > 0) 630 + dev_info(&agp_bridge->dev->dev, "detected %dK %s memory\n", 631 gtt_entries / KB(1), local ? "local" : "stolen"); 632 else 633 + dev_info(&agp_bridge->dev->dev, 634 + "no pre-allocated video memory detected\n"); 635 gtt_entries /= KB(4); 636 637 intel_private.gtt_entries = gtt_entries; ··· 801 num_entries = A_SIZE_FIX(temp)->num_entries; 802 803 if (pg_start < intel_private.gtt_entries) { 804 + dev_printk(KERN_DEBUG, &intel_private.pcidev->dev, 805 + "pg_start == 0x%.8lx, intel_private.gtt_entries == 0x%.8x\n", 806 + pg_start, intel_private.gtt_entries); 807 808 + dev_info(&intel_private.pcidev->dev, 809 + "trying to insert into local/stolen memory\n"); 810 goto out_err; 811 } 812 ··· 851 return 0; 852 853 if (pg_start < intel_private.gtt_entries) { 854 + dev_info(&intel_private.pcidev->dev, 855 + "trying to disable local/stolen memory\n"); 856 return -EINVAL; 857 } 858 ··· 957 if (intel_private.ifp_resource.start) { 958 intel_private.i9xx_flush_page = ioremap_nocache(intel_private.ifp_resource.start, PAGE_SIZE); 959 if (!intel_private.i9xx_flush_page) 960 + dev_info(&intel_private.pcidev->dev, "can't ioremap flush page - no chipset flushing"); 961 } 962 } 963 ··· 1028 num_entries = A_SIZE_FIX(temp)->num_entries; 1029 1030 if (pg_start < intel_private.gtt_entries) { 1031 + dev_printk(KERN_DEBUG, &intel_private.pcidev->dev, 1032 + "pg_start == 0x%.8lx, intel_private.gtt_entries == 0x%.8x\n", 1033 + pg_start, intel_private.gtt_entries); 1034 1035 + dev_info(&intel_private.pcidev->dev, 1036 + "trying to insert into local/stolen memory\n"); 1037 goto out_err; 1038 } 1039 ··· 1078 return 0; 1079 1080 if (pg_start < intel_private.gtt_entries) { 1081 + dev_info(&intel_private.pcidev->dev, 1082 + "trying to disable local/stolen memory\n"); 1083 return -EINVAL; 1084 } 1085 ··· 1182 static void intel_i965_get_gtt_range(int *gtt_offset, int *gtt_size) 1183 { 1184 switch (agp_bridge->dev->device) { 1185 + case PCI_DEVICE_ID_INTEL_GM45_HB: 1186 case PCI_DEVICE_ID_INTEL_IGD_E_HB: 1187 case PCI_DEVICE_ID_INTEL_Q45_HB: 1188 case PCI_DEVICE_ID_INTEL_G45_HB: ··· 1379 /* the Intel 815 chipset spec. says that bits 29-31 in the 1380 * ATTBASE register are reserved -> try not to write them */ 1381 if (agp_bridge->gatt_bus_addr & INTEL_815_ATTBASE_MASK) { 1382 + dev_emerg(&agp_bridge->dev->dev, "gatt bus addr too high"); 1383 return -EINVAL; 1384 } 1385 ··· 2117 NULL, &intel_g33_driver }, 2118 { PCI_DEVICE_ID_INTEL_Q33_HB, PCI_DEVICE_ID_INTEL_Q33_IG, 0, "Q33", 2119 NULL, &intel_g33_driver }, 2120 + { PCI_DEVICE_ID_INTEL_GM45_HB, PCI_DEVICE_ID_INTEL_GM45_IG, 0, 2121 + "Mobile Intel? GM45 Express", NULL, &intel_i965_driver }, 2122 { PCI_DEVICE_ID_INTEL_IGD_E_HB, PCI_DEVICE_ID_INTEL_IGD_E_IG, 0, 2123 "Intel Integrated Graphics Device", NULL, &intel_i965_driver }, 2124 { PCI_DEVICE_ID_INTEL_Q45_HB, PCI_DEVICE_ID_INTEL_Q45_IG, 0, ··· 2163 2164 if (intel_agp_chipsets[i].name == NULL) { 2165 if (cap_ptr) 2166 + dev_warn(&pdev->dev, "unsupported Intel chipset [%04x/%04x]\n", 2167 + pdev->vendor, pdev->device); 2168 agp_put_bridge(bridge); 2169 return -ENODEV; 2170 } ··· 2172 if (bridge->driver == NULL) { 2173 /* bridge has no AGP and no IGD detected */ 2174 if (cap_ptr) 2175 + dev_warn(&pdev->dev, "can't find bridge device (chip_id: %04x)\n", 2176 + intel_agp_chipsets[i].gmch_chip_id); 2177 agp_put_bridge(bridge); 2178 return -ENODEV; 2179 } ··· 2183 bridge->capndx = cap_ptr; 2184 bridge->dev_private_data = &intel_private; 2185 2186 + dev_info(&pdev->dev, "Intel %s Chipset\n", intel_agp_chipsets[i].name); 2187 2188 /* 2189 * The following fixes the case where the BIOS has "forgotten" to ··· 2194 r = &pdev->resource[0]; 2195 if (!r->start && r->end) { 2196 if (pci_assign_resource(pdev, 0)) { 2197 + dev_err(&pdev->dev, "can't assign resource 0\n"); 2198 agp_put_bridge(bridge); 2199 return -ENODEV; 2200 } ··· 2206 * 20030610 - hamish@zot.org 2207 */ 2208 if (pci_enable_device(pdev)) { 2209 + dev_err(&pdev->dev, "can't enable PCI device\n"); 2210 agp_put_bridge(bridge); 2211 return -ENODEV; 2212 } ··· 2238 static int agp_intel_resume(struct pci_dev *pdev) 2239 { 2240 struct agp_bridge_data *bridge = pci_get_drvdata(pdev); 2241 + int ret_val; 2242 2243 pci_restore_state(pdev); 2244 ··· 2264 intel_i810_configure(); 2265 else if (bridge->driver == &intel_i965_driver) 2266 intel_i915_configure(); 2267 + 2268 + ret_val = agp_rebind_memory(); 2269 + if (ret_val != 0) 2270 + return ret_val; 2271 2272 return 0; 2273 } ··· 2315 ID(PCI_DEVICE_ID_INTEL_G33_HB), 2316 ID(PCI_DEVICE_ID_INTEL_Q35_HB), 2317 ID(PCI_DEVICE_ID_INTEL_Q33_HB), 2318 + ID(PCI_DEVICE_ID_INTEL_GM45_HB), 2319 ID(PCI_DEVICE_ID_INTEL_IGD_E_HB), 2320 ID(PCI_DEVICE_ID_INTEL_Q45_HB), 2321 ID(PCI_DEVICE_ID_INTEL_G45_HB),
+19 -18
drivers/char/agp/isoch.c
··· 153 154 /* Check if this configuration has any chance of working */ 155 if (tot_bw > target.maxbw) { 156 - printk(KERN_ERR PFX "isochronous bandwidth required " 157 "by AGP 3.0 devices exceeds that which is supported by " 158 "the AGP 3.0 bridge!\n"); 159 ret = -ENODEV; ··· 188 /* Exit if the minimal ISOCH_N allocation among the masters is more 189 * than the target can handle. */ 190 if (tot_n > target.n) { 191 - printk(KERN_ERR PFX "number of isochronous " 192 "transactions per period required by AGP 3.0 devices " 193 "exceeds that which is supported by the AGP 3.0 " 194 "bridge!\n"); ··· 229 /* Exit if the minimal RQ needs of the masters exceeds what the target 230 * can provide. */ 231 if (tot_rq > rq_isoch) { 232 - printk(KERN_ERR PFX "number of request queue slots " 233 "required by the isochronous bandwidth requested by " 234 "AGP 3.0 devices exceeds the number provided by the " 235 "AGP 3.0 bridge!\n"); ··· 359 case 0x0001: /* Unclassified device */ 360 /* Don't know what this is, but log it for investigation. */ 361 if (mcapndx != 0) { 362 - printk (KERN_INFO PFX "Wacky, found unclassified AGP device. %x:%x\n", 363 - dev->vendor, dev->device); 364 } 365 continue; 366 ··· 408 } 409 410 if (mcapndx == 0) { 411 - printk(KERN_ERR PFX "woah! Non-AGP device " 412 - "found on the secondary bus of an AGP 3.5 bridge!\n"); 413 ret = -ENODEV; 414 goto free_and_exit; 415 } 416 417 mmajor = (ncapid >> AGP_MAJOR_VERSION_SHIFT) & 0xf; 418 if (mmajor < 3) { 419 - printk(KERN_ERR PFX "woah! AGP 2.0 device " 420 - "found on the secondary bus of an AGP 3.5 " 421 - "bridge operating with AGP 3.0 electricals!\n"); 422 ret = -ENODEV; 423 goto free_and_exit; 424 } ··· 429 pci_read_config_dword(dev, cur->capndx+AGPSTAT, &mstatus); 430 431 if (((mstatus >> 3) & 0x1) == 0) { 432 - printk(KERN_ERR PFX "woah! AGP 3.x device " 433 - "not operating in AGP 3.x mode found on the " 434 - "secondary bus of an AGP 3.5 bridge operating " 435 - "with AGP 3.0 electricals!\n"); 436 ret = -ENODEV; 437 goto free_and_exit; 438 } ··· 446 if (isoch) { 447 ret = agp_3_5_isochronous_node_enable(bridge, dev_list, ndevs); 448 if (ret) { 449 - printk(KERN_INFO PFX "Something bad happened setting " 450 - "up isochronous xfers. Falling back to " 451 - "non-isochronous xfer mode.\n"); 452 } else { 453 goto free_and_exit; 454 } ··· 468 get_out: 469 return ret; 470 } 471 -
··· 153 154 /* Check if this configuration has any chance of working */ 155 if (tot_bw > target.maxbw) { 156 + dev_err(&td->dev, "isochronous bandwidth required " 157 "by AGP 3.0 devices exceeds that which is supported by " 158 "the AGP 3.0 bridge!\n"); 159 ret = -ENODEV; ··· 188 /* Exit if the minimal ISOCH_N allocation among the masters is more 189 * than the target can handle. */ 190 if (tot_n > target.n) { 191 + dev_err(&td->dev, "number of isochronous " 192 "transactions per period required by AGP 3.0 devices " 193 "exceeds that which is supported by the AGP 3.0 " 194 "bridge!\n"); ··· 229 /* Exit if the minimal RQ needs of the masters exceeds what the target 230 * can provide. */ 231 if (tot_rq > rq_isoch) { 232 + dev_err(&td->dev, "number of request queue slots " 233 "required by the isochronous bandwidth requested by " 234 "AGP 3.0 devices exceeds the number provided by the " 235 "AGP 3.0 bridge!\n"); ··· 359 case 0x0001: /* Unclassified device */ 360 /* Don't know what this is, but log it for investigation. */ 361 if (mcapndx != 0) { 362 + dev_info(&td->dev, "wacky, found unclassified AGP device %s [%04x/%04x]\n", 363 + pci_name(dev), 364 + dev->vendor, dev->device); 365 } 366 continue; 367 ··· 407 } 408 409 if (mcapndx == 0) { 410 + dev_err(&td->dev, "woah! Non-AGP device %s on " 411 + "secondary bus of AGP 3.5 bridge!\n", 412 + pci_name(dev)); 413 ret = -ENODEV; 414 goto free_and_exit; 415 } 416 417 mmajor = (ncapid >> AGP_MAJOR_VERSION_SHIFT) & 0xf; 418 if (mmajor < 3) { 419 + dev_err(&td->dev, "woah! AGP 2.0 device %s on " 420 + "secondary bus of AGP 3.5 bridge operating " 421 + "with AGP 3.0 electricals!\n", pci_name(dev)); 422 ret = -ENODEV; 423 goto free_and_exit; 424 } ··· 427 pci_read_config_dword(dev, cur->capndx+AGPSTAT, &mstatus); 428 429 if (((mstatus >> 3) & 0x1) == 0) { 430 + dev_err(&td->dev, "woah! AGP 3.x device %s not " 431 + "operating in AGP 3.x mode on secondary bus " 432 + "of AGP 3.5 bridge operating with AGP 3.0 " 433 + "electricals!\n", pci_name(dev)); 434 ret = -ENODEV; 435 goto free_and_exit; 436 } ··· 444 if (isoch) { 445 ret = agp_3_5_isochronous_node_enable(bridge, dev_list, ndevs); 446 if (ret) { 447 + dev_info(&td->dev, "something bad happened setting " 448 + "up isochronous xfers; falling back to " 449 + "non-isochronous xfer mode\n"); 450 } else { 451 goto free_and_exit; 452 } ··· 466 get_out: 467 return ret; 468 }
+8 -9
drivers/char/agp/sis-agp.c
··· 79 u32 command; 80 int rate; 81 82 - printk(KERN_INFO PFX "Found an AGP %d.%d compliant device at %s.\n", 83 - agp_bridge->major_version, 84 - agp_bridge->minor_version, 85 - pci_name(agp_bridge->dev)); 86 87 pci_read_config_dword(agp_bridge->dev, agp_bridge->capndx + PCI_AGP_STATUS, &command); 88 command = agp_collect_device_status(bridge, mode, command); ··· 92 if (!agp) 93 continue; 94 95 - printk(KERN_INFO PFX "Putting AGP V3 device at %s into %dx mode\n", 96 - pci_name(device), rate); 97 98 pci_write_config_dword(device, agp + PCI_AGP_COMMAND, command); 99 ··· 103 * cannot be configured 104 */ 105 if (device->device == bridge->dev->device) { 106 - printk(KERN_INFO PFX "SiS delay workaround: giving bridge time to recover.\n"); 107 msleep(10); 108 } 109 } ··· 188 return -ENODEV; 189 190 191 - printk(KERN_INFO PFX "Detected SiS chipset - id:%i\n", pdev->device); 192 bridge = agp_alloc_bridge(); 193 if (!bridge) 194 return -ENOMEM; ··· 241 .class = (PCI_CLASS_BRIDGE_HOST << 8), 242 .class_mask = ~0, 243 .vendor = PCI_VENDOR_ID_SI, 244 - .device = PCI_DEVICE_ID_SI_5591_AGP, 245 .subvendor = PCI_ANY_ID, 246 .subdevice = PCI_ANY_ID, 247 },
··· 79 u32 command; 80 int rate; 81 82 + dev_info(&agp_bridge->dev->dev, "AGP %d.%d bridge\n", 83 + agp_bridge->major_version, agp_bridge->minor_version); 84 85 pci_read_config_dword(agp_bridge->dev, agp_bridge->capndx + PCI_AGP_STATUS, &command); 86 command = agp_collect_device_status(bridge, mode, command); ··· 94 if (!agp) 95 continue; 96 97 + dev_info(&agp_bridge->dev->dev, "putting AGP V3 device at %s into %dx mode\n", 98 + pci_name(device), rate); 99 100 pci_write_config_dword(device, agp + PCI_AGP_COMMAND, command); 101 ··· 105 * cannot be configured 106 */ 107 if (device->device == bridge->dev->device) { 108 + dev_info(&agp_bridge->dev->dev, "SiS delay workaround: giving bridge time to recover\n"); 109 msleep(10); 110 } 111 } ··· 190 return -ENODEV; 191 192 193 + dev_info(&pdev->dev, "SiS chipset [%04x/%04x]\n", 194 + pdev->vendor, pdev->device); 195 bridge = agp_alloc_bridge(); 196 if (!bridge) 197 return -ENOMEM; ··· 242 .class = (PCI_CLASS_BRIDGE_HOST << 8), 243 .class_mask = ~0, 244 .vendor = PCI_VENDOR_ID_SI, 245 + .device = PCI_DEVICE_ID_SI_5591, 246 .subvendor = PCI_ANY_ID, 247 .subdevice = PCI_ANY_ID, 248 },
+13 -12
drivers/char/agp/sworks-agp.c
··· 241 while (readb(serverworks_private.registers+SVWRKS_POSTFLUSH) == 1) { 242 cpu_relax(); 243 if (time_after(jiffies, timeout)) { 244 - printk(KERN_ERR PFX "TLB post flush took more than 3 seconds\n"); 245 break; 246 } 247 } ··· 252 while (readl(serverworks_private.registers+SVWRKS_DIRFLUSH) == 1) { 253 cpu_relax(); 254 if (time_after(jiffies, timeout)) { 255 - printk(KERN_ERR PFX "TLB Dir flush took more than 3 seconds\n"); 256 break; 257 } 258 } ··· 273 temp = (temp & PCI_BASE_ADDRESS_MEM_MASK); 274 serverworks_private.registers = (volatile u8 __iomem *) ioremap(temp, 4096); 275 if (!serverworks_private.registers) { 276 - printk (KERN_ERR PFX "Unable to ioremap() memory.\n"); 277 return -ENOMEM; 278 } 279 ··· 453 454 switch (pdev->device) { 455 case 0x0006: 456 - printk (KERN_ERR PFX "ServerWorks CNB20HE is unsupported due to lack of documentation.\n"); 457 return -ENODEV; 458 459 case PCI_DEVICE_ID_SERVERWORKS_HE: ··· 463 464 default: 465 if (cap_ptr) 466 - printk(KERN_ERR PFX "Unsupported Serverworks chipset " 467 - "(device id: %04x)\n", pdev->device); 468 return -ENODEV; 469 } 470 ··· 472 bridge_dev = pci_get_bus_and_slot((unsigned int)pdev->bus->number, 473 PCI_DEVFN(0, 1)); 474 if (!bridge_dev) { 475 - printk(KERN_INFO PFX "Detected a Serverworks chipset " 476 - "but could not find the secondary device.\n"); 477 return -ENODEV; 478 } 479 ··· 483 if (temp & PCI_BASE_ADDRESS_MEM_TYPE_64) { 484 pci_read_config_dword(pdev, SVWRKS_APSIZE + 4, &temp2); 485 if (temp2 != 0) { 486 - printk(KERN_INFO PFX "Detected 64 bit aperture address, " 487 - "but top bits are not zero. Disabling agp\n"); 488 return -ENODEV; 489 } 490 serverworks_private.mm_addr_ofs = 0x18; ··· 496 pci_read_config_dword(pdev, 497 serverworks_private.mm_addr_ofs + 4, &temp2); 498 if (temp2 != 0) { 499 - printk(KERN_INFO PFX "Detected 64 bit MMIO address, " 500 - "but top bits are not zero. Disabling agp\n"); 501 return -ENODEV; 502 } 503 }
··· 241 while (readb(serverworks_private.registers+SVWRKS_POSTFLUSH) == 1) { 242 cpu_relax(); 243 if (time_after(jiffies, timeout)) { 244 + dev_err(&serverworks_private.svrwrks_dev->dev, 245 + "TLB post flush took more than 3 seconds\n"); 246 break; 247 } 248 } ··· 251 while (readl(serverworks_private.registers+SVWRKS_DIRFLUSH) == 1) { 252 cpu_relax(); 253 if (time_after(jiffies, timeout)) { 254 + dev_err(&serverworks_private.svrwrks_dev->dev, 255 + "TLB Dir flush took more than 3 seconds\n"); 256 break; 257 } 258 } ··· 271 temp = (temp & PCI_BASE_ADDRESS_MEM_MASK); 272 serverworks_private.registers = (volatile u8 __iomem *) ioremap(temp, 4096); 273 if (!serverworks_private.registers) { 274 + dev_err(&agp_bridge->dev->dev, "can't ioremap(%#x)\n", temp); 275 return -ENOMEM; 276 } 277 ··· 451 452 switch (pdev->device) { 453 case 0x0006: 454 + dev_err(&pdev->dev, "ServerWorks CNB20HE is unsupported due to lack of documentation\n"); 455 return -ENODEV; 456 457 case PCI_DEVICE_ID_SERVERWORKS_HE: ··· 461 462 default: 463 if (cap_ptr) 464 + dev_err(&pdev->dev, "unsupported Serverworks chipset " 465 + "[%04x/%04x]\n", pdev->vendor, pdev->device); 466 return -ENODEV; 467 } 468 ··· 470 bridge_dev = pci_get_bus_and_slot((unsigned int)pdev->bus->number, 471 PCI_DEVFN(0, 1)); 472 if (!bridge_dev) { 473 + dev_info(&pdev->dev, "can't find secondary device\n"); 474 return -ENODEV; 475 } 476 ··· 482 if (temp & PCI_BASE_ADDRESS_MEM_TYPE_64) { 483 pci_read_config_dword(pdev, SVWRKS_APSIZE + 4, &temp2); 484 if (temp2 != 0) { 485 + dev_info(&pdev->dev, "64 bit aperture address, " 486 + "but top bits are not zero; disabling AGP\n"); 487 return -ENODEV; 488 } 489 serverworks_private.mm_addr_ofs = 0x18; ··· 495 pci_read_config_dword(pdev, 496 serverworks_private.mm_addr_ofs + 4, &temp2); 497 if (temp2 != 0) { 498 + dev_info(&pdev->dev, "64 bit MMIO address, but top " 499 + "bits are not zero; disabling AGP\n"); 500 return -ENODEV; 501 } 502 }
+16 -16
drivers/char/agp/uninorth-agp.c
··· 46 break; 47 48 if (i == agp_bridge->driver->num_aperture_sizes) { 49 - printk(KERN_ERR PFX "Invalid aperture size, using" 50 - " default\n"); 51 size = 0; 52 aperture = NULL; 53 } ··· 108 109 current_size = A_SIZE_32(agp_bridge->current_size); 110 111 - printk(KERN_INFO PFX "configuring for size idx: %d\n", 112 - current_size->size_value); 113 114 /* aperture size and gatt addr */ 115 pci_write_config_dword(agp_bridge->dev, ··· 197 gp = (u32 *) &agp_bridge->gatt_table[pg_start]; 198 for (i = 0; i < mem->page_count; ++i) { 199 if (gp[i]) { 200 - printk("u3_insert_memory: entry 0x%x occupied (%x)\n", 201 - i, gp[i]); 202 return -EBUSY; 203 } 204 } ··· 277 &scratch); 278 } while ((scratch & PCI_AGP_COMMAND_AGP) == 0 && ++timeout < 1000); 279 if ((scratch & PCI_AGP_COMMAND_AGP) == 0) 280 - printk(KERN_ERR PFX "failed to write UniNorth AGP" 281 - " command register\n"); 282 283 if (uninorth_rev >= 0x30) { 284 /* This is an AGP V3 */ ··· 331 pci_read_config_dword(device, agp + PCI_AGP_COMMAND, &cmd); 332 if (!(cmd & PCI_AGP_COMMAND_AGP)) 333 continue; 334 - printk("uninorth-agp: disabling AGP on device %s\n", 335 - pci_name(device)); 336 cmd &= ~PCI_AGP_COMMAND_AGP; 337 pci_write_config_dword(device, agp + PCI_AGP_COMMAND, cmd); 338 } ··· 342 pci_read_config_dword(pdev, agp + PCI_AGP_COMMAND, &cmd); 343 bridge->dev_private_data = (void *)(long)cmd; 344 if (cmd & PCI_AGP_COMMAND_AGP) { 345 - printk("uninorth-agp: disabling AGP on bridge %s\n", 346 - pci_name(pdev)); 347 cmd &= ~PCI_AGP_COMMAND_AGP; 348 pci_write_config_dword(pdev, agp + PCI_AGP_COMMAND, cmd); 349 } ··· 591 /* probe for known chipsets */ 592 for (j = 0; devs[j].chipset_name != NULL; ++j) { 593 if (pdev->device == devs[j].device_id) { 594 - printk(KERN_INFO PFX "Detected Apple %s chipset\n", 595 - devs[j].chipset_name); 596 goto found; 597 } 598 } 599 600 - printk(KERN_ERR PFX "Unsupported Apple chipset (device id: %04x).\n", 601 - pdev->device); 602 return -ENODEV; 603 604 found:
··· 46 break; 47 48 if (i == agp_bridge->driver->num_aperture_sizes) { 49 + dev_err(&agp_bridge->dev->dev, "invalid aperture size, " 50 + "using default\n"); 51 size = 0; 52 aperture = NULL; 53 } ··· 108 109 current_size = A_SIZE_32(agp_bridge->current_size); 110 111 + dev_info(&agp_bridge->dev->dev, "configuring for size idx: %d\n", 112 + current_size->size_value); 113 114 /* aperture size and gatt addr */ 115 pci_write_config_dword(agp_bridge->dev, ··· 197 gp = (u32 *) &agp_bridge->gatt_table[pg_start]; 198 for (i = 0; i < mem->page_count; ++i) { 199 if (gp[i]) { 200 + dev_info(&agp_bridge->dev->dev, 201 + "u3_insert_memory: entry 0x%x occupied (%x)\n", 202 + i, gp[i]); 203 return -EBUSY; 204 } 205 } ··· 276 &scratch); 277 } while ((scratch & PCI_AGP_COMMAND_AGP) == 0 && ++timeout < 1000); 278 if ((scratch & PCI_AGP_COMMAND_AGP) == 0) 279 + dev_err(&bridge->dev->dev, "can't write UniNorth AGP " 280 + "command register\n"); 281 282 if (uninorth_rev >= 0x30) { 283 /* This is an AGP V3 */ ··· 330 pci_read_config_dword(device, agp + PCI_AGP_COMMAND, &cmd); 331 if (!(cmd & PCI_AGP_COMMAND_AGP)) 332 continue; 333 + dev_info(&pdev->dev, "disabling AGP on device %s\n", 334 + pci_name(device)); 335 cmd &= ~PCI_AGP_COMMAND_AGP; 336 pci_write_config_dword(device, agp + PCI_AGP_COMMAND, cmd); 337 } ··· 341 pci_read_config_dword(pdev, agp + PCI_AGP_COMMAND, &cmd); 342 bridge->dev_private_data = (void *)(long)cmd; 343 if (cmd & PCI_AGP_COMMAND_AGP) { 344 + dev_info(&pdev->dev, "disabling AGP on bridge\n"); 345 cmd &= ~PCI_AGP_COMMAND_AGP; 346 pci_write_config_dword(pdev, agp + PCI_AGP_COMMAND, cmd); 347 } ··· 591 /* probe for known chipsets */ 592 for (j = 0; devs[j].chipset_name != NULL; ++j) { 593 if (pdev->device == devs[j].device_id) { 594 + dev_info(&pdev->dev, "Apple %s chipset\n", 595 + devs[j].chipset_name); 596 goto found; 597 } 598 } 599 600 + dev_err(&pdev->dev, "unsupported Apple chipset [%04x/%04x]\n", 601 + pdev->vendor, pdev->device); 602 return -ENODEV; 603 604 found:
+5
include/linux/agp_backend.h
··· 30 #ifndef _AGP_BACKEND_H 31 #define _AGP_BACKEND_H 1 32 33 enum chipset_type { 34 NOT_SUPPORTED, 35 SUPPORTED, ··· 80 bool is_bound; 81 bool is_flushed; 82 bool vmalloc_flag; 83 }; 84 85 #define AGP_NORMAL_MEMORY 0 ··· 100 extern int agp_copy_info(struct agp_bridge_data *, struct agp_kern_info *); 101 extern int agp_bind_memory(struct agp_memory *, off_t); 102 extern int agp_unbind_memory(struct agp_memory *); 103 extern void agp_enable(struct agp_bridge_data *, u32); 104 extern struct agp_bridge_data *agp_backend_acquire(struct pci_dev *); 105 extern void agp_backend_release(struct agp_bridge_data *);
··· 30 #ifndef _AGP_BACKEND_H 31 #define _AGP_BACKEND_H 1 32 33 + #include <linux/list.h> 34 + 35 enum chipset_type { 36 NOT_SUPPORTED, 37 SUPPORTED, ··· 78 bool is_bound; 79 bool is_flushed; 80 bool vmalloc_flag; 81 + /* list of agp_memory mapped to the aperture */ 82 + struct list_head mapped_list; 83 }; 84 85 #define AGP_NORMAL_MEMORY 0 ··· 96 extern int agp_copy_info(struct agp_bridge_data *, struct agp_kern_info *); 97 extern int agp_bind_memory(struct agp_memory *, off_t); 98 extern int agp_unbind_memory(struct agp_memory *); 99 + extern int agp_rebind_memory(void); 100 extern void agp_enable(struct agp_bridge_data *, u32); 101 extern struct agp_bridge_data *agp_backend_acquire(struct pci_dev *); 102 extern void agp_backend_release(struct agp_bridge_data *);