drm/amdgpu: add mmhub powergating set by smu
Subsystems (2)
PATCH 1/3 drm/amdgpu: add mmhub powergating set by smu
PSP will disable legacy mmhub PG setting that is programming registers, and drive will use SMC message to
set it up.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h | 4 ++++ drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c | 3 +++ drivers/gpu/drm/amd/include/kgd_pp_interface.h | 1 + 3 files changed, 8 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h +4 -0
@@ -375,6 +375,10 @@ enum amdgpu_pcie_gen { ((adev)->powerplay.pp_funcs->odn_edit_dpm_table (\ (adev)->powerplay.pp_handle, type, parameter, size)) +#define amdgpu_dpm_set_mmhub_powergating_by_smu (adev) \ + ((adev)->powerplay.pp_funcs->set_mmhub_powergating_by_smu( \ + (adev)->powerplay.pp_handle)) +struct amdgpu_dpm {struct amdgpu_ps *ps;/* number of valid power states */
drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c +3 -0
@@ -471,6 +471,9 @@ void mmhub_v1_0_update_power_gating(struct amdgpu_device *adev, RENG_EXECUTE_ON_REG_UPDATE, 1);WREG32_SOC15 (MMHUB ,0 , mmPCTL1_RENG_EXECUTE, pctl1_reng_execute); +if (adev->powerplay.pp_funcs->set_mmhub_powergating_by_smu) +amdgpu_dpm_set_mmhub_powergating_by_smu (adev); + }else { pctl0_reng_execute = REG_SET_FIELD(pctl0_reng_execute, PCTL0_RENG_EXECUTE,
drivers/gpu/drm/amd/include/kgd_pp_interface.h +1 -0
@@ -310,6 +310,7 @@ struct amd_pm_funcs {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); + int (*set_mmhub_powergating_by_smu)(void *handle); };#endif
Signature · 6 lines
2.7.4 _______________________________________________ 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): 1517949689-9339-1-git-send-email-JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org
PATCH 2/3 drm/amd/powerplay: add mmhub powergating by smu in powerplay
--- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 22 ++++++++++++++++++++++ drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 1 + 2 files changed, 23 insertions(+)
drivers/gpu/drm/amd/powerplay/amd_powerplay.c +22 -0
@@ -1475,6 +1475,27 @@ static int pp_get_display_mode_validation_clocks(void *handle,return ret; } +static int pp_set_mmhub_powergating_by_smu (void *handle) +{ +struct pp_hwmgr *hwmgr; +struct pp_instance *pp_handle = (struct pp_instance *)handle; +int ret =0 ; + + ret =pp_check (pp_handle); + +if (ret) +return ret; + + hwmgr = pp_handle->hwmgr; + +if (hwmgr->hwmgr_func->set_mmhub_powergating_by_smu ==NULL ) { +pr_info ("%s was not implemented.\n" , __func__); +return 0 ; + } + +return hwmgr->hwmgr_func->set_mmhub_powergating_by_smu (hwmgr); +} +const struct amd_pm_funcs pp_dpm_funcs = { .load_firmware = pp_dpm_load_fw, .wait_for_fw_loading_complete = pp_dpm_fw_loading_complete,
@@ -1521,4 +1542,5 @@ const struct amd_pm_funcs pp_dpm_funcs = { .set_watermarks_for_clocks_ranges = pp_set_watermarks_for_clocks_ranges, .display_clock_voltage_request = pp_display_clock_voltage_request, .get_display_mode_validation_clocks = pp_get_display_mode_validation_clocks, + .set_mmhub_powergating_by_smu = pp_set_mmhub_powergating_by_smu, };
drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +1 -0
@@ -347,6 +347,7 @@ struct pp_hwmgr_func {int (*odn_edit_dpm_table)(struct pp_hwmgr *hwmgr,enum PP_OD_DPM_TABLE_COMMAND type,long *input,uint32_t size); +int (*set_mmhub_powergating_by_smu)(struct pp_hwmgr *hwmgr); };struct pp_table_func {
Signature · 6 lines
2.7.4 _______________________________________________ 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): 1517949689-9339-2-git-send-email-JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org
Deucher, Alexander
Reviewed-by Alex DeucherRE: [PATCH 2/3] drm/amd/powerplay: add mmhub powergating by smu in powerplay
Quoted 10 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Eric Huang
Sent: Tuesday, February 6, 2018 3:41 PM
To: [email protected]
Cc: Huang, JinHuiEric <[email protected]>
Subject: [PATCH 2/3] drm/amd/powerplay: add mmhub powergating by smu in powerplaySigned-off-by Eric Huang <[email protected]>
Please add a basic patch description. With that fixed:
Quoted 65 lines
--- drivers/gpu/drm/amd/powerplay/amd_powerplay.c | 22 ++++++++++++++++++++++ drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | 1 + 2 files changed, 23 insertions(+)drivers/gpu/drm/amd/powerplay/amd_powerplay.c +20
-0@@ -1475,6 +1475,27 @@ static int pp_get_display_mode_validation_clocks(void *handle, return ret; } +static int pp_set_mmhub_powergating_by_smu(void *handle) { + struct pp_hwmgr *hwmgr; + struct pp_instance *pp_handle = (struct pp_instance *)handle; + int ret = 0; + + ret = pp_check(pp_handle); + + if (ret) + return ret; + + hwmgr = pp_handle->hwmgr; + + if (hwmgr->hwmgr_func->set_mmhub_powergating_by_smu == NULL) { + pr_info("%s was not implemented.\n", __func__); + return 0; + } + + return hwmgr->hwmgr_func- >set_mmhub_powergating_by_smu(hwmgr); +} + const struct amd_pm_funcs pp_dpm_funcs = { .load_firmware = pp_dpm_load_fw, .wait_for_fw_loading_complete = pp_dpm_fw_loading_complete,@@ -1521,4 +1542,5 @@ const struct amd_pm_funcs pp_dpm_funcs = { .set_watermarks_for_clocks_ranges = pp_set_watermarks_for_clocks_ranges, .display_clock_voltage_request = pp_display_clock_voltage_request, .get_display_mode_validation_clocks =
pp_get_display_mode_validation_clocks,drivers/gpu/drm/amd/powerplay/amd_powerplay.c +1
-0+ .set_mmhub_powergating_by_smu =
pp_set_mmhub_powergating_by_smu,
};drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +1
-0@@ -347,6 +347,7 @@ struct pp_hwmgr_func {int (*odn_edit_dpm_table)(struct pp_hwmgr *hwmgr,enum PP_OD_DPM_TABLE_COMMAND type,long *input,uint32_t size); +int (*set_mmhub_powergating_by_smu)(struct pp_hwmgr *hwmgr); };
Quoted 8 lines
struct
pp_table_func{
--
2.7.4_______________________________________________
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/amd/powerplay: implement set_mmhub_powergating_by_smu for Raven
In reply to a message not in the archive--- drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c | 6 ++++++ drivers/gpu/drm/amd/powerplay/inc/rv_ppsmc.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c +6 -0
@@ -1026,6 +1026,11 @@ static int rv_read_sensor(struct pp_hwmgr *hwmgr, int idx,return ret; } +static int rv_set_mmhub_powergating_by_smu (struct pp_hwmgr *hwmgr) +{ +return smum_send_msg_to_smc (hwmgr, PPSMC_MSG_PowerGateMmHub); +} +static const struct pp_hwmgr_func rv_hwmgr_funcs = { .backend_init = rv_hwmgr_backend_init, .backend_fini = rv_hwmgr_backend_fini,
@@ -1059,6 +1064,7 @@ static const struct pp_hwmgr_func rv_hwmgr_funcs = { .asic_setup = rv_setup_asic_task, .power_state_set = rv_set_power_state_tasks, .dynamic_state_management_disable = rv_disable_dpm_tasks, + .set_mmhub_powergating_by_smu = rv_set_mmhub_powergating_by_smu, };int rv_init_function_pointers (struct pp_hwmgr *hwmgr)
drivers/gpu/drm/amd/powerplay/inc/rv_ppsmc.h +2 -1
@@ -80,7 +80,8 @@#define PPSMC_MSG_SetSoftMaxSocclkByFreq 0x32#define PPSMC_MSG_SetSoftMaxFclkByFreq 0x33#define PPSMC_MSG_SetSoftMaxVcn 0x34 -#define PPSMC_Message_Count 0x35 +#define PPSMC_MSG_PowerGateMmHub 0x35 +#define PPSMC_Message_Count 0x36typedef uint16_t PPSMC_Result ;
Signature · 6 lines
2.7.4 _______________________________________________ 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): 1517949689-9339-3-git-send-email-JinHuiEric.Huang-5C7GfCeVMHo@public.gmane.org
Deucher, Alexander
Reviewed-by Alex DeucherRE: [PATCH 3/3] drm/amd/powerplay: implement set_mmhub_powergating_by_smu for Raven
Quoted 9 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Eric Huang
Sent: Tuesday, February 6, 2018 3:41 PM
To: [email protected]
Cc: Huang, JinHuiEric <[email protected]>
Subject: [PATCH 3/3] drm/amd/powerplay: implementset_mmhub_powergating_by_smufor Raven
Please add a basic patch description. With that fixed:
Quoted 51 lines
Signed-off-by Eric Huang <[email protected]>--- drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c | 6 ++++++ drivers/gpu/drm/amd/powerplay/inc/rv_ppsmc.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-)drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c +3
-0@@ -1026,6 +1026,11 @@ static int rv_read_sensor(struct pp_hwmgr *hwmgr, int idx, return ret; } +static int rv_set_mmhub_powergating_by_smu (struct pp_hwmgr *hwmgr) { +return smum_send_msg_to_smc (hwmgr, PPSMC_MSG_PowerGateMmHub); } +static const struct pp_hwmgr_func rv_hwmgr_funcs = { .backend_init = rv_hwmgr_backend_init, .backend_fini = rv_hwmgr_backend_fini, @@ -1059,6 +1064,7 @@static const struct
pp_hwmgr_funcrv_hwmgr_funcs= {drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c +1
-0.asic_setup = rv_setup_asic_task, .power_state_set = rv_set_power_state_tasks, .dynamic_state_management_disable = rv_disable_dpm_tasks, + .set_mmhub_powergating_by_smu =
rv_set_mmhub_powergating_by_smu,
};int
rv_init_function_pointers(struct pp_hwmgr *hwmgr)diff --gita/drivers/gpu/drm/amd/powerplay/inc/rv_ppsmc.hb/drivers/gpu/drm/amd/powerplay/inc/rv_ppsmc.h
index f15f4df..426bff2 100644drivers/gpu/drm/amd/powerplay/inc/rv_ppsmc.h +2
-2@@ -80,7 +80,8 @@#define PPSMC_MSG_SetSoftMaxSocclkByFreq 0x32#define PPSMC_MSG_SetSoftMaxFclkByFreq 0x33#define PPSMC_MSG_SetSoftMaxVcn 0x34 -#define PPSMC_Message_Count 0x35 +#define PPSMC_MSG_PowerGateMmHub 0x35 +#define PPSMC_Message_Count 0x36typedef uint16_t PPSMC_Result ; --2.7.4
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
Deucher, Alexander
Reviewed-by Alex DeucherQuoted 10 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Eric Huang
Sent: Tuesday, February 6, 2018 3:41 PM
To: [email protected]
Cc: Huang, JinHuiEric <[email protected]>
Subject: [PATCH 1/3] drm/amdgpu: add mmhub powergating set by smuPSP will disable legacy mmhub PG setting that is programming registers, and drive will use SMC message to set it up.
Split this into two patches, one to add the new dpm interface, and one to add the change to mmhub_v1_0.c. I guess presumably there's no way to disable it once it's been enabled?
With the above addressed:
Quoted 60 lines
Signed-off-by Eric Huang <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h | 4 ++++ drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c | 3 +++ drivers/gpu/drm/amd/include/kgd_pp_interface.h | 1 + 3 files changed, 8 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h +4
-0@@ -375,6 +375,10 @@ enum amdgpu_pcie_gen { ((adev)->powerplay.pp_funcs->odn_edit_dpm_table (\ (adev)->powerplay.pp_handle, type, parameter, size)) +#define amdgpu_dpm_set_mmhub_powergating_by_smu (adev) \ + ((adev)->powerplay.pp_funcs- >set_mmhub_powergating_by_smu( \ + (adev)->powerplay.pp_handle)) +struct amdgpu_dpm {drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h +0
-0struct amdgpu_ps *ps;/* number of valid power states */ drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c +1
-0@@ -471,6 +471,9 @@ void mmhub_v1_0_update_power_gating(struct amdgpu_device *adev, RENG_EXECUTE_ON_REG_UPDATE, 1);WREG32_SOC15 (MMHUB ,0 , mmPCTL1_RENG_EXECUTE, pctl1_reng_execute); + if (adev->powerplay.pp_funcs-Quoted 1 line
set_mmhub_powergating_by_smu)+
amdgpu_dpm_set_mmhub_powergating_by_smu(adev);drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c +1
-0+ }else { pctl0_reng_execute = REG_SET_FIELD(pctl0_reng_execute, PCTL0_RENG_EXECUTE,drivers/gpu/drm/amd/include/kgd_pp_interface.h +1
-0@@ -310,6 +310,7 @@ struct amd_pm_funcs {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); +int (*set_mmhub_powergating_by_smu)(void *handle); };
Quoted 8 lines
#endif
--
2.7.4_______________________________________________
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): BN6PR12MB165221B257BD806DEF70C236F7FD0-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Yes. SMU only provides enabling message.
Thanks,
Eric
Quoted 74 lines · Alexander
Quoted 10 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Eric Huang
Sent: Tuesday, February 6, 2018 3:41 PM
To: [email protected]
Cc: Huang, JinHuiEric <[email protected]>
Subject: [PATCH 1/3] drm/amdgpu: add mmhub powergating set by smuPSP will disable legacy mmhub PG setting that is programming registers, and drive will use SMC message to set it up.
Split this into two patches, one to add the new dpm interface, and one to add the change to
mmhub_v1_0.c. I guess presumably there's no way to disable it once it's been enabled?With the above addressed:
Reviewed-by Alex Deucher <[email protected]>Quoted 59 lines
Signed-off-by Eric Huang <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h | 4 ++++ drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c | 3 +++ drivers/gpu/drm/amd/include/kgd_pp_interface.h | 1 + 3 files changed, 8 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_dpm.h +4
-0@@ -375,6 +375,10 @@ enum amdgpu_pcie_gen { ((adev)->powerplay.pp_funcs->odn_edit_dpm_table (\ (adev)->powerplay.pp_handle, type, parameter, size)) +#define amdgpu_dpm_set_mmhub_powergating_by_smu (adev) \ + ((adev)->powerplay.pp_funcs- > set_mmhub_powergating_by_smu( \ + (adev)->powerplay.pp_handle)) +struct amdgpu_dpm {struct
amdgpu_ps*ps;
/* number of valid power states */drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c +1
-0@@ -471,6 +471,9 @@ void mmhub_v1_0_update_power_gating(struct amdgpu_device *adev, RENG_EXECUTE_ON_REG_UPDATE, 1);WREG32_SOC15 (MMHUB ,0 , mmPCTL1_RENG_EXECUTE, pctl1_reng_execute); + if (adev->powerplay.pp_funcs-Quoted 1 line
set_mmhub_powergating_by_smu)+
amdgpu_dpm_set_mmhub_powergating_by_smu(adev);drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c +1
-0+ }else { pctl0_reng_execute = REG_SET_FIELD(pctl0_reng_execute, PCTL0_RENG_EXECUTE,drivers/gpu/drm/amd/include/kgd_pp_interface.h +1
-0@@ -310,6 +310,7 @@ struct amd_pm_funcs {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); +int (*set_mmhub_powergating_by_smu)(void *handle); };
Quoted 8 lines
Quoted 8 lines
#endif
--
2.7.4_______________________________________________
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