diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2016-10-21 15:45:22 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-10-25 14:38:56 -0400 |
commit | 72a57438d1b4a17dc2f3743fcbb8f0b473a63373 (patch) | |
tree | f91b6c8067ee01d05f29225f9b44a295541de42c /drivers/gpu/drm/amd/amdgpu/cik.c | |
parent | a76ed485c57e37d22c7f47eb63120b3618930297 (diff) |
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/cik.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/cik.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/cik.c b/drivers/gpu/drm/amd/amdgpu/cik.c index 1b70f8fa4280..302df85893ab 100644 --- a/drivers/gpu/drm/amd/amdgpu/cik.c +++ b/drivers/gpu/drm/amd/amdgpu/cik.c | |||
@@ -1189,18 +1189,6 @@ static int cik_gpu_pci_config_reset(struct amdgpu_device *adev) | |||
1189 | return r; | 1189 | return r; |
1190 | } | 1190 | } |
1191 | 1191 | ||
1192 | static void cik_set_bios_scratch_engine_hung(struct amdgpu_device *adev, bool hung) | ||
1193 | { | ||
1194 | u32 tmp = RREG32(mmBIOS_SCRATCH_3); | ||
1195 | |||
1196 | if (hung) | ||
1197 | tmp |= ATOM_S3_ASIC_GUI_ENGINE_HUNG; | ||
1198 | else | ||
1199 | tmp &= ~ATOM_S3_ASIC_GUI_ENGINE_HUNG; | ||
1200 | |||
1201 | WREG32(mmBIOS_SCRATCH_3, tmp); | ||
1202 | } | ||
1203 | |||
1204 | /** | 1192 | /** |
1205 | * cik_asic_reset - soft reset GPU | 1193 | * cik_asic_reset - soft reset GPU |
1206 | * | 1194 | * |
@@ -1213,11 +1201,12 @@ static void cik_set_bios_scratch_engine_hung(struct amdgpu_device *adev, bool hu | |||
1213 | static int cik_asic_reset(struct amdgpu_device *adev) | 1201 | static int cik_asic_reset(struct amdgpu_device *adev) |
1214 | { | 1202 | { |
1215 | int r; | 1203 | int r; |
1216 | cik_set_bios_scratch_engine_hung(adev, true); | 1204 | |
1205 | amdgpu_atombios_scratch_regs_engine_hung(adev, true); | ||
1217 | 1206 | ||
1218 | r = cik_gpu_pci_config_reset(adev); | 1207 | r = cik_gpu_pci_config_reset(adev); |
1219 | 1208 | ||
1220 | cik_set_bios_scratch_engine_hung(adev, false); | 1209 | amdgpu_atombios_scratch_regs_engine_hung(adev, false); |
1221 | 1210 | ||
1222 | return r; | 1211 | return r; |
1223 | } | 1212 | } |