All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] drm/amdgpu: Stop returning EINVAL during profile switch
@ 2019-03-25 12:41 Russell, Kent
       [not found] ` <20190325124120.7793-1-kent.russell-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Russell, Kent @ 2019-03-25 12:41 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Russell, Kent

Don't return an error after switching to the CUSTOM profile,
if there aren't any CUSTOM values passed in. The CUSTOM profile
is already applied, so if no other arguments are passed, just
return instead of throwing -EINVAL when successful

Change-Id: I114cc9783226ee9ebb146863897e951527a85e20
Signed-off-by: Kent Russell <kent.russell@amd.com>
---
 drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 6 +++++-
 drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 5 ++++-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
index ed6c638700f5..a98b927282ac 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
@@ -4911,7 +4911,11 @@ static int vega10_set_power_profile_mode(struct pp_hwmgr *hwmgr, long *input, ui
 						1<<hwmgr->power_profile_mode);
 
 	if (hwmgr->power_profile_mode == PP_SMC_POWER_PROFILE_CUSTOM) {
-		if (size == 0 || size > 4)
+		/* If size = 0, then just return, it was applied above */
+		if (size == 0)
+			return 0;
+
+		if (size != 4)
 			return -EINVAL;
 
 		data->custom_profile_mode[0] = busy_set_point = input[0];
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
index 664544e7fcdc..225b2102c82c 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
@@ -3828,8 +3828,11 @@ static int vega20_set_power_profile_mode(struct pp_hwmgr *hwmgr, long *input, ui
 	}
 
 	if (hwmgr->power_profile_mode == PP_SMC_POWER_PROFILE_CUSTOM) {
-		if (size < 10)
+		if (size < 10 && size != 0)
 			return -EINVAL;
+		/* If size = 0, then just return, it was applied above */
+		if (size == 0)
+			return 0;
 
 		result = vega20_get_activity_monitor_coeff(hwmgr,
 				(uint8_t *)(&activity_monitor),
-- 
2.17.1

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

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

* [PATCH 2/3] drm/amdgpu: Allow changing to CUSTOM profile on smu7
       [not found] ` <20190325124120.7793-1-kent.russell-5C7GfCeVMHo@public.gmane.org>
@ 2019-03-25 12:41   ` Russell, Kent
  2019-03-25 12:41   ` [PATCH 3/3] drm/amdgpu: Allow changing to BOOTUP " Russell, Kent
  2019-03-25 14:14   ` [PATCH 1/3] drm/amdgpu: Stop returning EINVAL during profile switch Quan, Evan
  2 siblings, 0 replies; 9+ messages in thread
From: Russell, Kent @ 2019-03-25 12:41 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Russell, Kent

Allow changing to the CUSTOM profile without requiring the
parameters being passed in each time. Store the values in
the smu7_profiling table since it's defined here anyways

Change-Id: I6c5e3a1487e12410a6a7670a5cf1a6599253344d
Signed-off-by: Kent Russell <kent.russell@amd.com>
---
 .../gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c  | 27 +++++++++++--------
 1 file changed, 16 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
index 83d3d935f3ac..74d55b8fb74e 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
@@ -77,7 +77,7 @@
 #define PCIE_BUS_CLK                10000
 #define TCLK                        (PCIE_BUS_CLK / 10)
 
-static const struct profile_mode_setting smu7_profiling[7] =
+static struct profile_mode_setting smu7_profiling[7] =
 					{{0, 0, 0, 0, 0, 0, 0, 0},
 					 {1, 0, 100, 30, 1, 0, 100, 10},
 					 {1, 10, 0, 30, 0, 0, 0, 0},
@@ -4984,17 +4984,22 @@ static int smu7_set_power_profile_mode(struct pp_hwmgr *hwmgr, long *input, uint
 	mode = input[size];
 	switch (mode) {
 	case PP_SMC_POWER_PROFILE_CUSTOM:
-		if (size < 8)
+		if (size < 8 && size != 0)
 			return -EINVAL;
-
-		tmp.bupdate_sclk = input[0];
-		tmp.sclk_up_hyst = input[1];
-		tmp.sclk_down_hyst = input[2];
-		tmp.sclk_activity = input[3];
-		tmp.bupdate_mclk = input[4];
-		tmp.mclk_up_hyst = input[5];
-		tmp.mclk_down_hyst = input[6];
-		tmp.mclk_activity = input[7];
+		/* If only CUSTOM is passed in, use the saved values */
+		if (size == 0) {
+			tmp = smu7_profiling[PP_SMC_POWER_PROFILE_CUSTOM];
+		} else {
+			tmp.bupdate_sclk = input[0];
+			tmp.sclk_up_hyst = input[1];
+			tmp.sclk_down_hyst = input[2];
+			tmp.sclk_activity = input[3];
+			tmp.bupdate_mclk = input[4];
+			tmp.mclk_up_hyst = input[5];
+			tmp.mclk_down_hyst = input[6];
+			tmp.mclk_activity = input[7];
+			smu7_profiling[PP_SMC_POWER_PROFILE_CUSTOM] = tmp;
+		}
 		if (!smum_update_dpm_settings(hwmgr, &tmp)) {
 			memcpy(&data->current_profile_setting, &tmp, sizeof(struct profile_mode_setting));
 			hwmgr->power_profile_mode = mode;
-- 
2.17.1

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

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

* [PATCH 3/3] drm/amdgpu: Allow changing to BOOTUP profile on smu7
       [not found] ` <20190325124120.7793-1-kent.russell-5C7GfCeVMHo@public.gmane.org>
  2019-03-25 12:41   ` [PATCH 2/3] drm/amdgpu: Allow changing to CUSTOM profile on smu7 Russell, Kent
@ 2019-03-25 12:41   ` Russell, Kent
       [not found]     ` <20190325124120.7793-3-kent.russell-5C7GfCeVMHo@public.gmane.org>
  2019-03-25 14:14   ` [PATCH 1/3] drm/amdgpu: Stop returning EINVAL during profile switch Quan, Evan
  2 siblings, 1 reply; 9+ messages in thread
