diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2017-03-03 14:26:51 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-03-29 23:54:35 -0400 |
commit | be34d3bfe35d108c32b7e5b03ca6fbb5917e962d (patch) | |
tree | b584731c625655e5c7fe770a302cf77460b923ea | |
parent | 66e02bc343bafac589875a72607a1ae6c4d25bcb (diff) |
drm/amdgpu: use atomfirmware interfaces for scratch reg save/restore
If the board is atomfirmware based.
Acked-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index df73cddf8867..dd9f493006df 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |||
@@ -2156,7 +2156,10 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon) | |||
2156 | */ | 2156 | */ |
2157 | amdgpu_bo_evict_vram(adev); | 2157 | amdgpu_bo_evict_vram(adev); |
2158 | 2158 | ||
2159 | amdgpu_atombios_scratch_regs_save(adev); | 2159 | if (adev->is_atom_fw) |
2160 | amdgpu_atomfirmware_scratch_regs_save(adev); | ||
2161 | else | ||
2162 | amdgpu_atombios_scratch_regs_save(adev); | ||
2160 | pci_save_state(dev->pdev); | 2163 | pci_save_state(dev->pdev); |
2161 | if (suspend) { | 2164 | if (suspend) { |
2162 | /* Shut down the device */ | 2165 | /* Shut down the device */ |
@@ -2208,7 +2211,10 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon) | |||
2208 | return r; | 2211 | return r; |
2209 | } | 2212 | } |
2210 | } | 2213 | } |
2211 | amdgpu_atombios_scratch_regs_restore(adev); | 2214 | if (adev->is_atom_fw) |
2215 | amdgpu_atomfirmware_scratch_regs_restore(adev); | ||
2216 | else | ||
2217 | amdgpu_atombios_scratch_regs_restore(adev); | ||
2212 | 2218 | ||
2213 | /* post card */ | 2219 | /* post card */ |
2214 | if (amdgpu_need_post(adev)) { | 2220 | if (amdgpu_need_post(adev)) { |
@@ -2593,9 +2599,15 @@ retry: | |||
2593 | amdgpu_display_stop_mc_access(adev, &save); | 2599 | amdgpu_display_stop_mc_access(adev, &save); |
2594 | amdgpu_wait_for_idle(adev, AMD_IP_BLOCK_TYPE_GMC); | 2600 | amdgpu_wait_for_idle(adev, AMD_IP_BLOCK_TYPE_GMC); |
2595 | } | 2601 | } |
2596 | amdgpu_atombios_scratch_regs_save(adev); | 2602 | if (adev->is_atom_fw) |
2603 | amdgpu_atomfirmware_scratch_regs_save(adev); | ||
2604 | else | ||
2605 | amdgpu_atombios_scratch_regs_save(adev); | ||
2597 | r = amdgpu_asic_reset(adev); | 2606 | r = amdgpu_asic_reset(adev); |
2598 | amdgpu_atombios_scratch_regs_restore(adev); | 2607 | if (adev->is_atom_fw) |
2608 | amdgpu_atomfirmware_scratch_regs_restore(adev); | ||
2609 | else | ||
2610 | amdgpu_atombios_scratch_regs_restore(adev); | ||
2599 | /* post card */ | 2611 | /* post card */ |
2600 | amdgpu_atom_asic_init(adev->mode_info.atom_context); | 2612 | amdgpu_atom_asic_init(adev->mode_info.atom_context); |
2601 | 2613 | ||