All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: add judgement for suspend/resume sequence
@ 2020-12-07  3:45 Likun Gao
  2020-12-07  3:51 ` Feng, Kenneth
  2020-12-09  3:14 ` Alex Deucher
  0 siblings, 2 replies; 3+ messages in thread
From: Likun Gao @ 2020-12-07  3:45 UTC (permalink / raw)
  To: amd-gfx; +Cc: Likun Gao, Kenneth Feng, Hawking Zhang

From: Likun Gao <Likun.Gao@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@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

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] drm/amdgpu: add judgement for suspend/resume sequence
  2020-12-07  3:45 [PATCH] drm/amdgpu: add judgement for suspend/resume sequence Likun Gao
@ 2020-12-07  3:51 ` Feng, Kenneth
  2020-12-09  3:14 ` Alex Deucher
  1 sibling, 0 replies; 3+ messages in thread
From: Feng, Kenneth @ 2020-12-07  3:51 UTC (permalink / raw)
  To: Gao, Likun, amd-gfx; +Cc: Zhang, Hawking

[AMD Official Use Only - Internal Distribution Only]

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


Best Regards
Kenneth

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

From: Likun Gao <Likun.Gao@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@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
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdgpu: add judgement for suspend/resume sequence
  2020-12-07  3:45 [PATCH] drm/amdgpu: add judgement for suspend/resume sequence Likun Gao
  2020-12-07  3:51 ` Feng, Kenneth
@ 2020-12-09  3:14 ` Alex Deucher
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2020-12-09  3:14 UTC (permalink / raw)
  To: Likun Gao; +Cc: Kenneth Feng, amd-gfx list, Hawking Zhang

On Sun, Dec 6, 2020 at 10:45 PM Likun Gao <likun.gao@amd.com> wrote:
>
> From: Likun Gao <Likun.Gao@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@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)) {

Could we just add the APU check to amdgpu_acpi_is_s0ix_supported()
directly?  S0ix only makes sense on APUs since they are part of the
platform.  That would simplify the checks and handle any future uses.

Alex

>                 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
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-09  3:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-07  3:45 [PATCH] drm/amdgpu: add judgement for suspend/resume sequence Likun Gao
2020-12-07  3:51 ` Feng, Kenneth
2020-12-09  3:14 ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.