drm/amd/powerplay: set a default fclk/gfxclk ratio
Subsystems (2)
PATCH 1/3 drm/amd/powerplay: set a default fclk/gfxclk ratio
Otherwise big gap between these two clocks may causes some hangs.
--- .../gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 16 ++++++++++++++++ .../gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.h | 1 + drivers/gpu/drm/amd/powerplay/inc/vega20_ppsmc.h | 3 ++- 3 files changed, 19 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +16 -0
@@ -120,6 +120,7 @@ static void vega20_set_default_registry_data(struct pp_hwmgr *hwmgr) data->registry_data.disable_auto_wattman =1 ; data->registry_data.auto_wattman_debug =0 ; data->registry_data.auto_wattman_sample_period =100 ; + data->registry_data.fclk_gfxclk_ratio =0x3F6CCCCD ; data->registry_data.auto_wattman_threshold =50 ; data->registry_data.gfxoff_controlled_by_driver =1 ; data->gfxoff_allowed = false;
@@ -829,6 +830,16 @@ static int vega20_enable_all_smu_features(struct pp_hwmgr *hwmgr)return 0 ; } +static int vega20_send_clock_ratio (struct pp_hwmgr *hwmgr) +{ +struct vega20_hwmgr *data = + (struct vega20_hwmgr *)(hwmgr->backend); + +return smum_send_msg_to_smc_with_parameter (hwmgr, + PPSMC_MSG_SetFclkGfxClkRatio, + data->registry_data.fclk_gfxclk_ratio); +} +static int vega20_disable_all_smu_features (struct pp_hwmgr *hwmgr) { struct vega20_hwmgr *data =
@@ -1535,6 +1546,11 @@ static int vega20_enable_dpm_tasks(struct pp_hwmgr *hwmgr)"[EnableDPMTasks] Failed to enable all smu features!" , return result); + result =vega20_send_clock_ratio (hwmgr); +PP_ASSERT_WITH_CODE (!result, +"[EnableDPMTasks] Failed to send clock ratio!" , + return result); +/* Initialize UVD/VCE powergating state */ vega20_init_powergate_state (hwmgr);
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.h +1 -0
@@ -328,6 +328,7 @@ struct vega20_registry_data {uint8_t disable_auto_wattman;uint32_t auto_wattman_debug;uint32_t auto_wattman_sample_period; +uint32_t fclk_gfxclk_ratio;uint8_t auto_wattman_threshold;uint8_t log_avfs_param;uint8_t enable_enginess;
drivers/gpu/drm/amd/powerplay/inc/vega20_ppsmc.h +2 -1
@@ -105,7 +105,8 @@#define PPSMC_MSG_SetSystemVirtualDramAddrHigh 0x4B#define PPSMC_MSG_SetSystemVirtualDramAddrLow 0x4C#define PPSMC_MSG_WaflTest 0x4D -// Unused ID 0x4E to 0x50 +#define PPSMC_MSG_SetFclkGfxClkRatio 0x4E +// Unused ID 0x4F to 0x50 #define PPSMC_MSG_AllowGfxOff 0x51#define PPSMC_MSG_DisallowGfxOff 0x52#define PPSMC_MSG_GetPptLimit 0x53
Signature · 6 lines
2.19.1 _______________________________________________ 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): [email protected]
PATCH 2/3 drm/amd/powerplay: always use fast UCLK switching when UCLK DPM enabled
With UCLK DPM enabled, slow switching is not supported any more.
--- .../drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 37 +++++++++---------- 1 file changed, 17 insertions(+), 20 deletions(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +17 -20
@@ -830,6 +830,18 @@ static int vega20_enable_all_smu_features(struct pp_hwmgr *hwmgr)return 0 ; } +static int vega20_notify_smc_display_change (struct pp_hwmgr *hwmgr) +{ +struct vega20_hwmgr *data = (struct vega20_hwmgr *)(hwmgr->backend); + +if (data->smu_features[GNLD_DPM_UCLK ].enabled) +return smum_send_msg_to_smc_with_parameter (hwmgr, + PPSMC_MSG_SetUclkFastSwitch, +1 ); + +return 0 ; +} +static int vega20_send_clock_ratio (struct pp_hwmgr *hwmgr) { struct vega20_hwmgr *data =
@@ -1546,6 +1558,11 @@ static int vega20_enable_dpm_tasks(struct pp_hwmgr *hwmgr)"[EnableDPMTasks] Failed to enable all smu features!" , return result); + result =vega20_notify_smc_display_change (hwmgr); +PP_ASSERT_WITH_CODE (!result, +"[EnableDPMTasks] Failed to notify smc display change!" , + return result); + result =vega20_send_clock_ratio (hwmgr); PP_ASSERT_WITH_CODE(!result, "[EnableDPMTasks] Failed to send clock ratio!",
@@ -1991,19 +2008,6 @@ static int vega20_read_sensor(struct pp_hwmgr *hwmgr, int idx,return ret; } -static int vega20_notify_smc_display_change (struct pp_hwmgr *hwmgr, -bool has_disp) -{ -struct vega20_hwmgr *data = (struct vega20_hwmgr *)(hwmgr->backend); - -if (data->smu_features[GNLD_DPM_UCLK ].enabled) -return smum_send_msg_to_smc_with_parameter (hwmgr, - PPSMC_MSG_SetUclkFastSwitch, - has_disp ?1 :0 ); - -return 0 ; -} -int vega20_display_clock_voltage_request (struct pp_hwmgr *hwmgr,struct pp_display_clock_request *clock_req) {
@@ -2063,13 +2067,6 @@ static int vega20_notify_smc_display_config_after_ps_adjustment(struct pp_display_clock_request clock_req;int ret =0 ; -if ((hwmgr->display_config->num_display >1 ) && - !hwmgr->display_config->multi_monitor_in_sync && - !hwmgr->display_config->nb_pstate_switch_disable) -vega20_notify_smc_display_change (hwmgr, false); -else -vega20_notify_smc_display_change (hwmgr, true); - min_clocks.dcefClock = hwmgr->display_config->min_dcef_set_clk; min_clocks.dcefClockInSR = hwmgr->display_config->min_dcef_deep_sleep_set_clk; min_clocks.memoryClock = hwmgr->display_config->min_mem_set_clock;
Signature · 6 lines
2.19.1 _______________________________________________ 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): [email protected]
Alex Deucher
Reviewed-byRe: [PATCH 2/3] drm/amd/powerplay: always use fast UCLK switching when UCLK DPM enabled
Quoted 5 lines · Evan Quan
With UCLK DPM enabled, slow switching is not supported any more.
Change-Id I6242e782441272487aebd161836868785a6f7ee8Signed-off-by Evan Quan <[email protected]>
Quoted 76 lines
--- .../drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 37 +++++++++---------- 1 file changed, 17 insertions(+), 20 deletions(-)drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +17
-21@@ -830,6 +830,18 @@ static int vega20_enable_all_smu_features(struct pp_hwmgr *hwmgr)return 0 ; } +static int vega20_notify_smc_display_change (struct pp_hwmgr *hwmgr) +{ +struct vega20_hwmgr *data = (struct vega20_hwmgr *)(hwmgr->backend); + +if (data->smu_features[GNLD_DPM_UCLK ].enabled) +return smum_send_msg_to_smc_with_parameter (hwmgr, + PPSMC_MSG_SetUclkFastSwitch, +1 ); + +return 0 ; +} +static int vega20_send_clock_ratio (struct pp_hwmgr *hwmgr) { struct vega20_hwmgr *data =@@ -1546,6 +1558,11 @@ static int vega20_enable_dpm_tasks(struct pp_hwmgr *hwmgr)"[EnableDPMTasks] Failed to enable all smu features!" , return result); + result =vega20_notify_smc_display_change (hwmgr); +PP_ASSERT_WITH_CODE (!result, +"[EnableDPMTasks] Failed to notify smc display change!" , + return result); + result =vega20_send_clock_ratio (hwmgr); PP_ASSERT_WITH_CODE(!result, "[EnableDPMTasks] Failed to send clock ratio!",@@ -1991,19 +2008,6 @@ static int vega20_read_sensor(struct pp_hwmgr *hwmgr, int idx,return ret; } -static int vega20_notify_smc_display_change (struct pp_hwmgr *hwmgr, -bool has_disp) -{ -struct vega20_hwmgr *data = (struct vega20_hwmgr *)(hwmgr->backend); - -if (data->smu_features[GNLD_DPM_UCLK ].enabled) -return smum_send_msg_to_smc_with_parameter (hwmgr, - PPSMC_MSG_SetUclkFastSwitch, - has_disp ?1 :0 ); - -return 0 ; -} -int vega20_display_clock_voltage_request (struct pp_hwmgr *hwmgr,struct pp_display_clock_request *clock_req) {@@ -2063,13 +2067,6 @@ static int vega20_notify_smc_display_config_after_ps_adjustment(struct pp_display_clock_request clock_req;int ret =0 ; -if ((hwmgr->display_config->num_display >1 ) && - !hwmgr->display_config->multi_monitor_in_sync && - !hwmgr->display_config->nb_pstate_switch_disable) -vega20_notify_smc_display_change (hwmgr, false); -else -vega20_notify_smc_display_change (hwmgr, true); - min_clocks.dcefClock = hwmgr->display_config->min_dcef_set_clk; min_clocks.dcefClockInSR = hwmgr->display_config->min_dcef_deep_sleep_set_clk; min_clocks.memoryClock = hwmgr->display_config->min_mem_set_clock; --2.19.1
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
PATCH 3/3 drm/amdgpu: set Vega20 LBPW as disabled at default
In reply to a message not in the archiveFor Vega20, LBPW feature is disabled at default.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +14 -0
@@ -2503,6 +2503,20 @@ static int gfx_v9_0_rlc_resume(struct amdgpu_device *adev)return r; } +if (amdgpu_lbpw ==-1 ) { +switch (adev->asic_type) { +case CHIP_RAVEN : + amdgpu_lbpw =1 ; +break ; +case CHIP_VEGA20 : + amdgpu_lbpw =0 ; +break ; +default : + amdgpu_lbpw =0 ; +break ; + } + } +if (adev->asic_type ==CHIP_RAVEN || adev->asic_type ==CHIP_VEGA20 ) {if (amdgpu_lbpw !=0 )
Signature · 6 lines
2.19.1 _______________________________________________ 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): [email protected]
Re: [PATCH 3/3] drm/amdgpu: set Vega20 LBPW as disabled at default
Quoted 20 lines · Evan Quan
For Vega20, LBPW feature is disabled at default.
Change-Id I184520cbb03ab8cba9321cd94d1deb0ce38b7e17Signed-off-by Evan Quan <[email protected]>--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +3
-0@@ -2503,6 +2503,20 @@ static int gfx_v9_0_rlc_resume(struct amdgpu_device *adev)return r; } +if (amdgpu_lbpw ==-1 ) { +switch (adev->asic_type) { +case CHIP_RAVEN :
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c static int gfx_v9_0_rlc_resume(struct amdgpu_device *adev) · line 2518
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +10
-0+ amdgpu_lbpw =1 ; +break ; +case CHIP_VEGA20 : + amdgpu_lbpw =0 ; +break ; +default : + amdgpu_lbpw =0 ; +break ; + } + }
I'd suggest using a local variable rather than changing the global one since there may be multiple GPUs in the system.
Alex
Quoted 11 lines
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +1
-1+if (adev->asic_type ==CHIP_RAVEN || adev->asic_type ==CHIP_VEGA20 ) {if (amdgpu_lbpw !=0 ) --2.19.1
_______________________________________________
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
Seriel is reviewed-by: Feifei Xu <[email protected]>
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Evan Quan
Sent: Wednesday, November 7, 2018 9:38 AM
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 1/3] drm/amd/powerplay: set a default fclk/gfxclk ratio
Otherwise big gap between these two clocks may causes some hangs.
--- .../gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 16 ++++++++++++++++ .../gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.h | 1 + drivers/gpu/drm/amd/powerplay/inc/vega20_ppsmc.h | 3 ++- 3 files changed, 19 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +15 -0
@@ -120,6 +120,7 @@ static void vega20_set_default_registry_data(struct pp_hwmgr *hwmgr) data->registry_data.disable_auto_wattman =1 ; data->registry_data.auto_wattman_debug =0 ; data->registry_data.auto_wattman_sample_period =100 ; + data->registry_data.fclk_gfxclk_ratio =0x3F6CCCCD ; data->registry_data.auto_wattman_threshold =50 ; data->registry_data.gfxoff_controlled_by_driver =1 ; data->gfxoff_allowed = false;
@@ -829,6 +830,16 @@ static int vega20_enable_all_smu_features(struct pp_hwmgr *hwmgr)return 0 ; } +static int vega20_send_clock_ratio (struct pp_hwmgr *hwmgr) { +struct vega20_hwmgr *data = + (struct vega20_hwmgr *)(hwmgr->backend); + +return smum_send_msg_to_smc_with_parameter (hwmgr, + PPSMC_MSG_SetFclkGfxClkRatio, + data->registry_data.fclk_gfxclk_ratio); +} +static int vega20_disable_all_smu_features (struct pp_hwmgr *hwmgr) { struct vega20_hwmgr *data =
@@ -1535,6 +1546,11 @@ static int vega20_enable_dpm_tasks(struct pp_hwmgr *hwmgr)"[EnableDPMTasks] Failed to enable all smu features!" , return result); + result =vega20_send_clock_ratio (hwmgr); +PP_ASSERT_WITH_CODE (!result, +"[EnableDPMTasks] Failed to send clock ratio!" , + return result); +/* Initialize UVD/VCE powergating state */ vega20_init_powergate_state (hwmgr);
drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.h +1 -0
@@ -328,6 +328,7 @@ struct vega20_registry_data {uint8_t disable_auto_wattman;uint32_t auto_wattman_debug;uint32_t auto_wattman_sample_period; +uint32_t fclk_gfxclk_ratio;uint8_t auto_wattman_threshold;uint8_t log_avfs_param;uint8_t enable_enginess;
drivers/gpu/drm/amd/powerplay/inc/vega20_ppsmc.h +2 -1
@@ -105,7 +105,8 @@#define PPSMC_MSG_SetSystemVirtualDramAddrHigh 0x4B#define PPSMC_MSG_SetSystemVirtualDramAddrLow 0x4C#define PPSMC_MSG_WaflTest 0x4D -// Unused ID 0x4E to 0x50 +#define PPSMC_MSG_SetFclkGfxClkRatio 0x4E +// Unused ID 0x4F to 0x50 #define PPSMC_MSG_AllowGfxOff 0x51#define PPSMC_MSG_DisallowGfxOff 0x52#define PPSMC_MSG_GetPptLimit 0x53
--
2.19.1
_______________________________________________
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
A message that is not in the archive (sent off-list or not yet received): BY2PR12MB00728C6939503358D7659B70FEC40-K//h7OWB4q49o5m5eWPqXQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Alex Deucher
Reviewed-byQuoted 10 lines · Feifei
Seriel is reviewed-by: Feifei Xu <[email protected]>
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Evan Quan
Sent: Wednesday, November 7, 2018 9:38 AM
To: [email protected]
Cc: Quan, Evan <[email protected]>
Subject: [PATCH 1/3] drm/amd/powerplay: set a default fclk/gfxclk ratio
Quoted 4 lines
Otherwise big gap between these two clocks may causes some hangs.
Change-Id Ifa3fafe2ee619d6231d5ecab61d3c68faa34abb6Signed-off-by Evan Quan <[email protected]>
Quoted 74 lines
--- .../gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c | 16 ++++++++++++++++ .../gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.h | 1 + drivers/gpu/drm/amd/powerplay/inc/vega20_ppsmc.h | 3 ++- 3 files changed, 19 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.c +15
-0@@ -120,6 +120,7 @@ static void vega20_set_default_registry_data(struct pp_hwmgr *hwmgr) data->registry_data.disable_auto_wattman =1 ; data->registry_data.auto_wattman_debug =0 ; data->registry_data.auto_wattman_sample_period =100 ; + data->registry_data.fclk_gfxclk_ratio =0x3F6CCCCD ; data->registry_data.auto_wattman_threshold =50 ; data->registry_data.gfxoff_controlled_by_driver =1 ; data->gfxoff_allowed = false;@@ -829,6 +830,16 @@ static int vega20_enable_all_smu_features(struct pp_hwmgr *hwmgr)return 0 ; } +static int vega20_send_clock_ratio (struct pp_hwmgr *hwmgr) { +struct vega20_hwmgr *data = + (struct vega20_hwmgr *)(hwmgr->backend); + +return smum_send_msg_to_smc_with_parameter (hwmgr, + PPSMC_MSG_SetFclkGfxClkRatio, + data->registry_data.fclk_gfxclk_ratio); +} +static int vega20_disable_all_smu_features (struct pp_hwmgr *hwmgr) { struct vega20_hwmgr *data =@@ -1535,6 +1546,11 @@ static int vega20_enable_dpm_tasks(struct pp_hwmgr *hwmgr)"[EnableDPMTasks] Failed to enable all smu features!" , return result); + result =vega20_send_clock_ratio (hwmgr); +PP_ASSERT_WITH_CODE (!result, +"[EnableDPMTasks] Failed to send clock ratio!" , + return result); +/* Initialize UVD/VCE powergating state */ vega20_init_powergate_state (hwmgr);drivers/gpu/drm/amd/powerplay/hwmgr/vega20_hwmgr.h +1
-0@@ -328,6 +328,7 @@ struct vega20_registry_data {uint8_t disable_auto_wattman;uint32_t auto_wattman_debug;uint32_t auto_wattman_sample_period; +uint32_t fclk_gfxclk_ratio;uint8_t auto_wattman_threshold;uint8_t log_avfs_param;uint8_t enable_enginess;drivers/gpu/drm/amd/powerplay/inc/vega20_ppsmc.h +2
-2@@ -105,7 +105,8 @@#define PPSMC_MSG_SetSystemVirtualDramAddrHigh 0x4B#define PPSMC_MSG_SetSystemVirtualDramAddrLow 0x4C#define PPSMC_MSG_WaflTest 0x4D -// Unused ID 0x4E to 0x50 +#define PPSMC_MSG_SetFclkGfxClkRatio 0x4E +// Unused ID 0x4F to 0x50 #define PPSMC_MSG_AllowGfxOff 0x51#define PPSMC_MSG_DisallowGfxOff 0x52#define PPSMC_MSG_GetPptLimit 0x53 --2.19.1
Quoted 8 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
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx