[AMD Official Use Only - Internal Distribution Only]

Reviewed-by: Kenneth Feng <[email protected]>


Best Regards
Kenneth

-----Original Message-----
From: Gao, Likun <[email protected]> 
Sent: Monday, December 7, 2020 11:45 AM
To: [email protected]
Cc: Zhang, Hawking <[email protected]>; Feng, Kenneth 
<[email protected]>; Gao, Likun <[email protected]>
Subject: [PATCH] drm/amdgpu: add judgement for suspend/resume sequence

From: Likun Gao <[email protected]>

Only APU should deal with the situation that amdgpu suspend/resume with
s0i3 support to skip RLC/CP/GFX disable during suspend.

Signed-off-by: Likun Gao <[email protected]>
Change-Id: Icca91b3497f12a6d78f005ee63461cf0e8f24958
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 79dd85f71fab..75f40a8c59f6 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -2650,7 +2650,8 @@ static int amdgpu_device_ip_suspend_phase1(struct 
amdgpu_device *adev)  {
        int i, r;
 
-       if (!amdgpu_acpi_is_s0ix_supported() || amdgpu_in_reset(adev)) {
+       if (!amdgpu_acpi_is_s0ix_supported() || amdgpu_in_reset(adev) ||
+           !(adev->flags & AMD_IS_APU)) {
                amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE);
                amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE);
        }
@@ -3710,7 +3711,8 @@ int amdgpu_device_suspend(struct drm_device *dev, bool 
fbcon)
 
        amdgpu_fence_driver_suspend(adev);
 
-       if (!amdgpu_acpi_is_s0ix_supported() || amdgpu_in_reset(adev))
+       if (!amdgpu_acpi_is_s0ix_supported() || amdgpu_in_reset(adev) ||
+           !(adev->flags & AMD_IS_APU))
                r = amdgpu_device_ip_suspend_phase2(adev);
        else
                amdgpu_gfx_state_change_set(adev, sGpuChangeState_D3Entry); @@ 
-3744,7 +3746,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool fbcon)
        if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
                return 0;
 
-       if (amdgpu_acpi_is_s0ix_supported())
+       if (amdgpu_acpi_is_s0ix_supported() && (adev->flags & AMD_IS_APU))
                amdgpu_gfx_state_change_set(adev, sGpuChangeState_D0Entry);
 
        /* post card */
--
2.25.1
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to