drm/amd/powerplay: add max_power_limit to pp_hwmgr
Subsystems (2)
PATCH 1/2 drm/amd/powerplay: add max_power_limit to pp_hwmgr
And initialize it to the default limit for now. Will allow increasing the power limit on select cards.
--- drivers/gpu/drm/amd/include/kgd_pp_interface.h | 2 +- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 8 ++++---- drivers/gpu/drm/amd/powerplay/hwmgr/smu7_powertune.c | 2 ++ drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c | 1 + drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 1 + drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 1 + 6 files changed, 10 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/include/kgd_pp_interface.h +1 -1
@@ -243,7 +243,7 @@ struct amd_pm_funcs { uint32_t block_type, bool gate);int (*set_clockgating_by_smu)(void *handle,uint32_t msg_id);int (*set_power_limit)(void *handle,uint32_t n); -int (*get_power_limit)(void *handle,uint32_t *limit,bool default_limit); +int (*get_power_limit)(void *handle,uint32_t *limit,bool max_limit);int (*get_power_profile_mode)(void *handle,char *buf);int (*set_power_profile_mode)(void *handle,long *input,uint32_t size);int (*odn_edit_dpm_table)(void *handle,uint32_t type,long *input,uint32_t size);
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +4 -4
@@ -937,7 +937,7 @@ static int pp_set_power_limit(void *handle, uint32_t limit)if (limit ==0 ) limit = hwmgr->default_power_limit; -if (limit > hwmgr->default_power_limit) +if (limit > hwmgr->max_power_limit)return -EINVAL ;mutex_lock (&hwmgr->smu_lock);
@@ -947,7 +947,7 @@ static int pp_set_power_limit(void *handle, uint32_t limit)return 0 ; } -static int pp_get_power_limit (void *handle,uint32_t *limit,bool default_limit) +static int pp_get_power_limit (void *handle,uint32_t *limit,bool max_limit) {struct pp_hwmgr *hwmgr = handle;
@@ -956,8 +956,8 @@ static int pp_get_power_limit(void *handle, uint32_t *limit, bool default_limit)mutex_lock (&hwmgr->smu_lock); -if (default_limit) - *limit = hwmgr->default_power_limit; +if (max_limit) + *limit = hwmgr->max_power_limit;else *limit = hwmgr->power_limit;
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_powertune.c +2 -0
@@ -1140,6 +1140,8 @@ int smu7_enable_power_containment(struct pp_hwmgr *hwmgr)if (0 == smc_result) { hwmgr->default_power_limit = hwmgr->power_limit = cac_table->usMaximumPowerDeliveryLimit; + hwmgr->max_power_limit = + hwmgr->default_power_limit; data->power_containment_features |= POWERCONTAINMENT_FEATURE_PkgPwrLimit;
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c +1 -0
@@ -1342,6 +1342,7 @@ int vega10_enable_power_containment(struct pp_hwmgr *hwmgr) hwmgr->default_power_limit = hwmgr->power_limit = (uint32_t )(tdp_table->usMaximumPowerDeliveryLimit); + hwmgr->max_power_limit = hwmgr->default_power_limit;if (PP_CAP (PHM_PlatformCaps_PowerContainment)) {if (data->smu_features[GNLD_PPT ].supported)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +1 -0
@@ -1554,6 +1554,7 @@ static int vega20_enable_dpm_tasks(struct pp_hwmgr *hwmgr) return result); hwmgr->power_limit = hwmgr->default_power_limit =smum_get_argument (hwmgr); + hwmgr->max_power_limit = hwmgr->default_power_limit;return 0 ; }
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +1 -0
@@ -764,6 +764,7 @@ struct pp_hwmgr {bool od_enabled;uint32_t power_limit;uint32_t default_power_limit; +uint32_t max_power_limit;uint32_t workload_mask;uint32_t workload_prority[Workload_Policy_Max];uint32_t workload_setting[Workload_Policy_Max];
Signature · 6 lines
2.19.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20181003220300.5931-1-mezin.alexander-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
PATCH 2/2 drm/amd/vega10: allow increased power limit
Allow setting the power limit to 150% of the default one, like Windows driver does.
--- drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c +2 -1
@@ -1342,7 +1342,8 @@ int vega10_enable_power_containment(struct pp_hwmgr *hwmgr) hwmgr->default_power_limit = hwmgr->power_limit = (uint32_t )(tdp_table->usMaximumPowerDeliveryLimit); - hwmgr->max_power_limit = hwmgr->default_power_limit; + hwmgr->max_power_limit = hwmgr->default_power_limit + + hwmgr->default_power_limit /2 ;if (PP_CAP (PHM_PlatformCaps_PowerContainment)) {if (data->smu_features[GNLD_PPT ].supported)
Signature · 6 lines
2.19.0 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 20181003220300.5931-2-mezin.alexander-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Re: [PATCH 2/2] drm/amd/vega10: allow increased power limit
Quoted 3 lines · Aleksandr Mezin
Allow setting the power limit to 150% of the default one, like Windows driver does.
Please see this patch:
https://patchwork.freedesktop.org/patch/255970/
This matches what the windows driver does.
Alex
Quoted 23 lines
Signed-off-by Aleksandr Mezin <[email protected]>--- drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/powerplay/hwmgr/vega10_powertune.c +2
-2@@ -1342,7 +1342,8 @@ int vega10_enable_power_containment(struct pp_hwmgr *hwmgr) hwmgr->default_power_limit = hwmgr->power_limit = (uint32_t )(tdp_table->usMaximumPowerDeliveryLimit); - hwmgr->max_power_limit = hwmgr->default_power_limit; + hwmgr->max_power_limit = hwmgr->default_power_limit + + hwmgr->default_power_limit /2 ;if (PP_CAP (PHM_PlatformCaps_PowerContainment)) {if (data->smu_features[GNLD_PPT ].supported) --2.19.0
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx