aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/agp/intel-agp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/agp/intel-agp.c')
-rw-r--r--drivers/char/agp/intel-agp.c45
1 files changed, 19 insertions, 26 deletions
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
index 631531fd97a5..bddcae54b16d 100644
--- a/drivers/char/agp/intel-agp.c
+++ b/drivers/char/agp/intel-agp.c
@@ -201,9 +201,9 @@ static int intel_i810_insert_entries(struct agp_memory *mem, off_t pg_start,
201 temp = agp_bridge->current_size; 201 temp = agp_bridge->current_size;
202 num_entries = A_SIZE_FIX(temp)->num_entries; 202 num_entries = A_SIZE_FIX(temp)->num_entries;
203 203
204 if ((pg_start + mem->page_count) > num_entries) { 204 if ((pg_start + mem->page_count) > num_entries)
205 return -EINVAL; 205 return -EINVAL;
206 } 206
207 for (j = pg_start; j < (pg_start + mem->page_count); j++) { 207 for (j = pg_start; j < (pg_start + mem->page_count); j++) {
208 if (!PGE_EMPTY(agp_bridge, readl(agp_bridge->gatt_table+j))) 208 if (!PGE_EMPTY(agp_bridge, readl(agp_bridge->gatt_table+j)))
209 return -EBUSY; 209 return -EBUSY;
@@ -221,7 +221,7 @@ static int intel_i810_insert_entries(struct agp_memory *mem, off_t pg_start,
221 agp_bridge->driver->tlb_flush(mem); 221 agp_bridge->driver->tlb_flush(mem);
222 return 0; 222 return 0;
223 } 223 }
224 if((type == AGP_PHYS_MEMORY) && (mem->type == AGP_PHYS_MEMORY)) 224 if ((type == AGP_PHYS_MEMORY) && (mem->type == AGP_PHYS_MEMORY))
225 goto insert; 225 goto insert;
226 return -EINVAL; 226 return -EINVAL;
227 } 227 }
@@ -328,7 +328,7 @@ static struct agp_memory *intel_i810_alloc_by_type(size_t pg_count, int type)
328static void intel_i810_free_by_type(struct agp_memory *curr) 328static void intel_i810_free_by_type(struct agp_memory *curr)
329{ 329{
330 agp_free_key(curr->key); 330 agp_free_key(curr->key);
331 if(curr->type == AGP_PHYS_MEMORY) { 331 if (curr->type == AGP_PHYS_MEMORY) {
332 if (curr->page_count == 4) 332 if (curr->page_count == 4)
333 i8xx_destroy_pages(gart_to_virt(curr->memory[0])); 333 i8xx_destroy_pages(gart_to_virt(curr->memory[0]));
334 else { 334 else {
@@ -1603,11 +1603,10 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
1603 name = "i820"; 1603 name = "i820";
1604 break; 1604 break;
1605 case PCI_DEVICE_ID_INTEL_82830_HB: 1605 case PCI_DEVICE_ID_INTEL_82830_HB:
1606 if (find_i830(PCI_DEVICE_ID_INTEL_82830_CGC)) { 1606 if (find_i830(PCI_DEVICE_ID_INTEL_82830_CGC))
1607 bridge->driver = &intel_830_driver; 1607 bridge->driver = &intel_830_driver;
1608 } else { 1608 else
1609 bridge->driver = &intel_830mp_driver; 1609 bridge->driver = &intel_830mp_driver;
1610 }
1611 name = "830M"; 1610 name = "830M";
1612 break; 1611 break;
1613 case PCI_DEVICE_ID_INTEL_82840_HB: 1612 case PCI_DEVICE_ID_INTEL_82840_HB:
@@ -1619,11 +1618,10 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
1619 name = "i845"; 1618 name = "i845";
1620 break; 1619 break;
1621 case PCI_DEVICE_ID_INTEL_82845G_HB: 1620 case PCI_DEVICE_ID_INTEL_82845G_HB:
1622 if (find_i830(PCI_DEVICE_ID_INTEL_82845G_IG)) { 1621 if (find_i830(PCI_DEVICE_ID_INTEL_82845G_IG))
1623 bridge->driver = &intel_830_driver; 1622 bridge->driver = &intel_830_driver;
1624 } else { 1623 else
1625 bridge->driver = &intel_845_driver; 1624 bridge->driver = &intel_845_driver;
1626 }
1627 name = "845G"; 1625 name = "845G";
1628 break; 1626 break;
1629 case PCI_DEVICE_ID_INTEL_82850_HB: 1627 case PCI_DEVICE_ID_INTEL_82850_HB:
@@ -1648,11 +1646,10 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
1648 name = "i860"; 1646 name = "i860";
1649 break; 1647 break;
1650 case PCI_DEVICE_ID_INTEL_82865_HB: 1648 case PCI_DEVICE_ID_INTEL_82865_HB:
1651 if (find_i830(PCI_DEVICE_ID_INTEL_82865_IG)) { 1649 if (find_i830(PCI_DEVICE_ID_INTEL_82865_IG))
1652 bridge->driver = &intel_830_driver; 1650 bridge->driver = &intel_830_driver;
1653 } else { 1651 else
1654 bridge->driver = &intel_845_driver; 1652 bridge->driver = &intel_845_driver;
1655 }
1656 name = "865"; 1653 name = "865";
1657 break; 1654 break;
1658 case PCI_DEVICE_ID_INTEL_82875_HB: 1655 case PCI_DEVICE_ID_INTEL_82875_HB:
@@ -1660,35 +1657,31 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
1660 name = "i875"; 1657 name = "i875";
1661 break; 1658 break;
1662 case PCI_DEVICE_ID_INTEL_82915G_HB: 1659 case PCI_DEVICE_ID_INTEL_82915G_HB:
1663 if (find_i830(PCI_DEVICE_ID_INTEL_82915G_IG)) { 1660 if (find_i830(PCI_DEVICE_ID_INTEL_82915G_IG))
1664 bridge->driver = &intel_915_driver; 1661 bridge->driver = &intel_915_driver;
1665 } else { 1662 else
1666 bridge->driver = &intel_845_driver; 1663 bridge->driver = &intel_845_driver;
1667 }
1668 name = "915G"; 1664 name = "915G";
1669 break; 1665 break;
1670 case PCI_DEVICE_ID_INTEL_82915GM_HB: 1666 case PCI_DEVICE_ID_INTEL_82915GM_HB:
1671 if (find_i830(PCI_DEVICE_ID_INTEL_82915GM_IG)) { 1667 if (find_i830(PCI_DEVICE_ID_INTEL_82915GM_IG))
1672 bridge->driver = &intel_915_driver; 1668 bridge->driver = &intel_915_driver;
1673 } else { 1669 else
1674 bridge->driver = &intel_845_driver; 1670 bridge->driver = &intel_845_driver;
1675 }
1676 name = "915GM"; 1671 name = "915GM";
1677 break; 1672 break;
1678 case PCI_DEVICE_ID_INTEL_82945G_HB: 1673 case PCI_DEVICE_ID_INTEL_82945G_HB:
1679 if (find_i830(PCI_DEVICE_ID_INTEL_82945G_IG)) { 1674 if (find_i830(PCI_DEVICE_ID_INTEL_82945G_IG))
1680 bridge->driver = &intel_915_driver; 1675 bridge->driver = &intel_915_driver;
1681 } else { 1676 else
1682 bridge->driver = &intel_845_driver; 1677 bridge->driver = &intel_845_driver;
1683 }
1684 name = "945G"; 1678 name = "945G";
1685 break; 1679 break;
1686 case PCI_DEVICE_ID_INTEL_82945GM_HB: 1680 case PCI_DEVICE_ID_INTEL_82945GM_HB:
1687 if (find_i830(PCI_DEVICE_ID_INTEL_82945GM_IG)) { 1681 if (find_i830(PCI_DEVICE_ID_INTEL_82945GM_IG))
1688 bridge->driver = &intel_915_driver; 1682 bridge->driver = &intel_915_driver;
1689 } else { 1683 else
1690 bridge->driver = &intel_845_driver; 1684 bridge->driver = &intel_845_driver;
1691 }
1692 name = "945GM"; 1685 name = "945GM";
1693 break; 1686 break;
1694 case PCI_DEVICE_ID_INTEL_7505_0: 1687 case PCI_DEVICE_ID_INTEL_7505_0:
@@ -1724,7 +1717,7 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
1724 */ 1717 */
1725 r = &pdev->resource[0]; 1718 r = &pdev->resource[0];
1726 if (!r->start && r->end) { 1719 if (!r->start && r->end) {
1727 if(pci_assign_resource(pdev, 0)) { 1720 if (pci_assign_resource(pdev, 0)) {
1728 printk(KERN_ERR PFX "could not assign resource 0\n"); 1721 printk(KERN_ERR PFX "could not assign resource 0\n");
1729 agp_put_bridge(bridge); 1722 agp_put_bridge(bridge);
1730 return -ENODEV; 1723 return -ENODEV;