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>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user