No functional change.

v2: use correct dev
v3: rework

Signed-off-by: Alex Deucher <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 80263bb8a631..2f34628e15bd 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2699,6 +2699,11 @@ static int amdgpu_device_ip_suspend_phase2(struct 
amdgpu_device *adev)
 {
        int i, r;
 
+       if (adev->in_s0ix) {
+               amdgpu_gfx_state_change_set(adev, sGpuChangeState_D3Entry);
+               return 0;
+       }
+
        for (i = adev->num_ip_blocks - 1; i >= 0; i--) {
                if (!adev->ip_blocks[i].status.valid)
                        continue;
@@ -3692,10 +3697,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool 
fbcon)
 
        amdgpu_fence_driver_suspend(adev);
 
-       if (!adev->in_s0ix || amdgpu_in_reset(adev))
-               r = amdgpu_device_ip_suspend_phase2(adev);
-       else
-               amdgpu_gfx_state_change_set(adev, sGpuChangeState_D3Entry);
+       r = amdgpu_device_ip_suspend_phase2(adev);
        /* evict remaining vram memory
         * This second call to evict vram is to evict the gart page table
         * using the CPU.
-- 
2.30.2

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to