[PATCH] drm/amdgpu: add judgement for suspend/resume sequence

Feng, Kenneth Kenneth.Feng at amd.com
Mon Dec 7 03:51:22 UTC 2020


[AMD Official Use Only - Internal Distribution Only]

Reviewed-by: Kenneth Feng <kenneth.feng at amd.com>


Best Regards
Kenneth

-----Original Message-----
From: Gao, Likun <Likun.Gao at amd.com> 
Sent: Monday, December 7, 2020 11:45 AM
To: amd-gfx at lists.freedesktop.org
Cc: Zhang, Hawking <Hawking.Zhang at amd.com>; Feng, Kenneth <Kenneth.Feng at amd.com>; Gao, Likun <Likun.Gao at amd.com>
Subject: [PATCH] drm/amdgpu: add judgement for suspend/resume sequence

From: Likun Gao <Likun.Gao at amd.com>

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 <Likun.Gao at amd.com>
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


More information about the amd-gfx mailing list