summaryrefslogtreecommitdiff
path: root/linux-core/radeon_drv.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2008-07-31 15:18:32 -0400
committerKristian Høgsberg <krh@redhat.com>2008-07-31 15:18:32 -0400
commit5052e966ec7fe5146c2d73b90482003619add5da (patch)
treea48e771871fd64a2892f5ce75e6e309b03db5e06 /linux-core/radeon_drv.c
parent6d4e147480a334d32fa59c7fde53e10d7ab6e106 (diff)
parent95c02743c96ca9e959f68a6e942206bdfadae53a (diff)
Merge commit 'origin/master' into modesetting-gem
Conflicts: linux-core/Makefile.kernel linux-core/ati_pcigart.c linux-core/drm_compat.h linux-core/drm_irq.c linux-core/drm_lock.c linux-core/i915_drv.c shared-core/i915_dma.c shared-core/i915_drv.h shared-core/i915_irq.c shared-core/nouveau_mem.c shared-core/radeon_cp.c shared-core/radeon_drv.h
Diffstat (limited to 'linux-core/radeon_drv.c')
-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 5f51c813..7676ca4c 100644
--- a/linux-core/radeon_drv.c
+++ b/linux-core/radeon_drv.c
@@ -59,6 +59,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
};
@@ -94,6 +116,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,