diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2016-10-21 21:45:22 +0200 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-10-25 20:38:56 +0200 |
commit | 72a57438d1b4a17dc2f3743fcbb8f0b473a63373 (patch) | |
tree | f91b6c8067ee01d05f29225f9b44a295541de42c /drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | |
parent | drm/amdgpu: use amdgpu_bo_[create|free]_kernel for wb (diff) | |
download | linux-72a57438d1b4a17dc2f3743fcbb8f0b473a63373.tar.xz linux-72a57438d1b4a17dc2f3743fcbb8f0b473a63373.zip |
drm/amdgpu: consolidate atom scratch reg handling for hangs
Move from asic specific code to common atom code.
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c index 8e6bf548d689..76cbb1d08bce 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c @@ -1784,6 +1784,19 @@ void amdgpu_atombios_scratch_regs_restore(struct amdgpu_device *adev) WREG32(mmBIOS_SCRATCH_0 + i, adev->bios_scratch[i]); } +void amdgpu_atombios_scratch_regs_engine_hung(struct amdgpu_device *adev, + bool hung) +{ + u32 tmp = RREG32(mmBIOS_SCRATCH_3); + + if (hung) + tmp |= ATOM_S3_ASIC_GUI_ENGINE_HUNG; + else + tmp &= ~ATOM_S3_ASIC_GUI_ENGINE_HUNG; + + WREG32(mmBIOS_SCRATCH_3, tmp); +} + /* Atom needs data in little endian format * so swap as appropriate when copying data to * or from atom. Note that atom operates on |