<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body>
<p style="font-family:Arial;font-size:10pt;color:#008000;margin:15pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[Public]<br>
</p>
<br>
<div>
<div style="" dir="auto">There's already another smu callback - notify_display. This can be accommodated there, no need to add another callback.</div>
<div id="ms-outlook-mobile-signature" dir="auto">
<div><br>
</div>
Thanks,<br>
Lijo</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Deucher, Alexander <Alexander.Deucher@amd.com><br>
<b>Sent:</b> Tuesday, August 15, 2023 11:13:14 PM<br>
<b>To:</b> Zhang, Bokun <Bokun.Zhang@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Zhang, Bokun <Bokun.Zhang@amd.com>; Quan, Evan <Evan.Quan@amd.com><br>
<b>Subject:</b> RE: [PATCH v2] drm/amdgpu/pm: Add notification function for no DC support</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">[Public]<br>
<br>
[Public]<br>
<br>
> -----Original Message-----<br>
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Bokun<br>
> Zhang<br>
> Sent: Tuesday, August 15, 2023 11:50 AM<br>
> To: amd-gfx@lists.freedesktop.org<br>
> Cc: Zhang, Bokun <Bokun.Zhang@amd.com>; Quan, Evan<br>
> <Evan.Quan@amd.com><br>
> Subject: [PATCH v2] drm/amdgpu/pm: Add notification function for no DC<br>
> support<br>
><br>
> - There is a DPM issue where if DC is not present,<br>
> FCLK will stay at low level.<br>
> We need to send a SMU message to configure the DPM<br>
><br>
> Reviewed-by: Evan Quan <evan.quan@amd.com><br>
> Signed-off-by: Bokun Zhang <bokun.zhang@amd.com><br>
> ---<br>
> drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 6 ++++++<br>
> drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h | 5 +++++<br>
> .../gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_0_ppsmc.h | 5<br>
> ++++-<br>
> drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h | 3 ++-<br>
> drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 7<br>
> +++++++<br>
> drivers/gpu/drm/amd/pm/swsmu/smu_internal.h | 1 +<br>
> 6 files changed, 25 insertions(+), 2 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c<br>
> b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c<br>
> index f005a90c35af..c65bebdbec11 100644<br>
> --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c<br>
> +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c<br>
> @@ -1410,6 +1410,12 @@ static int smu_smc_hw_setup(struct<br>
> smu_context *smu)<br>
> return ret;<br>
> }<br>
><br>
> + if (!amdgpu_device_has_dc_support(adev)) {<br>
> + ret = smu_notify_no_dc(smu);<br>
> + if (ret)<br>
> + dev_warn(adev->dev, "Failed to notify no dc support,<br>
> driver may not reach best performance\n");<br>
> + }<br>
> +<br>
> /*<br>
> * Set min deep sleep dce fclk with bootup value from vbios via<br>
> * SetMinDeepSleepDcefclk MSG.<br>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h<br>
> b/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h<br>
> index 6e2069dcb6b9..c8fdc3d0aa25 100644<br>
> --- a/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h<br>
> +++ b/drivers/gpu/drm/amd/pm/swsmu/inc/amdgpu_smu.h<br>
> @@ -1356,6 +1356,11 @@ struct pptable_funcs {<br>
> * @init_pptable_microcode: Prepare the pptable microcode to upload<br>
> via PSP<br>
> */<br>
> int (*init_pptable_microcode)(struct smu_context *smu);<br>
> +<br>
> + /**<br>
> + * @notify_no_dal: Notify SMU that there is no display and SMU<br>
> should control DPM<br>
<br>
Fix the function name in the kernel doc comment here. With that fixed, patch is:<br>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com><br>
<br>
> + */<br>
> + int (*notify_no_dc)(struct smu_context *smu);<br>
> };<br>
><br>
> typedef enum {<br>
> diff --git<br>
> a/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_0_ppsmc.h<br>
> b/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_0_ppsmc.h<br>
> index 10cff75b44d5..e2ee855c7748 100644<br>
> ---<br>
> a/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_0_ppsmc.h<br>
> +++<br>
> b/drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu_v13_0_0_ppsmc.h<br>
> @@ -138,7 +138,10 @@<br>
> #define PPSMC_MSG_SetBadMemoryPagesRetiredFlagsPerChannel 0x4A<br>
> #define PPSMC_MSG_SetPriorityDeltaGain 0x4B<br>
> #define PPSMC_MSG_AllowIHHostInterrupt 0x4C<br>
> -#define PPSMC_Message_Count 0x4D<br>
> +<br>
> +#define PPSMC_MSG_DALNotPresent 0x4E<br>
> +<br>
> +#define PPSMC_Message_Count 0x4F<br>
><br>
> //Debug Dump Message<br>
> #define DEBUGSMC_MSG_TestMessage 0x1<br>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h<br>
> b/drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h<br>
> index 297b70b9388f..f71fc99447f2 100644<br>
> --- a/drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h<br>
> +++ b/drivers/gpu/drm/amd/pm/swsmu/inc/smu_types.h<br>
> @@ -245,7 +245,8 @@<br>
> __SMU_DUMMY_MAP(AllowGpo), \<br>
> __SMU_DUMMY_MAP(Mode2Reset), \<br>
> __SMU_DUMMY_MAP(RequestI2cTransaction), \<br>
> - __SMU_DUMMY_MAP(GetMetricsTable),<br>
> + __SMU_DUMMY_MAP(GetMetricsTable), \<br>
> + __SMU_DUMMY_MAP(DALNotPresent),<br>
><br>
> #undef __SMU_DUMMY_MAP<br>
> #define __SMU_DUMMY_MAP(type) SMU_MSG_##type<br>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c<br>
> b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c<br>
> index 48b03524a52d..41412cf891a7 100644<br>
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c<br>
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c<br>
> @@ -160,6 +160,7 @@ static struct cmn2asic_msg_mapping<br>
> smu_v13_0_0_message_map[SMU_MSG_MAX_COUNT] =<br>
> MSG_MAP(AllowGpo, PPSMC_MSG_SetGpoAllow,<br>
> 0),<br>
> MSG_MAP(AllowIHHostInterrupt,<br>
> PPSMC_MSG_AllowIHHostInterrupt, 0),<br>
> MSG_MAP(ReenableAcDcInterrupt,<br>
> PPSMC_MSG_ReenableAcDcInterrupt, 0),<br>
> + MSG_MAP(DALNotPresent,<br>
> PPSMC_MSG_DALNotPresent, 0),<br>
> };<br>
><br>
> static struct cmn2asic_mapping smu_v13_0_0_clk_map[SMU_CLK_COUNT] =<br>
> {<br>
> @@ -2601,6 +2602,11 @@ static ssize_t smu_v13_0_0_get_ecc_info(struct<br>
> smu_context *smu,<br>
> return ret;<br>
> }<br>
><br>
> +static int smu_v13_0_0_notify_no_dc(struct smu_context *smu)<br>
> +{<br>
> + return smu_cmn_send_smc_msg(smu, SMU_MSG_DALNotPresent,<br>
> NULL);<br>
> +}<br>
> +<br>
> static const struct pptable_funcs smu_v13_0_0_ppt_funcs = {<br>
> .get_allowed_feature_mask =<br>
> smu_v13_0_0_get_allowed_feature_mask,<br>
> .set_default_dpm_table = smu_v13_0_0_set_default_dpm_table,<br>
> @@ -2680,6 +2686,7 @@ static const struct pptable_funcs<br>
> smu_v13_0_0_ppt_funcs = {<br>
> .send_hbm_bad_channel_flag =<br>
> smu_v13_0_0_send_bad_mem_channel_flag,<br>
> .gpo_control = smu_v13_0_gpo_control,<br>
> .get_ecc_info = smu_v13_0_0_get_ecc_info,<br>
> + .notify_no_dc = smu_v13_0_0_notify_no_dc,<br>
> };<br>
><br>
> void smu_v13_0_0_set_ppt_funcs(struct smu_context *smu)<br>
> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu_internal.h<br>
> b/drivers/gpu/drm/amd/pm/swsmu/smu_internal.h<br>
> index bcc42abfc768..9b9a13fdcef8 100644<br>
> --- a/drivers/gpu/drm/amd/pm/swsmu/smu_internal.h<br>
> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu_internal.h<br>
> @@ -97,6 +97,7 @@<br>
> #define smu_get_default_config_table_settings(smu, config_table)<br>
> smu_ppt_funcs(get_default_config_table_settings, -EOPNOTSUPP,<br>
> smu, config_table)<br>
> #define smu_set_config_table(smu, config_table)<br>
> smu_ppt_funcs(set_config_table, -EOPNOTSUPP, smu, config_table)<br>
> #define smu_init_pptable_microcode(smu)<br>
> smu_ppt_funcs(init_pptable_microcode, 0, smu)<br>
> +#define smu_notify_no_dc(smu)<br>
> smu_ppt_funcs(notify_no_dc, 0, smu)<br>
><br>
> #endif<br>
> #endif<br>
> --<br>
> 2.25.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>