Commit 82991c6f authored by Linus Torvalds's avatar Linus Torvalds

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

* master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart:
  [AGPGART] Make AGP depend on PCI
  [AGPGART] remove unused variable
  [AGPGART] Fix pci_register_driver checking in amd64-agp
  [AGPGART] Compile fix for ati-agp
  [AGPGART] Suspend/Resume support for nVidia nForce AGP.
  [AGPGART] Suspend/Resume improvements for ATI AGP
  [AGPGART] Whitespace cleanups for ati-agp
parents 8d231c11 55b4d6a5
config AGP
tristate "/dev/agpgart (AGP Support)"
depends on ALPHA || IA64 || PPC || X86
depends on PCI
---help---
AGP (Accelerated Graphics Port) is a bus system mainly used to
connect graphics cards to the rest of the system.
......
......@@ -734,7 +734,7 @@ int __init agp_amd64_init(void)
if (agp_off)
return -EINVAL;
if (pci_register_driver(&agp_amd64_pci_driver) > 0) {
if (pci_register_driver(&agp_amd64_pci_driver) < 0) {
struct pci_dev *dev;
if (!agp_try_unsupported && !agp_try_unsupported_boot) {
printk(KERN_INFO PFX "No supported AGP bridge found.\n");
......
......@@ -41,7 +41,6 @@ static struct gatt_mask ati_generic_masks[] =
};
typedef struct _ati_page_map {
unsigned long *real;
unsigned long __iomem *remapped;
......@@ -141,7 +140,8 @@ static int ati_create_gatt_pages(int nr_tables)
ati_generic_private.num_tables = nr_tables;
ati_generic_private.gatt_pages = tables;
if (retval != 0) ati_free_gatt_pages();
if (retval != 0)
ati_free_gatt_pages();
return retval;
}
......@@ -245,18 +245,20 @@ static int ati_configure(void)
#ifdef CONFIG_PM
static int agp_ati_resume(struct pci_dev *dev)
static int agp_ati_suspend(struct pci_dev *dev, pm_message_t state)
{
pci_restore_state(dev);
pci_save_state(dev);
pci_set_power_state(dev, 3);
return ati_configure();
return 0;
}
static int agp_ati_suspend(struct pci_dev *dev, pm_message_t state)
static int agp_ati_resume(struct pci_dev *dev)
{
pci_save_state(dev);
pci_set_power_state(dev, 0);
pci_restore_state(dev);
return 0;
return ati_configure();
}
#endif
......@@ -321,9 +323,9 @@ static int ati_remove_memory(struct agp_memory * mem, off_t pg_start,
unsigned long __iomem *cur_gatt;
unsigned long addr;
if (type != 0 || mem->type != 0) {
if (type != 0 || mem->type != 0)
return -EINVAL;
}
for (i = pg_start; i < (mem->page_count + pg_start); i++) {
addr = (i * PAGE_SIZE) + agp_bridge->gart_bus_addr;
cur_gatt = GET_GATT(addr);
......@@ -505,7 +507,6 @@ found:
bridge->driver = &ati_generic_bridge;
printk(KERN_INFO PFX "Detected Ati %s chipset\n",
devs[j].chipset_name);
......@@ -546,8 +547,8 @@ static struct pci_driver agp_ati_pci_driver = {
.probe = agp_ati_probe,
.remove = agp_ati_remove,
#ifdef CONFIG_PM
.resume = agp_ati_resume,
.suspend = agp_ati_suspend,
.resume = agp_ati_resume,
#endif
};
......
......@@ -376,6 +376,29 @@ static void __devexit agp_nvidia_remove(struct pci_dev *pdev)
agp_put_bridge(bridge);
}
#ifdef CONFIG_PM
static int agp_nvidia_suspend(struct pci_dev *pdev, pm_message_t state)
{
pci_save_state (pdev);
pci_set_power_state (pdev, 3);
return 0;
}
static int agp_nvidia_resume(struct pci_dev *pdev)
{
/* set power state 0 and restore PCI space */
pci_set_power_state (pdev, 0);
pci_restore_state(pdev);
/* reconfigure AGP hardware again */
nvidia_configure();
return 0;
}
#endif
static struct pci_device_id agp_nvidia_pci_table[] = {
{
.class = (PCI_CLASS_BRIDGE_HOST << 8),
......@@ -403,6 +426,10 @@ static struct pci_driver agp_nvidia_pci_driver = {
.id_table = agp_nvidia_pci_table,
.probe = agp_nvidia_probe,
.remove = agp_nvidia_remove,
#ifdef CONFIG_PM
.suspend = agp_nvidia_suspend,
.resume = agp_nvidia_resume,
#endif
};
static int __init agp_nvidia_init(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment