diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2017-05-05 10:21:36 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-05-10 11:23:17 -0400 |
commit | de70c6357be23261c18fcccfd2ad148512fedd28 (patch) | |
tree | 61d0e145cc11b3170bdc218e21f5503b48aad712 /drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | |
parent | 634b6a8a064576797120b74facf95ba79283b5d5 (diff) |
drm/amdgpu/atomfirmware: add function to update engine hang status
Update the scratch reg for when the engine is hung.
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Acked-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_atomfirmware.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c index d735cd1807b3..4bdda56fccee 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atomfirmware.c | |||
@@ -88,6 +88,19 @@ void amdgpu_atomfirmware_scratch_regs_restore(struct amdgpu_device *adev) | |||
88 | WREG32(adev->bios_scratch_reg_offset + i, adev->bios_scratch[i]); | 88 | WREG32(adev->bios_scratch_reg_offset + i, adev->bios_scratch[i]); |
89 | } | 89 | } |
90 | 90 | ||
91 | void amdgpu_atomfirmware_scratch_regs_engine_hung(struct amdgpu_device *adev, | ||
92 | bool hung) | ||
93 | { | ||
94 | u32 tmp = RREG32(adev->bios_scratch_reg_offset + 3); | ||
95 | |||
96 | if (hung) | ||
97 | tmp |= ATOM_S3_ASIC_GUI_ENGINE_HUNG; | ||
98 | else | ||
99 | tmp &= ~ATOM_S3_ASIC_GUI_ENGINE_HUNG; | ||
100 | |||
101 | WREG32(adev->bios_scratch_reg_offset + 3, tmp); | ||
102 | } | ||
103 | |||
91 | int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev) | 104 | int amdgpu_atomfirmware_allocate_fb_scratch(struct amdgpu_device *adev) |
92 | { | 105 | { |
93 | struct atom_context *ctx = adev->mode_info.atom_context; | 106 | struct atom_context *ctx = adev->mode_info.atom_context; |