summaryrefslogtreecommitdiff
path: root/linux-core
diff options
context:
space:
mode:
authorStefan Becker <stefan.becker@nokia.com>2008-07-26 16:49:14 +0200
committerMichel Dänzer <michel@tungstengraphics.com>2008-07-26 16:49:14 +0200
commit514c05cebe31a62f827a76f348d35596bef97811 (patch)
tree244646d3fd9e5b907bf3c70b7a01ca92a17f60cf /linux-core
parentc3d463840c902a28221f1514bfb69fb7905a05c2 (diff)
radeon: Add suspend/resume hooks for saving/clearing/restoring interrupts.
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=16799 .
Diffstat (limited to 'linux-core')
-rw-r--r--linux-core/radeon_drv.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/linux-core/radeon_drv.c b/linux-core/radeon_drv.c
index f0f3320e..934fa0b9 100644
--- a/linux-core/radeon_drv.c
+++ b/linux-core/radeon_drv.c
@@ -52,6 +52,28 @@ static int dri_library_name(struct drm_device * dev, char * buf)
"r300"));
}
+static int radeon_suspend(struct drm_device *dev, pm_message_t state)
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+
+ /* Disable *all* interrupts */
+ if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RS690)
+ RADEON_WRITE(R500_DxMODE_INT_MASK, 0);
+ RADEON_WRITE(RADEON_GEN_INT_CNTL, 0);
+ return 0;
+}
+
+static int radeon_resume(struct drm_device *dev)
+{
+ drm_radeon_private_t *dev_priv = dev->dev_private;
+
+ /* Restore interrupt registers */
+ if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_RS690)
+ RADEON_WRITE(R500_DxMODE_INT_MASK, dev_priv->r500_disp_irq_reg);
+ RADEON_WRITE(RADEON_GEN_INT_CNTL, dev_priv->irq_enable_reg);
+ return 0;
+}
+
static struct pci_device_id pciidlist[] = {
radeon_PCI_IDS
};
@@ -69,6 +91,8 @@ static struct drm_driver driver = {
.postclose = radeon_driver_postclose,
.lastclose = radeon_driver_lastclose,
.unload = radeon_driver_unload,
+ .suspend = radeon_suspend,
+ .resume = radeon_resume,
.get_vblank_counter = radeon_get_vblank_counter,
.enable_vblank = radeon_enable_vblank,
.disable_vblank = radeon_disable_vblank,