From: Russell, Kent @ 2019-03-25 12:41 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Russell, Kent

With SMU7 using case statements, against vega10/20 only checking for the
CUSTOM profile, SMU7 can't set the power profile back to the
BOOTUP_DEFAULT, while newer HWMGRs can. Add the case statement in to
align functionality with other ASICs

Change-Id: Ibc7df3b94b1a9dabcb88934e534c91209fc75967
Signed-off-by: Kent Russell <kent.russell@amd.com>
---
 drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
index 74d55b8fb74e..7c3eae2a34b4 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
@@ -5005,6 +5005,7 @@ static int smu7_set_power_profile_mode(struct pp_hwmgr *hwmgr, long *input, uint
 			hwmgr->power_profile_mode = mode;
 		}
 		break;
+	case PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT:
 	case PP_SMC_POWER_PROFILE_FULLSCREEN3D:
 	case PP_SMC_POWER_PROFILE_POWERSAVING:
 	case PP_SMC_POWER_PROFILE_VIDEO:
-- 
2.17.1

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

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

* RE: [PATCH 1/3] drm/amdgpu: Stop returning EINVAL during profile switch
       [not found] ` <20190325124120.7793-1-kent.russell-5C7GfCeVMHo@public.gmane.org>
  2019-03-25 12:41   ` [PATCH 2/3] drm/amdgpu: Allow changing to CUSTOM profile on smu7 Russell, Kent
  2019-03-25 12:41   ` [PATCH 3/3] drm/amdgpu: Allow changing to BOOTUP " Russell, Kent
@ 2019-03-25 14:14   ` Quan, Evan
       [not found]     ` <MN2PR12MB3344372CF30753A2F0556109E45E0-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  2 siblings, 1 reply; 9+ messages in thread
From: Quan, Evan @ 2019-03-25 14:14 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Russell, Kent

How can you tell whether it was already applied before or 1st time to switch to compute mode?
For the latter case, other settings/parameters do need.

Regards,
Evan
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of
> Russell, Kent
> Sent: 2019年3月25日 20:42
> To: amd-gfx@lists.freedesktop.org
> Cc: Russell, Kent <Kent.Russell@amd.com>
> Subject: [PATCH 1/3] drm/amdgpu: Stop returning EINVAL during profile
> switch
> 
> Don't return an error after switching to the CUSTOM profile, if there aren't
> any CUSTOM values passed in. The CUSTOM profile is already applied, so if
> no other arguments are passed, just return instead of throwing -EINVAL
> when successful
> 
> Change-Id: I114cc9783226ee9ebb146863897e951527a85e20
> Signed-off-by: Kent Russell <kent.russell@amd.com>
> ---
>  drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 6 +++++-
> drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 5 ++++-
>  2 files changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> index ed6c638700f5..a98b927282ac 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> @@ -4911,7 +4911,11 @@ static int vega10_set_power_profile_mode(struct
> pp_hwmgr *hwmgr, long *input, ui
>  						1<<hwmgr-
> >power_profile_mode);
> 
>  	if (hwmgr->power_profile_mode ==
> PP_SMC_POWER_PROFILE_CUSTOM) {
> -		if (size == 0 || size > 4)
> +		/* If size = 0, then just return, it was applied above */
> +		if (size == 0)
> +			return 0;
> +
> +		if (size != 4)
>  			return -EINVAL;
> 
>  		data->custom_profile_mode[0] = busy_set_point = input[0];
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
> b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
> index 664544e7fcdc..225b2102c82c 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
> @@ -3828,8 +3828,11 @@ static int vega20_set_power_profile_mode(struct
> pp_hwmgr *hwmgr, long *input, ui
>  	}
> 
>  	if (hwmgr->power_profile_mode ==
> PP_SMC_POWER_PROFILE_CUSTOM) {
> -		if (size < 10)
> +		if (size < 10 && size != 0)
>  			return -EINVAL;
> +		/* If size = 0, then just return, it was applied above */
> +		if (size == 0)
> +			return 0;
> 
>  		result = vega20_get_activity_monitor_coeff(hwmgr,
>  				(uint8_t *)(&activity_monitor),
> --
> 2.17.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] 9+ messages in thread

* RE: [PATCH 3/3] drm/amdgpu: Allow changing to BOOTUP profile on smu7
       [not found]     ` <20190325124120.7793-3-kent.russell-5C7GfCeVMHo@public.gmane.org>
