<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
span.EmailStyle21
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<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 class="WordSection1">
<p class="MsoNormal">Hi Bokun,<o:p></o:p></p>
<p class="MsoNormal"><br>
Originally the call back is meant to enable fast UCLK switching based on display configuration. We can reuse the same interface to notify PMFW for any display related configuration. smu_v13_0_notify_display_change looks to be copied from smuv11, but not really
used now. I think the existing implementation can be dropped altogether.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Thanks,<o:p></o:p></p>
<p class="MsoNormal">Lijo<o:p></o:p></p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Zhang, Bokun <Bokun.Zhang@amd.com> <br>
<b>Sent:</b> Tuesday, August 15, 2023 11:52 PM<br>
<b>To:</b> Lazar, Lijo <Lijo.Lazar@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com>; amd-gfx@lists.freedesktop.org<br>
<b>Cc:</b> Quan, Evan <Evan.Quan@amd.com><br>
<b>Subject:</b> RE: [PATCH v2] drm/amdgpu/pm: Add notification function for no DC support<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p style="margin:15.0pt"><span lang="EN-CA" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:green">[Public]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-CA">Hey Lijo,<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-CA">I have considered to combine the function. However notify_display_change() may serve for another purpose as mentioned in the comment:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> /**<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> * @notify_display_change: Enable fast memory clock switching.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> *<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> * Allows for fine grained memory clock switching but has more stringent<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> * timing requirements.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"> */<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-CA">This function is implemented as smu_v13_0_notify_display_change() for SMU 13, but
<b>not included</b> in smu_v13_0_0_ppt_funcs struct and therefore not called at the moment.<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-CA">I am not completely sure about the purpose of smu_v13_0_notify_display_change().<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-CA">If it makes sense to combine them, I can make the change accordingly. But I would like to know if I should add a new function smu_v13_0_0_notify_display_change, or extend smu_v13_0_notify_display_change()
and add it to smu_v13_0_0_ppt_funcs.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-CA">Thanks!<o:p></o:p></span></p>
<p class="MsoNormal" style="text-indent:9.75pt"><span lang="EN-CA"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Lazar, Lijo <<a href="mailto:Lijo.Lazar@amd.com">Lijo.Lazar@amd.com</a>>
<br>
<b>Sent:</b> Tuesday, August 15, 2023 2:03 PM<br>
<b>To:</b> Deucher, Alexander <<a href="mailto:Alexander.Deucher@amd.com">Alexander.Deucher@amd.com</a>>; Zhang, Bokun <<a href="mailto:Bokun.Zhang@amd.com">Bokun.Zhang@amd.com</a>>;
<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
<b>Cc:</b> Zhang, Bokun <<a href="mailto:Bokun.Zhang@amd.com">Bokun.Zhang@amd.com</a>>; Quan, Evan <<a href="mailto:Evan.Quan@amd.com">Evan.Quan@amd.com</a>><br>
<b>Subject:</b> Re: [PATCH v2] drm/amdgpu/pm: Add notification function for no DC support<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<p style="margin:15.0pt"><span lang="EN-CA" style="font-size:10.0pt;font-family:"Arial",sans-serif;color:green">[Public]<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
<div>
<div>
<p class="MsoNormal"><span lang="EN-CA">There's already another smu callback - notify_display. This can be accommodated there, no need to add another callback.<o:p></o:p></span></p>
</div>
<div id="ms-outlook-mobile-signature">
<div>
<p class="MsoNormal"><span lang="EN-CA"><o:p> </o:p></span></p>
</div>
<p class="MsoNormal"><span lang="EN-CA">Thanks,<br>
Lijo<o:p></o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center"><span lang="EN-CA">
<hr size="2" width="98%" align="center">
</span></div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span lang="EN-CA" style="color:black">From:</span></b><span lang="EN-CA" style="color:black"> amd-gfx <<a href="mailto:amd-gfx-bounces@lists.freedesktop.org">amd-gfx-bounces@lists.freedesktop.org</a>> on behalf of Deucher, Alexander
<<a href="mailto:Alexander.Deucher@amd.com">Alexander.Deucher@amd.com</a>><br>
<b>Sent:</b> Tuesday, August 15, 2023 11:13:14 PM<br>
<b>To:</b> Zhang, Bokun <<a href="mailto:Bokun.Zhang@amd.com">Bokun.Zhang@amd.com</a>>;
<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a> <<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a>><br>
<b>Cc:</b> Zhang, Bokun <<a href="mailto:Bokun.Zhang@amd.com">Bokun.Zhang@amd.com</a>>; Quan, Evan <<a href="mailto:Evan.Quan@amd.com">Evan.Quan@amd.com</a>><br>
<b>Subject:</b> RE: [PATCH v2] drm/amdgpu/pm: Add notification function for no DC support</span><span lang="EN-CA">
<o:p></o:p></span></p>
<div>
<p class="MsoNormal"><span lang="EN-CA"> <o:p></o:p></span></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span lang="EN-CA">[Public]<br>
<br>
[Public]<br>
<br>
> -----Original Message-----<br>
> From: amd-gfx <<a href="mailto:amd-gfx-bounces@lists.freedesktop.org">amd-gfx-bounces@lists.freedesktop.org</a>> On Behalf Of Bokun<br>
> Zhang<br>
> Sent: Tuesday, August 15, 2023 11:50 AM<br>
> To: <a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
> Cc: Zhang, Bokun <<a href="mailto:Bokun.Zhang@amd.com">Bokun.Zhang@amd.com</a>>; Quan, Evan<br>
> <<a href="mailto:Evan.Quan@amd.com">Evan.Quan@amd.com</a>><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 <<a href="mailto:evan.quan@amd.com">evan.quan@amd.com</a>><br>
> Signed-off-by: Bokun Zhang <<a href="mailto:bokun.zhang@amd.com">bokun.zhang@amd.com</a>><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 <<a href="mailto:alexander.deucher@amd.com">alexander.deucher@amd.com</a>><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<o:p></o:p></span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>