diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2017-06-30 17:08:45 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-07-14 11:06:04 -0400 |
commit | d05da0e24bb584baf634489810561fc3d2a83bf3 (patch) | |
tree | 36d59a326acc891ebe230e6b0311df1283071144 /drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |
parent | 3164cba317c235f950c861928b290dd93b30d821 (diff) |
drm/amdgpu: unify some atombios/atomfirmware scratch reg functions
Now that we use a pointer to the scratch reg start offset,
most of the functions were duplicated.
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_device.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 88e45c6d36ea..7963c54e5d03 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |||
@@ -2393,10 +2393,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon) | |||
2393 | */ | 2393 | */ |
2394 | amdgpu_bo_evict_vram(adev); | 2394 | amdgpu_bo_evict_vram(adev); |
2395 | 2395 | ||
2396 | if (adev->is_atom_fw) | 2396 | amdgpu_atombios_scratch_regs_save(adev); |
2397 | amdgpu_atomfirmware_scratch_regs_save(adev); | ||
2398 | else | ||
2399 | amdgpu_atombios_scratch_regs_save(adev); | ||
2400 | pci_save_state(dev->pdev); | 2397 | pci_save_state(dev->pdev); |
2401 | if (suspend) { | 2398 | if (suspend) { |
2402 | /* Shut down the device */ | 2399 | /* Shut down the device */ |
@@ -2445,10 +2442,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon) | |||
2445 | if (r) | 2442 | if (r) |
2446 | goto unlock; | 2443 | goto unlock; |
2447 | } | 2444 | } |
2448 | if (adev->is_atom_fw) | 2445 | amdgpu_atombios_scratch_regs_restore(adev); |
2449 | amdgpu_atomfirmware_scratch_regs_restore(adev); | ||
2450 | else | ||
2451 | amdgpu_atombios_scratch_regs_restore(adev); | ||
2452 | 2446 | ||
2453 | /* post card */ | 2447 | /* post card */ |
2454 | if (amdgpu_need_post(adev)) { | 2448 | if (amdgpu_need_post(adev)) { |
@@ -2861,15 +2855,9 @@ int amdgpu_gpu_reset(struct amdgpu_device *adev) | |||
2861 | r = amdgpu_suspend(adev); | 2855 | r = amdgpu_suspend(adev); |
2862 | 2856 | ||
2863 | retry: | 2857 | retry: |
2864 | if (adev->is_atom_fw) | 2858 | amdgpu_atombios_scratch_regs_save(adev); |
2865 | amdgpu_atomfirmware_scratch_regs_save(adev); | ||
2866 | else | ||
2867 | amdgpu_atombios_scratch_regs_save(adev); | ||
2868 | r = amdgpu_asic_reset(adev); | 2859 | r = amdgpu_asic_reset(adev); |
2869 | if (adev->is_atom_fw) | 2860 | amdgpu_atombios_scratch_regs_restore(adev); |
2870 | amdgpu_atomfirmware_scratch_regs_restore(adev); | ||
2871 | else | ||
2872 | amdgpu_atombios_scratch_regs_restore(adev); | ||
2873 | /* post card */ | 2861 | /* post card */ |
2874 | amdgpu_atom_asic_init(adev->mode_info.atom_context); | 2862 | amdgpu_atom_asic_init(adev->mode_info.atom_context); |
2875 | 2863 | ||