[PATCH] drm/amdgpu: move bios scratch reg restore for soc15
Alex Deucher
alexdeucher at gmail.com
Thu Apr 6 03:24:48 UTC 2017
It needs to happen after asic_init as asic_init expects
the registers to be in the default power up state.
This should fix S3 on vega10.
Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index d78c523..18e1ddd 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2247,9 +2247,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon)
return r;
}
}
- if (adev->is_atom_fw)
- amdgpu_atomfirmware_scratch_regs_restore(adev);
- else
+ if (!adev->is_atom_fw)
amdgpu_atombios_scratch_regs_restore(adev);
/* post card */
@@ -2259,6 +2257,9 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon)
DRM_ERROR("amdgpu asic init failed\n");
}
+ if (adev->is_atom_fw)
+ amdgpu_atomfirmware_scratch_regs_restore(adev);
+
r = amdgpu_resume(adev);
if (r) {
DRM_ERROR("amdgpu_resume failed (%d).\n", r);
@@ -2641,12 +2642,12 @@ int amdgpu_gpu_reset(struct amdgpu_device *adev)
else
amdgpu_atombios_scratch_regs_save(adev);
r = amdgpu_asic_reset(adev);
- if (adev->is_atom_fw)
- amdgpu_atomfirmware_scratch_regs_restore(adev);
- else
+ if (!adev->is_atom_fw)
amdgpu_atombios_scratch_regs_restore(adev);
/* post card */
amdgpu_atom_asic_init(adev->mode_info.atom_context);
+ if (adev->is_atom_fw)
+ amdgpu_atomfirmware_scratch_regs_restore(adev);
if (!r) {
dev_info(adev->dev, "GPU reset succeeded, trying to resume\n");
--
2.5.5
More information about the amd-gfx
mailing list