diff options
author | Yang Zhao <yang@yangman.ca> | 2009-09-15 12:21:01 +1000 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2009-09-16 10:21:35 +1000 |
commit | f657c2a7310ad56e2b67f35f4c5c6106a7146b9c (patch) | |
tree | ae1d2b409de5a472842de2decf5965658aac0c82 /drivers/gpu/drm/radeon/radeon_atombios.c | |
parent | ecb114a128d150422d22eda238cb812f6b20bf39 (diff) | |
download | kernel-crypto-f657c2a7310ad56e2b67f35f4c5c6106a7146b9c.tar.gz kernel-crypto-f657c2a7310ad56e2b67f35f4c5c6106a7146b9c.tar.xz kernel-crypto-f657c2a7310ad56e2b67f35f4c5c6106a7146b9c.zip |
drm/radeon: Save and restore bios scratch regs during S/R
[airlied:- adapted slightly in naming]
Signed-off-by: Yang Zhao <yang@yangman.ca>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_atombios.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_atombios.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_atombios.c b/drivers/gpu/drm/radeon/radeon_atombios.c index aa756dec895..cb5efcaf2ba 100644 --- a/drivers/gpu/drm/radeon/radeon_atombios.c +++ b/drivers/gpu/drm/radeon/radeon_atombios.c @@ -1045,6 +1045,34 @@ void radeon_atom_initialize_bios_scratch_regs(struct drm_device *dev) } +void radeon_save_bios_scratch_regs(struct radeon_device *rdev) +{ + uint32_t scratch_reg; + int i; + + if (rdev->family >= CHIP_R600) + scratch_reg = R600_BIOS_0_SCRATCH; + else + scratch_reg = RADEON_BIOS_0_SCRATCH; + + for (i = 0; i < RADEON_BIOS_NUM_SCRATCH; i++) + rdev->bios_scratch[i] = RREG32(scratch_reg + (i * 4)); +} + +void radeon_restore_bios_scratch_regs(struct radeon_device *rdev) +{ + uint32_t scratch_reg; + int i; + + if (rdev->family >= CHIP_R600) + scratch_reg = R600_BIOS_0_SCRATCH; + else + scratch_reg = RADEON_BIOS_0_SCRATCH; + + for (i = 0; i < RADEON_BIOS_NUM_SCRATCH; i++) + WREG32(scratch_reg + (i * 4), rdev->bios_scratch[i]); +} + void radeon_atom_output_lock(struct drm_encoder *encoder, bool lock) { struct drm_device *dev = encoder->dev; |