diff options
author | akpm@osdl.org <akpm@osdl.org> | 2006-01-04 02:00:10 -0500 |
---|---|---|
committer | Dave Jones <davej@redhat.com> | 2006-01-16 23:53:45 -0500 |
commit | 90be4b49b8b54505772a6a766ac0891ec92b4c2d (patch) | |
tree | f3d679d5be9a2694b226ac255170b1fb2e06ec37 /drivers/char/agp/amd64-agp.c | |
parent | 496ebd386439fee838df6b9c7d1306c36e7f6952 (diff) |
[AGPGART] Suspend/Resume support for AMD64 GART.
This adds support for suspend/resume to the amd64-agp driver. Without
it, X displays garbage after resume from swsusp.
Signed-off-by: Michal Schmidt <xschmi00@stud.feec.vutbr.cz>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Dave Jones <davej@redhat.com>
Diffstat (limited to 'drivers/char/agp/amd64-agp.c')
-rw-r--r-- | drivers/char/agp/amd64-agp.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c index 810679dcbbb0..9964c508c111 100644 --- a/drivers/char/agp/amd64-agp.c +++ b/drivers/char/agp/amd64-agp.c | |||
@@ -600,6 +600,26 @@ static void __devexit agp_amd64_remove(struct pci_dev *pdev) | |||
600 | agp_put_bridge(bridge); | 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 | static struct pci_device_id agp_amd64_pci_table[] = { | 623 | static struct pci_device_id agp_amd64_pci_table[] = { |
604 | { | 624 | { |
605 | .class = (PCI_CLASS_BRIDGE_HOST << 8), | 625 | .class = (PCI_CLASS_BRIDGE_HOST << 8), |
@@ -718,6 +738,10 @@ static struct pci_driver agp_amd64_pci_driver = { | |||
718 | .id_table = agp_amd64_pci_table, | 738 | .id_table = agp_amd64_pci_table, |
719 | .probe = agp_amd64_probe, | 739 | .probe = agp_amd64_probe, |
720 | .remove = agp_amd64_remove, | 740 | .remove = agp_amd64_remove, |
741 | #ifdef CONFIG_PM | ||
742 | .suspend = agp_amd64_suspend, | ||
743 | .resume = agp_amd64_resume, | ||
744 | #endif | ||
721 | }; | 745 | }; |
722 | 746 | ||
723 | 747 | ||