@ 2019-03-25 14:26       ` Quan, Evan
       [not found]         ` <MN2PR12MB3344C54453D308D2D2888AAFE45E0-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Quan, Evan @ 2019-03-25 14:26 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Russell, Kent

As I know, BOOTUP profile is only available for Vega10 and later ASICs.
The BOOTUP profile for SMU7 has only some dummy settings and is not expected to switch to such mode.
The default power profile for SMU7 is FULLSCREEN3D(different with Vega10 and later ASICs).
        hwmgr->workload_mask = 1 << hwmgr->workload_prority[PP_SMC_POWER_PROFILE_FULLSCREEN3D];
        hwmgr->power_profile_mode = PP_SMC_POWER_PROFILE_FULLSCREEN3D;
        hwmgr->default_power_profile_mode = PP_SMC_POWER_PROFILE_FULLSCREEN3D;

Regards,
Evan
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of
> Russell, Kent
> Sent: 2019年3月25日 20:42
> To: amd-gfx@lists.freedesktop.org
> Cc: Russell, Kent <Kent.Russell@amd.com>
> Subject: [PATCH 3/3] drm/amdgpu: Allow changing to BOOTUP profile on
> smu7
> 
> With SMU7 using case statements, against vega10/20 only checking for the
> CUSTOM profile, SMU7 can't set the power profile back to the
> BOOTUP_DEFAULT, while newer HWMGRs can. Add the case statement in to
> align functionality with other ASICs
> 
> Change-Id: Ibc7df3b94b1a9dabcb88934e534c91209fc75967
> Signed-off-by: Kent Russell <kent.russell@amd.com>
> ---
>  drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
> b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
> index 74d55b8fb74e..7c3eae2a34b4 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
> @@ -5005,6 +5005,7 @@ static int smu7_set_power_profile_mode(struct
> pp_hwmgr *hwmgr, long *input, uint
>  			hwmgr->power_profile_mode = mode;
>  		}
>  		break;
> +	case PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT:
>  	case PP_SMC_POWER_PROFILE_FULLSCREEN3D:
>  	case PP_SMC_POWER_PROFILE_POWERSAVING:
>  	case PP_SMC_POWER_PROFILE_VIDEO:
> --
> 2.17.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] 9+ messages in thread

