All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/powerpay: Disable gfxoff when setting manual mode on picasso and raven
@ 2020-05-21 10:43 chen gong
  2020-05-21 17:00 ` Alex Deucher
  0 siblings, 1 reply; 4+ messages in thread
From: chen gong @ 2020-05-21 10:43 UTC (permalink / raw)
  To: amd-gfx; +Cc: chen gong

[Problem description]
1. Boot up picasso platform, launches desktop, Don't do anything (APU enter into "gfxoff" state)
2. Remote login to platform using SSH, then type the command line:
	sudo su -c "echo manual > /sys/class/drm/card0/device/power_dpm_force_performance_level"
	sudo su -c "echo 2 > /sys/class/drm/card0/device/pp_dpm_sclk" (fix SCLK to 1400MHz)
3. Move the mouse around in Window
4. Phenomenon :  The screen frozen

Tester will switch sclk level during glmark2 run time.
APU will enter "gfxoff" state intermittently during glmark2 run time.
The system got hanged if fix GFXCLK to 1400MHz when APU is in "gfxoff"
state.

[Debug]
1. Fix SCLK to X MHz
	1400: screen frozen, screen black, then OS will reboot.
	1300: screen frozen.
	1200: screen frozen, screen black.
	1100: screen frozen, screen black, then OS will reboot.
	1000: screen frozen, screen black.
	900:  screen frozen, screen black, then OS will reboot.
	800:  Situation Nomal, issue disappear.
	700:  Situation Nomal, issue disappear.
2. SBIOS setting: AMD CBS --> SMU Debug Options -->SMU Debug --> "GFX DLDO Psm Margin Control":
	50 : Situation Nomal, issue disappear.
	45 : Situation Nomal, issue disappear.
	40 : Situation Nomal, issue disappear.
	35 : Situation Nomal, issue disappear.
	30 : screen black.
	25 : screen frozen, then blurred screen.
	20 : screen frozen.
	15 : screen black.
	10 : screen frozen.
	5  : screen frozen, then blurred screen.
3. Disable GFXOFF feature
	Situation Nomal, issue disappear.

[Why]
Through a period of time debugging with Sys Eng team and SMU team, Sys
Eng team said this is voltage/frequency marginal issue not a F/W or H/W
bug. This experiment proves that default targetPsm [for f=1400MHz] is
not sufficient when GFXOFF is enabled on Picasso.

SMU team think it is an odd test conditions to force sclk="1400MHz" when
GPU is in "gfxoff" state,then wake up the GFX. SCLK should be in the
"lowest frequency" when gfxoff.

[How]
Disable gfxoff when setting manual mode.
Enable gfxoff when setting other mode(exiting manual mode) again.

By the way, from the user point of view, now that user switch to manual
mode and force SCLK Frequency, he don't want SCLK be controlled by
workload.It becomes meaningless to "switch to manual mode" if APU enter "gfxoff"
due to lack of workload at this point.

Tips: Same issue observed on Raven.

Signed-off-by: chen gong <curry.gong@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
index 17bc7f5..d45394c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
@@ -371,6 +371,15 @@ static ssize_t amdgpu_set_power_dpm_force_performance_level(struct device *dev,
 		return count;
 	}
 
+	if(adev->asic_type == CHIP_RAVEN){
+		if (adev->rev_id < 8){
+			if (current_level != AMD_DPM_FORCED_LEVEL_MANUAL && level == AMD_DPM_FORCED_LEVEL_MANUAL)
+				amdgpu_gfx_off_ctrl(adev, false);
+			else if (current_level == AMD_DPM_FORCED_LEVEL_MANUAL && level != AMD_DPM_FORCED_LEVEL_MANUAL)
+				amdgpu_gfx_off_ctrl(adev, true);
+		}
+	}
+
 	/* profile_exit setting is valid only when current mode is in profile mode */
 	if (!(current_level & (AMD_DPM_FORCED_LEVEL_PROFILE_STANDARD |
 	    AMD_DPM_FORCED_LEVEL_PROFILE_MIN_SCLK |
-- 
2.7.4

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

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

* Re: [PATCH] drm/amd/powerpay: Disable gfxoff when setting manual mode on picasso and raven
  2020-05-21 10:43 [PATCH] drm/amd/powerpay: Disable gfxoff when setting manual mode on picasso and raven chen gong
@ 2020-05-21 17:00 ` Alex Deucher
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2020-05-21 17:00 UTC (permalink / raw)
  To: chen gong; +Cc: amd-gfx list

