Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart

+76 -20
+24
drivers/char/agp/amd64-agp.c
··· 600 600 agp_put_bridge(bridge); 601 601 } 602 602 603 + #ifdef CONFIG_PM 604 + 605 + static int agp_amd64_suspend(struct pci_dev *pdev, pm_message_t state) 606 + { 607 + pci_save_state(pdev); 608 + pci_set_power_state(pdev, pci_choose_state(pdev, state)); 609 + 610 + return 0; 611 + } 612 + 613 + static int agp_amd64_resume(struct pci_dev *pdev) 614 + { 615 + pci_set_power_state(pdev, PCI_D0); 616 + pci_restore_state(pdev); 617 + 618 + return amd_8151_configure(); 619 + } 620 + 621 + #endif /* CONFIG_PM */ 622 + 603 623 static struct pci_device_id agp_amd64_pci_table[] = { 604 624 { 605 625 .class = (PCI_CLASS_BRIDGE_HOST << 8), ··· 738 718 .id_table = agp_amd64_pci_table, 739 719 .probe = agp_amd64_probe, 740 720 .remove = agp_amd64_remove, 721 + #ifdef CONFIG_PM 722 + .suspend = agp_amd64_suspend, 723 + .resume = agp_amd64_resume, 724 + #endif 741 725 }; 742 726 743 727
+20
drivers/char/agp/ati-agp.c
··· 244 244 } 245 245 246 246 247 + #ifdef CONFIG_PM 248 + static int agp_ati_resume(struct pci_dev *dev) 249 + { 250 + pci_restore_state(dev); 251 + 252 + return ati_configure(); 253 + } 254 + 255 + static int agp_ati_suspend(struct pci_dev *dev, pm_message_t state) 256 + { 257 + pci_save_state(dev); 258 + 259 + return 0; 260 + } 261 + #endif 262 + 247 263 /* 248 264 *Since we don't need contigious memory we just try 249 265 * to get the gatt table once ··· 541 525 .id_table = agp_ati_pci_table, 542 526 .probe = agp_ati_probe, 543 527 .remove = agp_ati_remove, 528 + #ifdef CONFIG_PM 529 + .resume = agp_ati_resume, 530 + .suspend = agp_ati_suspend, 531 + #endif 544 532 }; 545 533 546 534 static int __init agp_ati_init(void)
+14 -14
drivers/char/agp/frontend.c
··· 592 592 struct agp_file_private *priv = file->private_data; 593 593 struct agp_kern_info kerninfo; 594 594 595 - down(&(agp_fe.agp_mutex)); 595 + mutex_lock(&(agp_fe.agp_mutex)); 596 596 597 597 if (agp_fe.backend_acquired != TRUE) 598 598 goto out_eperm; ··· 627 627 size, vma->vm_page_prot)) { 628 628 goto out_again; 629 629 } 630 - up(&(agp_fe.agp_mutex)); 630 + mutex_unlock(&(agp_fe.agp_mutex)); 631 631 return 0; 632 632 } 633 633 ··· 643 643 size, vma->vm_page_prot)) { 644 644 goto out_again; 645 645 } 646 - up(&(agp_fe.agp_mutex)); 646 + mutex_unlock(&(agp_fe.agp_mutex)); 647 647 return 0; 648 648 } 649 649 650 650 out_eperm: 651 - up(&(agp_fe.agp_mutex)); 651 + mutex_unlock(&(agp_fe.agp_mutex)); 652 652 return -EPERM; 653 653 654 654 out_inval: 655 - up(&(agp_fe.agp_mutex)); 655 + mutex_unlock(&(agp_fe.agp_mutex)); 656 656 return -EINVAL; 657 657 658 658 out_again: 659 - up(&(agp_fe.agp_mutex)); 659 + mutex_unlock(&(agp_fe.agp_mutex)); 660 660 return -EAGAIN; 661 661 } 662 662 ··· 664 664 { 665 665 struct agp_file_private *priv = file->private_data; 666 666 667 - down(&(agp_fe.agp_mutex)); 667 + mutex_lock(&(agp_fe.agp_mutex)); 668 668 669 669 DBG("priv=%p", priv); 670 670 ··· 687 687 agp_remove_file_private(priv); 688 688 kfree(priv); 689 689 file->private_data = NULL; 690 - up(&(agp_fe.agp_mutex)); 690 + mutex_unlock(&(agp_fe.agp_mutex)); 691 691 return 0; 692 692 } 693 693 ··· 698 698 struct agp_client *client; 699 699 int rc = -ENXIO; 700 700 701 - down(&(agp_fe.agp_mutex)); 701 + mutex_lock(&(agp_fe.agp_mutex)); 702 702 703 703 if (minor != AGPGART_MINOR) 704 704 goto err_out; ··· 723 723 file->private_data = (void *) priv; 724 724 agp_insert_file_private(priv); 725 725 DBG("private=%p, client=%p", priv, client); 726 - up(&(agp_fe.agp_mutex)); 726 + mutex_unlock(&(agp_fe.agp_mutex)); 727 727 return 0; 728 728 729 729 err_out_nomem: 730 730 rc = -ENOMEM; 731 731 err_out: 732 - up(&(agp_fe.agp_mutex)); 732 + mutex_unlock(&(agp_fe.agp_mutex)); 733 733 return rc; 734 734 } 735 735 ··· 985 985 int ret_val = -ENOTTY; 986 986 987 987 DBG("priv=%p, cmd=%x", curr_priv, cmd); 988 - down(&(agp_fe.agp_mutex)); 988 + mutex_lock(&(agp_fe.agp_mutex)); 989 989 990 990 if ((agp_fe.current_controller == NULL) && 991 991 (cmd != AGPIOC_ACQUIRE)) { ··· 1055 1055 1056 1056 ioctl_out: 1057 1057 DBG("ioctl returns %d\n", ret_val); 1058 - up(&(agp_fe.agp_mutex)); 1058 + mutex_unlock(&(agp_fe.agp_mutex)); 1059 1059 return ret_val; 1060 1060 } 1061 1061 ··· 1081 1081 int agp_frontend_initialize(void) 1082 1082 { 1083 1083 memset(&agp_fe, 0, sizeof(struct agp_front_data)); 1084 - sema_init(&(agp_fe.agp_mutex), 1); 1084 + mutex_init(&(agp_fe.agp_mutex)); 1085 1085 1086 1086 if (misc_register(&agp_miscdev)) { 1087 1087 printk(KERN_ERR PFX "unable to get minor: %d\n", AGPGART_MINOR);
+13 -2
drivers/char/agp/intel-agp.c
··· 422 422 /* Check it's really I915G */ 423 423 if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB || 424 424 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB || 425 - agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945G_HB) 425 + agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945G_HB || 426 + agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945GM_HB) 426 427 gtt_entries = MB(48) - KB(size); 427 428 else 428 429 gtt_entries = 0; ··· 432 431 /* Check it's really I915G */ 433 432 if (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915G_HB || 434 433 agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB || 435 - agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945G_HB) 434 + agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945G_HB || 435 + agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_82945GM_HB) 436 436 gtt_entries = MB(64) - KB(size); 437 437 else 438 438 gtt_entries = 0; ··· 1683 1681 } 1684 1682 name = "945G"; 1685 1683 break; 1684 + case PCI_DEVICE_ID_INTEL_82945GM_HB: 1685 + if (find_i830(PCI_DEVICE_ID_INTEL_82945GM_IG)) { 1686 + bridge->driver = &intel_915_driver; 1687 + } else { 1688 + bridge->driver = &intel_845_driver; 1689 + } 1690 + name = "945GM"; 1691 + break; 1686 1692 case PCI_DEVICE_ID_INTEL_7505_0: 1687 1693 bridge->driver = &intel_7505_driver; 1688 1694 name = "E7505"; ··· 1831 1821 ID(PCI_DEVICE_ID_INTEL_82915G_HB), 1832 1822 ID(PCI_DEVICE_ID_INTEL_82915GM_HB), 1833 1823 ID(PCI_DEVICE_ID_INTEL_82945G_HB), 1824 + ID(PCI_DEVICE_ID_INTEL_82945GM_HB), 1834 1825 { } 1835 1826 }; 1836 1827
+1 -3
drivers/char/agp/isoch.c
··· 218 218 master[cdev].rq *= (1 << (master[cdev].y - 1)); 219 219 220 220 tot_rq += master[cdev].rq; 221 - 222 - if (cdev == ndevs-1) 223 - master[cdev].n += rem; 224 221 } 222 + master[ndevs-1].n += rem; 225 223 226 224 /* Figure the number of isochronous and asynchronous RQ slots the 227 225 * target is providing. */
+2 -1
include/linux/agpgart.h
··· 111 111 } agp_unbind; 112 112 113 113 #else /* __KERNEL__ */ 114 + #include <linux/mutex.h> 114 115 115 116 #define AGPGART_MINOR 175 116 117 ··· 202 201 }; 203 202 204 203 struct agp_front_data { 205 - struct semaphore agp_mutex; 204 + struct mutex agp_mutex; 206 205 struct agp_controller *current_controller; 207 206 struct agp_controller *controllers; 208 207 struct agp_file_private *file_priv_list;
+2
include/linux/pci_ids.h
··· 2085 2085 #define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592 2086 2086 #define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770 2087 2087 #define PCI_DEVICE_ID_INTEL_82945G_IG 0x2772 2088 + #define PCI_DEVICE_ID_INTEL_82945GM_HB 0x27A0 2089 + #define PCI_DEVICE_ID_INTEL_82945GM_IG 0x27A2 2088 2090 #define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640 2089 2091 #define PCI_DEVICE_ID_INTEL_ICH6_1 0x2641 2090 2092 #define PCI_DEVICE_ID_INTEL_ICH6_2 0x2642