* Re: [PATCH 1/3] drm/amdgpu: Stop returning EINVAL during profile switch
       [not found]     ` <MN2PR12MB3344372CF30753A2F0556109E45E0-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2019-03-25 15:59       ` Russell, Kent
       [not found]         ` <BN6PR12MB1618F581D7E429F48154C804855E0-/b2+HYfkarRqaFUXYJa4HgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Russell, Kent @ 2019-03-25 15:59 UTC (permalink / raw)
  To: Quan, Evan, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 3877 bytes --]

I set CUSTOM to a weird value like "1 2 3 4 5 6" , then switched to VR profile, then switched back to CUSTOM (just with "echo 6 > profile), and it kept my custom values. Before this patch, it throws EINVAL but still switches it to CUSTOM with the saved values, on both vega10 and vega20.

Kent

KENT RUSSELL
Sr. Software Engineer | Linux Compute Kernel
1 Commerce Valley Drive East
Markham, ON L3T 7X6
O +(1) 289-695-2122 | Ext 72122
________________________________
From: Quan, Evan
Sent: Monday, March 25, 2019 10:14:03 AM
To: Russell, Kent; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Russell, Kent
Subject: RE: [PATCH 1/3] drm/amdgpu: Stop returning EINVAL during profile switch

How can you tell whether it was already applied before or 1st time to switch to compute mode?
For the latter case, other settings/parameters do need.

Regards,
Evan
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> On Behalf Of
> Russell, Kent
> Sent: 2019年3月25日 20:42
> To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> Cc: Russell, Kent <Kent.Russell-5C7GfCeVMHo@public.gmane.org>
> Subject: [PATCH 1/3] drm/amdgpu: Stop returning EINVAL during profile
> switch
>
> Don't return an error after switching to the CUSTOM profile, if there aren't
> any CUSTOM values passed in. The CUSTOM profile is already applied, so if
> no other arguments are passed, just return instead of throwing -EINVAL
> when successful
>
> Change-Id: I114cc9783226ee9ebb146863897e951527a85e20
> Signed-off-by: Kent Russell <kent.russell-5C7GfCeVMHo@public.gmane.org>
> ---
>  drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 6 +++++-
> drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 5 ++++-
>  2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> index ed6c638700f5..a98b927282ac 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> @@ -4911,7 +4911,11 @@ static int vega10_set_power_profile_mode(struct
> pp_hwmgr *hwmgr, long *input, ui
>                                                1<<hwmgr-
> >power_profile_mode);
>
>        if (hwmgr->power_profile_mode ==
> PP_SMC_POWER_PROFILE_CUSTOM) {
> -             if (size == 0 || size > 4)
> +             /* If size = 0, then just return, it was applied above */
> +             if (size == 0)
> +                     return 0;
> +
> +             if (size != 4)
>                        return -EINVAL;
>
>                data->custom_profile_mode[0] = busy_set_point = input[0];
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
> b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
> index 664544e7fcdc..225b2102c82c 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
> @@ -3828,8 +3828,11 @@ static int vega20_set_power_profile_mode(struct
> pp_hwmgr *hwmgr, long *input, ui
>        }
>
>        if (hwmgr->power_profile_mode ==
> PP_SMC_POWER_PROFILE_CUSTOM) {
> -             if (size < 10)
> +             if (size < 10 && size != 0)
>                        return -EINVAL;
> +             /* If size = 0, then just return, it was applied above */
> +             if (size == 0)
> +                     return 0;
>
>                result = vega20_get_activity_monitor_coeff(hwmgr,
>                                (uint8_t *)(&activity_monitor),
> --
> 2.17.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[-- Attachment #1.2: Type: text/html, Size: 6713 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

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

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

* Re: [PATCH 3/3] drm/amdgpu: Allow changing to BOOTUP profile on smu7
       [not found]         ` <MN2PR12MB3344C54453D308D2D2888AAFE45E0-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2019-03-25 16:00           ` Russell, Kent
  0 siblings, 0 replies; 9+ messages in thread
From: Russell, Kent @ 2019-03-25 16:00 UTC (permalink / raw)
  To: Quan, Evan, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 2813 bytes --]

Thanks for that confirmation Evan. I will drop this patch.

Kent

KENT RUSSELL
Sr. Software Engineer | Linux Compute Kernel
1 Commerce Valley Drive East
Markham, ON L3T 7X6
O +(1) 289-695-2122 | Ext 72122
________________________________
From: Quan, Evan
Sent: Monday, March 25, 2019 10:26:54 AM
To: Russell, Kent; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Cc: Russell, Kent
Subject: RE: [PATCH 3/3] drm/amdgpu: Allow changing to BOOTUP profile on smu7

As I know, BOOTUP profile is only available for Vega10 and later ASICs.
The BOOTUP profile for SMU7 has only some dummy settings and is not expected to switch to such mode.
The default power profile for SMU7 is FULLSCREEN3D(different with Vega10 and later ASICs).
        hwmgr->workload_mask = 1 << hwmgr->workload_prority[PP_SMC_POWER_PROFILE_FULLSCREEN3D];
        hwmgr->power_profile_mode = PP_SMC_POWER_PROFILE_FULLSCREEN3D;
        hwmgr->default_power_profile_mode = PP_SMC_POWER_PROFILE_FULLSCREEN3D;

Regards,
Evan
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> On Behalf Of
> Russell, Kent
> Sent: 2019年3月25日 20:42
> To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> Cc: Russell, Kent <Kent.Russell-5C7GfCeVMHo@public.gmane.org>
> Subject: [PATCH 3/3] drm/amdgpu: Allow changing to BOOTUP profile on
> smu7
>
> With SMU7 using case statements, against vega10/20 only checking for the
> CUSTOM profile, SMU7 can't set the power profile back to the
> BOOTUP_DEFAULT, while newer HWMGRs can. Add the case statement in to
> align functionality with other ASICs
>
> Change-Id: Ibc7df3b94b1a9dabcb88934e534c91209fc75967
> Signed-off-by: Kent Russell <kent.russell-5C7GfCeVMHo@public.gmane.org>
> ---
>  drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
> b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
> index 74d55b8fb74e..7c3eae2a34b4 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
> @@ -5005,6 +5005,7 @@ static int smu7_set_power_profile_mode(struct
> pp_hwmgr *hwmgr, long *input, uint
>                        hwmgr->power_profile_mode = mode;
>                }
>                break;
> +     case PP_SMC_POWER_PROFILE_BOOTUP_DEFAULT:
>        case PP_SMC_POWER_PROFILE_FULLSCREEN3D:
>        case PP_SMC_POWER_PROFILE_POWERSAVING:
>        case PP_SMC_POWER_PROFILE_VIDEO:
> --
> 2.17.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[-- Attachment #1.2: Type: text/html, Size: 4287 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

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

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

* RE: [PATCH 1/3] drm/amdgpu: Stop returning EINVAL during profile switch
       [not found]         ` <BN6PR12MB1618F581D7E429F48154C804855E0-/b2+HYfkarRqaFUXYJa4HgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2019-03-26  9:09           ` Quan, Evan
       [not found]             ` <MN2PR12MB334481F582B040EB2CE30AB2E45F0-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Quan, Evan @ 2019-03-26  9:09 UTC (permalink / raw)
  To: Russell, Kent, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 4479 bytes --]