On Thu, May 21, 2020 at 6:43 AM chen gong <curry.gong@amd.com> wrote:
>
> [Problem description]
> 1. Boot up picasso platform, launches desktop, Don't do anything (APU enter into "gfxoff" state)
> 2. Remote login to platform using SSH, then type the command line:
>         sudo su -c "echo manual > /sys/class/drm/card0/device/power_dpm_force_performance_level"
>         sudo su -c "echo 2 > /sys/class/drm/card0/device/pp_dpm_sclk" (fix SCLK to 1400MHz)
> 3. Move the mouse around in Window
> 4. Phenomenon :  The screen frozen
>
> Tester will switch sclk level during glmark2 run time.
> APU will enter "gfxoff" state intermittently during glmark2 run time.
> The system got hanged if fix GFXCLK to 1400MHz when APU is in "gfxoff"
> state.
>
> [Debug]
> 1. Fix SCLK to X MHz
>         1400: screen frozen, screen black, then OS will reboot.
>         1300: screen frozen.
>         1200: screen frozen, screen black.
>         1100: screen frozen, screen black, then OS will reboot.
>         1000: screen frozen, screen black.
>         900:  screen frozen, screen black, then OS will reboot.
>         800:  Situation Nomal, issue disappear.
>         700:  Situation Nomal, issue disappear.
> 2. SBIOS setting: AMD CBS --> SMU Debug Options -->SMU Debug --> "GFX DLDO Psm Margin Control":
>         50 : Situation Nomal, issue disappear.
>         45 : Situation Nomal, issue disappear.
>         40 : Situation Nomal, issue disappear.
>         35 : Situation Nomal, issue disappear.
>         30 : screen black.
>         25 : screen frozen, then blurred screen.
>         20 : screen frozen.
>         15 : screen black.
>         10 : screen frozen.
>         5  : screen frozen, then blurred screen.
> 3. Disable GFXOFF feature
>         Situation Nomal, issue disappear.
>
> [Why]
> Through a period of time debugging with Sys Eng team and SMU team, Sys
> Eng team said this is voltage/frequency marginal issue not a F/W or H/W
> bug. This experiment proves that default targetPsm [for f=1400MHz] is
> not sufficient when GFXOFF is enabled on Picasso.
>
> SMU team think it is an odd test conditions to force sclk="1400MHz" when
> GPU is in "gfxoff" state,then wake up the GFX. SCLK should be in the
> "lowest frequency" when gfxoff.
>
> [How]
> Disable gfxoff when setting manual mode.
> Enable gfxoff when setting other mode(exiting manual mode) again.
>
> By the way, from the user point of view, now that user switch to manual
> mode and force SCLK Frequency, he don't want SCLK be controlled by
> workload.It becomes meaningless to "switch to manual mode" if APU enter "gfxoff"
> due to lack of workload at this point.
>
> Tips: Same issue observed on Raven.
>
> Signed-off-by: chen gong <curry.gong@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
> index 17bc7f5..d45394c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c
> @@ -371,6 +371,15 @@ static ssize_t amdgpu_set_power_dpm_force_performance_level(struct device *dev,
>                 return count;
>         }
>
> +       if(adev->asic_type == CHIP_RAVEN){

missing spaces around ().  I.e., should be:
+       if (adev->asic_type == CHIP_RAVEN) {

> +               if (adev->rev_id < 8){

Missing space after ).  I.e., should be:
+               if (adev->rev_id < 8) {

With those fixed, patch is:
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> +                       if (current_level != AMD_DPM_FORCED_LEVEL_MANUAL && level == AMD_DPM_FORCED_LEVEL_MANUAL)
> +                               amdgpu_gfx_off_ctrl(adev, false);
> +                       else if (current_level == AMD_DPM_FORCED_LEVEL_MANUAL && level != AMD_DPM_FORCED_LEVEL_MANUAL)
> +                               amdgpu_gfx_off_ctrl(adev, true);
> +               }
> +       }
> +
>         /* profile_exit setting is valid only when current mode is in profile mode */
>         if (!(current_level & (AMD_DPM_FORCED_LEVEL_PROFILE_STANDARD |
>             AMD_DPM_FORCED_LEVEL_PROFILE_MIN_SCLK |
> --
> 2.7.4
>
> _______________________________________________
> 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] 4+ messages in thread

* Re: [PATCH] drm/amd/powerpay: Disable gfxoff when setting manual mode on picasso and raven
  2020-05-20  8:31 chen gong
@ 2020-05-20 14:57 ` Alex Deucher
  0 siblings, 0 replies; 4+ messages in thread
From: Alex Deucher @ 2020-05-20 14:57 UTC (permalink / raw)
  To: chen gong; +Cc: amd-gfx list

On Wed, May 20, 2020 at 4:32 AM chen gong <curry.gong@amd.com> wrote:
>
> [Problem description]
> 1. Boot up picasso platform, launches desktop, Don't do anything (APU enter into "gfxoff" state)
> 2. Remote login to platform using SSH, then type the command line:
>    sudo su -c "echo manual > /sys/class/drm/card0/device/power_dpm_force_performance_level"
>    sudo su -c "echo 2 > /sys/class/drm/card0/device/pp_dpm_sclk"   (fix SCLK to 1400MHz)
> 3. Move the mouse around in Window
> 4. Phenomenon :  The screen frozen
>
> Tester will switch sclk level during glmark2 run time. APU will enter
> "gfxoff" state intermittently during glmark2 run time. The system got
> hanged if fix GFXCLK to 1400MHz when APU is in "gfxoff" state.
>
> [Debug]
> 1. Fix SCLK to X MHz
>     1400: screen frozen, screen black, then OS will reboot.
>     1300: screen frozen
>     1200: screen frozen, screen black.
>     1100: screen frozen, screen black, then OS will reboot.
>     1000: screen frozen, screen black.
>     900:  screen frozen, screen black, then OS will reboot.
>     800:  Situation Nomal, issue disappear.
>     700:  Situation Nomal, issue disappear.
> 2. SBIOS setting: AMD CBS --> SMU Debug Options -->SMU Debug --> "GFX DLDO Psm Margin Control":
>     50 : Situation Nomal, issue disappear.
>     45 : Situation Nomal, issue disappear.
>     40 : Situation Nomal, issue disappear.
>     35 : Situation Nomal, issue disappear.
>     30 : screen black.
>     25 : screen frozen, then blurred screen.
>     20 : screen frozen.
>     15 : screen black.
>     10 : screen frozen.
>     5  : screen frozen, then blurred screen.
> 3. Disable GFXOFF feature
>    Situation Nomal, issue disappear.
>
> [Why]
> Through a period of time debugging with Sys Eng team and SMU team.
>
> Sys Eng team said this is voltage/frequency marginal issue not a F/W or
> H/W bug. This experiment proves that default targetPsm [for f=1400MHz]
> is not sufficient when GFXOFF is enabled on Picasso.
>
> SMU team think it is an odd test conditions to force sclk="1400MHz" when
> GPU is in "gfxoff" state,then wake up the GFX. SCLK should be in the
> "lowest frequency" when gfxoff.
>
> [How]
> Disable gfxoff when setting manual mode.
>
> By the way, from the user point of view, now that user switch to manual
> mode and force SCLK Frequency, he don't want SCLK be controlled by
> workload. It becomes meaningless to "switch to manual mode" if APU enter
> "gfxoff" due to lack of workload at this point.
>
> Tips: Same issue observed on Raven.
>
> Signed-off-by: chen gong <curry.gong@amd.com>
> ---
>  drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c
> index 4f8c1b8..602be63 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c
> @@ -565,6 +565,7 @@ static int smu10_hwmgr_backend_fini(struct pp_hwmgr *hwmgr)
>  static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr,
>                                 enum amd_dpm_forced_level level)
>  {
> +       struct amdgpu_device *adev = hwmgr->adev;
>         struct smu10_hwmgr *data = hwmgr->backend;
>         uint32_t min_sclk = hwmgr->display_config->min_core_set_clock;
>         uint32_t min_mclk = hwmgr->display_config->min_mem_set_clock/100;
> @@ -730,6 +731,11 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr,
>                                                 NULL);
>                 break;
>         case AMD_DPM_FORCED_LEVEL_MANUAL:
> +               if (adev->asic_type == CHIP_RAVEN){

Missing a space between ) and {

> +                       if (adev->rev_id < 8)

Have you verified that raven2 variants don't need this?

> +                               smu10_gfx_off_control(hwmgr, false);

Where are we re-enabling gfx off when we exit manual mode?

Alex

> +               }
> +               break;
>         case AMD_DPM_FORCED_LEVEL_PROFILE_EXIT:
>         default:
>                 break;
> --
> 2.7.4
>
> _______________________________________________
> 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] 4+ messages in thread

* [PATCH] drm/amd/powerpay: Disable gfxoff when setting manual mode on picasso and raven
@ 2020-05-20  8:31 chen gong
  2020-05-20 14:57 ` Alex Deucher
  0 siblings, 1 reply; 4+ messages in thread
From: chen gong @ 2020-05-20  8:31 UTC (permalink / raw)
  To: amd-gfx; +Cc: chen gong

[Problem description]
1. Boot up picasso platform, launches desktop, Don't do anything (APU enter into "gfxoff" state)
2. Remote login to platform using SSH, then type the command line:
   sudo su -c "echo manual > /sys/class/drm/card0/device/power_dpm_force_performance_level"
   sudo su -c "echo 2 > /sys/class/drm/card0/device/pp_dpm_sclk"   (fix SCLK to 1400MHz)
3. Move the mouse around in Window
4. Phenomenon :  The screen frozen

Tester will switch sclk level during glmark2 run time. APU will enter
"gfxoff" state intermittently during glmark2 run time. The system got
hanged if fix GFXCLK to 1400MHz when APU is in "gfxoff" state.

[Debug]
1. Fix SCLK to X MHz
    1400: screen frozen, screen black, then OS will reboot.
    1300: screen frozen
    1200: screen frozen, screen black.
    1100: screen frozen, screen black, then OS will reboot.
    1000: screen frozen, screen black.
    900:  screen frozen, screen black, then OS will reboot.
    800:  Situation Nomal, issue disappear.
    700:  Situation Nomal, issue disappear.
2. SBIOS setting: AMD CBS --> SMU Debug Options -->SMU Debug --> "GFX DLDO Psm Margin Control":
    50 : Situation Nomal, issue disappear.
    45 : Situation Nomal, issue disappear.
    40 : Situation Nomal, issue disappear.
    35 : Situation Nomal, issue disappear.
    30 : screen black.
    25 : screen frozen, then blurred screen.
    20 : screen frozen.
    15 : screen black.
    10 : screen frozen.
    5  : screen frozen, then blurred screen.
3. Disable GFXOFF feature
   Situation Nomal, issue disappear.

[Why]
Through a period of time debugging with Sys Eng team and SMU team.

Sys Eng team said this is voltage/frequency marginal issue not a F/W or
H/W bug. This experiment proves that default targetPsm [for f=1400MHz]
is not sufficient when GFXOFF is enabled on Picasso.

SMU team think it is an odd test conditions to force sclk="1400MHz" when
GPU is in "gfxoff" state,then wake up the GFX. SCLK should be in the
"lowest frequency" when gfxoff.

[How]
Disable gfxoff when setting manual mode.

By the way, from the user point of view, now that user switch to manual
mode and force SCLK Frequency, he don't want SCLK be controlled by
workload. It becomes meaningless to "switch to manual mode" if APU enter
"gfxoff" due to lack of workload at this point.

Tips: Same issue observed on Raven.

Signed-off-by: chen gong <curry.gong@amd.com>
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c
index 4f8c1b8..602be63 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu10_hwmgr.c
@@ -565,6 +565,7 @@ static int smu10_hwmgr_backend_fini(struct pp_hwmgr *hwmgr)
 static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr,
 				enum amd_dpm_forced_level level)
 {
+	struct amdgpu_device *adev = hwmgr->adev;
 	struct smu10_hwmgr *data = hwmgr->backend;
 	uint32_t min_sclk = hwmgr->display_config->min_core_set_clock;
 	uint32_t min_mclk = hwmgr->display_config->min_mem_set_clock/100;
@@ -730,6 +731,11 @@ static int smu10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr,
 						NULL);
 		break;
 	case AMD_DPM_FORCED_LEVEL_MANUAL:
+		if (adev->asic_type == CHIP_RAVEN){
+			if (adev->rev_id < 8)
+				smu10_gfx_off_control(hwmgr, false);
+		}
+		break;
 	case AMD_DPM_FORCED_LEVEL_PROFILE_EXIT:
 	default:
 		break;
-- 
2.7.4

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

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

end of thread, other threads:[~2020-05-21 17:01 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-21 10:43 [PATCH] drm/amd/powerpay: Disable gfxoff when setting manual mode on picasso and raven chen gong
2020-05-21 17:00 ` Alex Deucher
  -- strict thread matches above, loose matches on Subject: below --
2020-05-20  8:31 chen gong
2020-05-20 14:57 ` 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.