That seems a bug. I will fix that.
It’s OK to store previous CUSTOM profile settings in driver and switch back to that with no need to pass in settings again. That makes sense.
But you may need to update the patch(to check whether there is previous custom profile settings).

Regards,
Evan
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Russell, Kent
Sent: 2019年3月26日 0:00
To: Quan, Evan <Evan.Quan@amd.com>; amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/3] drm/amdgpu: Stop returning EINVAL during profile switch

I set CUSTOM to a weird value like "1 2 3 4 5 6" , then switched to VR profile, then switched back to CUSTOM (just with "echo 6 > profile), and it kept my custom values. Before this patch, it throws EINVAL but still switches it to CUSTOM with the saved values, on both vega10 and vega20.

Kent

KENT RUSSELL
Sr. Software Engineer | Linux Compute Kernel
1 Commerce Valley Drive East
Markham, ON L3T 7X6
O +(1) 289-695-2122 | Ext 72122
________________________________
From: Quan, Evan
Sent: Monday, March 25, 2019 10:14:03 AM
To: Russell, Kent; amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org>
Cc: Russell, Kent
Subject: RE: [PATCH 1/3] drm/amdgpu: Stop returning EINVAL during profile switch

How can you tell whether it was already applied before or 1st time to switch to compute mode?
For the latter case, other settings/parameters do need.

Regards,
Evan
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org<mailto:amd-gfx-bounces@lists.freedesktop.org>> On Behalf Of
> Russell, Kent
> Sent: 2019年3月25日 20:42
> To: amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org>
> Cc: Russell, Kent <Kent.Russell@amd.com<mailto:Kent.Russell@amd.com>>
> Subject: [PATCH 1/3] drm/amdgpu: Stop returning EINVAL during profile
> switch
>
> Don't return an error after switching to the CUSTOM profile, if there aren't
> any CUSTOM values passed in. The CUSTOM profile is already applied, so if
> no other arguments are passed, just return instead of throwing -EINVAL
> when successful
>
> Change-Id: I114cc9783226ee9ebb146863897e951527a85e20
> Signed-off-by: Kent Russell <kent.russell@amd.com<mailto:kent.russell@amd.com>>
> ---
>  drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 6 +++++-
> drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 5 ++++-
>  2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> index ed6c638700f5..a98b927282ac 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> @@ -4911,7 +4911,11 @@ static int vega10_set_power_profile_mode(struct
> pp_hwmgr *hwmgr, long *input, ui
>                                                1<<hwmgr-
> >power_profile_mode);
>
>        if (hwmgr->power_profile_mode ==
> PP_SMC_POWER_PROFILE_CUSTOM) {
> -             if (size == 0 || size > 4)
> +             /* If size = 0, then just return, it was applied above */
> +             if (size == 0)
> +                     return 0;
> +
> +             if (size != 4)
>                        return -EINVAL;
>
>                data->custom_profile_mode[0] = busy_set_point = input[0];
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
> b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
> index 664544e7fcdc..225b2102c82c 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
> @@ -3828,8 +3828,11 @@ static int vega20_set_power_profile_mode(struct
> pp_hwmgr *hwmgr, long *input, ui
>        }
>
>        if (hwmgr->power_profile_mode ==
> PP_SMC_POWER_PROFILE_CUSTOM) {
> -             if (size < 10)
> +             if (size < 10 && size != 0)
>                        return -EINVAL;
> +             /* If size = 0, then just return, it was applied above */
> +             if (size == 0)
> +                     return 0;
>
>                result = vega20_get_activity_monitor_coeff(hwmgr,
>                                (uint8_t *)(&activity_monitor),
> --
> 2.17.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org>
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[-- Attachment #1.2: Type: text/html, Size: 11786 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

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

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

* RE: [PATCH 1/3] drm/amdgpu: Stop returning EINVAL during profile switch
       [not found]             ` <MN2PR12MB334481F582B040EB2CE30AB2E45F0-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2019-03-26  9:47               ` Russell, Kent
  0 siblings, 0 replies; 9+ messages in thread
From: Russell, Kent @ 2019-03-26  9:47 UTC (permalink / raw)
  To: Quan, Evan, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 5488 bytes --]

Indeed, it allowed me to apply the profile even with no previous profile set (so it basically just applied all zeros). I’ll rebase my 2 patches on your patch once that is pushed to drm-next.

Kent

From: Quan, Evan
Sent: Tuesday, March 26, 2019 5:10 AM
To: Russell, Kent <Kent.Russell-5C7GfCeVMHo@public.gmane.org>; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: RE: [PATCH 1/3] drm/amdgpu: Stop returning EINVAL during profile switch

That seems a bug. I will fix that.
It’s OK to store previous CUSTOM profile settings in driver and switch back to that with no need to pass in settings again. That makes sense.
But you may need to update the patch(to check whether there is previous custom profile settings).

Regards,
Evan
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:amd-gfx-bounces@lists.freedesktop.org>> On Behalf Of Russell, Kent
Sent: 2019年3月26日 0:00
To: Quan, Evan <Evan.Quan-5C7GfCeVMHo@public.gmane.org<mailto:Evan.Quan-5C7GfCeVMHo@public.gmane.org>>; amd-gfx@lists.freedesktop.org<mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH 1/3] drm/amdgpu: Stop returning EINVAL during profile switch

I set CUSTOM to a weird value like "1 2 3 4 5 6" , then switched to VR profile, then switched back to CUSTOM (just with "echo 6 > profile), and it kept my custom values. Before this patch, it throws EINVAL but still switches it to CUSTOM with the saved values, on both vega10 and vega20.

Kent

KENT RUSSELL
Sr. Software Engineer | Linux Compute Kernel
1 Commerce Valley Drive East
Markham, ON L3T 7X6
O +(1) 289-695-2122 | Ext 72122
________________________________
From: Quan, Evan
Sent: Monday, March 25, 2019 10:14:03 AM
To: Russell, Kent; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:amd-gfx-PD4FTy7X32mMSPqsTGOZug@public.gmane.orgesktop.org>
Cc: Russell, Kent
Subject: RE: [PATCH 1/3] drm/amdgpu: Stop returning EINVAL during profile switch

How can you tell whether it was already applied before or 1st time to switch to compute mode?
For the latter case, other settings/parameters do need.

Regards,
Evan
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>> On Behalf Of
> Russell, Kent
> Sent: 2019年3月25日 20:42
> To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
> Cc: Russell, Kent <Kent.Russell-5C7GfCeVMHo@public.gmane.org<mailto:Kent.Russell-5C7GfCeVMHo@public.gmane.org>>
> Subject: [PATCH 1/3] drm/amdgpu: Stop returning EINVAL during profile
> switch
>
> Don't return an error after switching to the CUSTOM profile, if there aren't
> any CUSTOM values passed in. The CUSTOM profile is already applied, so if
> no other arguments are passed, just return instead of throwing -EINVAL
> when successful
>
> Change-Id: I114cc9783226ee9ebb146863897e951527a85e20
> Signed-off-by: Kent Russell <kent.russell-5C7GfCeVMHo@public.gmane.org<mailto:kent.russell@amd.com>>
> ---
>  drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | 6 +++++-
> drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 5 ++++-
>  2 files changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> index ed6c638700f5..a98b927282ac 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c
> @@ -4911,7 +4911,11 @@ static int vega10_set_power_profile_mode(struct
> pp_hwmgr *hwmgr, long *input, ui
>                                                1<<hwmgr-
> >power_profile_mode);
>
>        if (hwmgr->power_profile_mode ==
> PP_SMC_POWER_PROFILE_CUSTOM) {
> -             if (size == 0 || size > 4)
> +             /* If size = 0, then just return, it was applied above */
> +             if (size == 0)
> +                     return 0;
> +
> +             if (size != 4)
>                        return -EINVAL;
>
>                data->custom_profile_mode[0] = busy_set_point = input[0];
> diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
> b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
> index 664544e7fcdc..225b2102c82c 100644
> --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
> +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c
> @@ -3828,8 +3828,11 @@ static int vega20_set_power_profile_mode(struct
> pp_hwmgr *hwmgr, long *input, ui
>        }
>
>        if (hwmgr->power_profile_mode ==
> PP_SMC_POWER_PROFILE_CUSTOM) {
> -             if (size < 10)
> +             if (size < 10 && size != 0)
>                        return -EINVAL;
> +             /* If size = 0, then just return, it was applied above */
> +             if (size == 0)
> +                     return 0;
>
>                result = vega20_get_activity_monitor_coeff(hwmgr,
>                                (uint8_t *)(&activity_monitor),
> --
> 2.17.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org<mailto:amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[-- Attachment #1.2: Type: text/html, Size: 14037 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

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

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

end of thread, other threads:[~2019-03-26  9:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-25 12:41 [PATCH 1/3] drm/amdgpu: Stop returning EINVAL during profile switch Russell, Kent
     [not found] ` <20190325124120.7793-1-kent.russell-5C7GfCeVMHo@public.gmane.org>
2019-03-25 12:41   ` [PATCH 2/3] drm/amdgpu: Allow changing to CUSTOM profile on smu7 Russell, Kent
2019-03-25 12:41   ` [PATCH 3/3] drm/amdgpu: Allow changing to BOOTUP " Russell, Kent
     [not found]     ` <20190325124120.7793-3-kent.russell-5C7GfCeVMHo@public.gmane.org>
2019-03-25 14:26       ` Quan, Evan
     [not found]         ` <MN2PR12MB3344C54453D308D2D2888AAFE45E0-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-03-25 16:00           ` Russell, Kent
2019-03-25 14:14   ` [PATCH 1/3] drm/amdgpu: Stop returning EINVAL during profile switch Quan, Evan
     [not found]     ` <MN2PR12MB3344372CF30753A2F0556109E45E0-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-03-25 15:59       ` Russell, Kent
     [not found]         ` <BN6PR12MB1618F581D7E429F48154C804855E0-/b2+HYfkarRqaFUXYJa4HgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-03-26  9:09           ` Quan, Evan
     [not found]             ` <MN2PR12MB334481F582B040EB2CE30AB2E45F0-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-03-26  9:47               ` Russell, Kent

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.