<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>this is my intention,</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>i think we should to keep the  macro name of __SMU_DUMMY_MAP.</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
the smu driver code will use macro SMU_MESSAGE_TYPES and SMU_FEATURE_MASKS.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
the __SMU_DUMMY_MAP just a placeholder, the driver shouldn't add more one.</div>
<span></span>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Best Regards,<br>
Kevin</div>
<div id="appendonsend"></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> Quan, Evan <Evan.Quan@amd.com><br>
<b>Sent:</b> Thursday, July 25, 2019 5:35 PM<br>
<b>To:</b> Wang, Kevin(Yang) <Kevin1.Wang@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Deucher, Alexander <Alexander.Deucher@amd.com>; Huang, Ray <Ray.Huang@amd.com>; Feng, Kenneth <Kenneth.Feng@amd.com>; Wang, Kevin(Yang) <Kevin1.Wang@amd.com><br>
<b>Subject:</b> RE: [PATCH 3/5] drm/amd/powerplay: add smu feature name support</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">For patch2 and patch3, __SMU_DUMMY_MAP has several different defines.<br>
It's not sure what it is defined as and that's why you need "#undef __SMU_DUMMY_MAP" before each use.<br>
Please give them separate names and avoid this confusing.<br>
<br>
Regards,<br>
Evan<br>
> -----Original Message-----<br>
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of<br>
> Wang, Kevin(Yang)<br>
> Sent: Thursday, July 25, 2019 1:11 PM<br>
> To: amd-gfx@lists.freedesktop.org<br>
> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Huang, Ray<br>
> <Ray.Huang@amd.com>; Feng, Kenneth <Kenneth.Feng@amd.com>; Wang,<br>
> Kevin(Yang) <Kevin1.Wang@amd.com><br>
> Subject: [PATCH 3/5] drm/amd/powerplay: add smu feature name support<br>
> <br>
> add smu_get_feature_name support in smu.<br>
> <br>
> Signed-off-by: Kevin Wang <kevin1.wang@amd.com><br>
> ---<br>
>  drivers/gpu/drm/amd/powerplay/amdgpu_smu.c    |  13 +++<br>
>  .../gpu/drm/amd/powerplay/inc/amdgpu_smu.h    |   1 +<br>
>  drivers/gpu/drm/amd/powerplay/inc/smu_types.h | 109 +++++++++--------<br>
> -<br>
>  3 files changed, 71 insertions(+), 52 deletions(-)<br>
> <br>
> diff --git a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c<br>
> b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c<br>
> index 4604b6af56bb..8563f9083f4e 100644<br>
> --- a/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c<br>
> +++ b/drivers/gpu/drm/amd/powerplay/amdgpu_smu.c<br>
> @@ -42,6 +42,19 @@ const char *smu_get_message_name(struct<br>
> smu_context *smu, enum smu_message_type<br>
>        return __smu_message_names[type];<br>
>  }<br>
> <br>
> +#undef __SMU_DUMMY_MAP<br>
> +#define __SMU_DUMMY_MAP(fea) #fea<br>
> +static const char* __smu_feature_names[] = {<br>
> +     SMU_FEATURE_MASKS<br>
> +};<br>
> +<br>
> +const char *smu_get_feature_name(struct smu_context *smu, enum<br>
> +smu_feature_mask feature) {<br>
> +     if (feature < 0 || feature > SMU_FEATURE_COUNT)<br>
> +             return "unknow smu feature";<br>
> +     return __smu_feature_names[feature];<br>
> +}<br>
> +<br>
>  int smu_get_smc_version(struct smu_context *smu, uint32_t *if_version,<br>
> uint32_t *smu_version)  {<br>
>        int ret = 0;<br>
> diff --git a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h<br>
> b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h<br>
> index 035f857922ec..ba2385026b89 100644<br>
> --- a/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h<br>
> +++ b/drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h<br>
> @@ -805,5 +805,6 @@ int smu_force_performance_level(struct<br>
> smu_context *smu, enum amd_dpm_forced_lev  int<br>
> smu_set_display_count(struct smu_context *smu, uint32_t count);  bool<br>
> smu_clk_dpm_is_enabled(struct smu_context *smu, enum smu_clk_type<br>
> clk_type);  const char *smu_get_message_name(struct smu_context *smu,<br>
> enum smu_message_type type);<br>
> +const char *smu_get_feature_name(struct smu_context *smu, enum<br>
> +smu_feature_mask feature);<br>
> <br>
>  #endif<br>
> diff --git a/drivers/gpu/drm/amd/powerplay/inc/smu_types.h<br>
> b/drivers/gpu/drm/amd/powerplay/inc/smu_types.h<br>
> index d42e3424e704..8793c8d0dc52 100644<br>
> --- a/drivers/gpu/drm/amd/powerplay/inc/smu_types.h<br>
> +++ b/drivers/gpu/drm/amd/powerplay/inc/smu_types.h<br>
> @@ -154,59 +154,64 @@ enum smu_clk_type {<br>
>        SMU_CLK_COUNT,<br>
>  };<br>
> <br>
> +#define SMU_FEATURE_MASKS                            \<br>
> +       __SMU_DUMMY_MAP(DPM_PREFETCHER),                      \<br>
> +       __SMU_DUMMY_MAP(DPM_GFXCLK),                           \<br>
> +       __SMU_DUMMY_MAP(DPM_UCLK),                             \<br>
> +       __SMU_DUMMY_MAP(DPM_SOCCLK),                           \<br>
> +       __SMU_DUMMY_MAP(DPM_UVD),                              \<br>
> +       __SMU_DUMMY_MAP(DPM_VCE),                              \<br>
> +       __SMU_DUMMY_MAP(ULV),                                  \<br>
> +       __SMU_DUMMY_MAP(DPM_MP0CLK),                           \<br>
> +       __SMU_DUMMY_MAP(DPM_LINK),                             \<br>
> +       __SMU_DUMMY_MAP(DPM_DCEFCLK),                          \<br>
> +       __SMU_DUMMY_MAP(DS_GFXCLK),                            \<br>
> +       __SMU_DUMMY_MAP(DS_SOCCLK),                            \<br>
> +       __SMU_DUMMY_MAP(DS_LCLK),                              \<br>
> +       __SMU_DUMMY_MAP(PPT),                                  \<br>
> +       __SMU_DUMMY_MAP(TDC),                                  \<br>
> +       __SMU_DUMMY_MAP(THERMAL),                              \<br>
> +       __SMU_DUMMY_MAP(GFX_PER_CU_CG),                        \<br>
> +       __SMU_DUMMY_MAP(RM),                                   \<br>
> +       __SMU_DUMMY_MAP(DS_DCEFCLK),                           \<br>
> +       __SMU_DUMMY_MAP(ACDC),                                 \<br>
> +       __SMU_DUMMY_MAP(VR0HOT),                               \<br>
> +       __SMU_DUMMY_MAP(VR1HOT),                               \<br>
> +       __SMU_DUMMY_MAP(FW_CTF),                               \<br>
> +       __SMU_DUMMY_MAP(LED_DISPLAY),                          \<br>
> +       __SMU_DUMMY_MAP(FAN_CONTROL),                          \<br>
> +       __SMU_DUMMY_MAP(GFX_EDC),                              \<br>
> +       __SMU_DUMMY_MAP(GFXOFF),                               \<br>
> +       __SMU_DUMMY_MAP(CG),                                   \<br>
> +       __SMU_DUMMY_MAP(DPM_FCLK),                             \<br>
> +       __SMU_DUMMY_MAP(DS_FCLK),                              \<br>
> +       __SMU_DUMMY_MAP(DS_MP1CLK),                            \<br>
> +       __SMU_DUMMY_MAP(DS_MP0CLK),                            \<br>
> +       __SMU_DUMMY_MAP(XGMI),                                 \<br>
> +       __SMU_DUMMY_MAP(DPM_GFX_PACE),                         \<br>
> +       __SMU_DUMMY_MAP(MEM_VDDCI_SCALING),                    \<br>
> +       __SMU_DUMMY_MAP(MEM_MVDD_SCALING),                     \<br>
> +       __SMU_DUMMY_MAP(DS_UCLK),                              \<br>
> +       __SMU_DUMMY_MAP(GFX_ULV),                              \<br>
> +       __SMU_DUMMY_MAP(FW_DSTATE),                            \<br>
> +       __SMU_DUMMY_MAP(BACO),                                 \<br>
> +       __SMU_DUMMY_MAP(VCN_PG),                               \<br>
> +       __SMU_DUMMY_MAP(JPEG_PG),                              \<br>
> +       __SMU_DUMMY_MAP(USB_PG),                               \<br>
> +       __SMU_DUMMY_MAP(RSMU_SMN_CG),                          \<br>
> +       __SMU_DUMMY_MAP(APCC_PLUS),                            \<br>
> +       __SMU_DUMMY_MAP(GTHR),                                 \<br>
> +       __SMU_DUMMY_MAP(GFX_DCS),                              \<br>
> +       __SMU_DUMMY_MAP(GFX_SS),                               \<br>
> +       __SMU_DUMMY_MAP(OUT_OF_BAND_MONITOR),                  \<br>
> +       __SMU_DUMMY_MAP(TEMP_DEPENDENT_VMIN),                  \<br>
> +       __SMU_DUMMY_MAP(MMHUB_PG),                             \<br>
> +       __SMU_DUMMY_MAP(ATHUB_PG),                             \<br>
> +<br>
> +#undef __SMU_DUMMY_MAP<br>
> +#define __SMU_DUMMY_MAP(feature)<br>
>        SMU_FEATURE_##feature##_BIT<br>
>  enum smu_feature_mask {<br>
> -     SMU_FEATURE_DPM_PREFETCHER_BIT,<br>
> -     SMU_FEATURE_DPM_GFXCLK_BIT,<br>
> -     SMU_FEATURE_DPM_UCLK_BIT,<br>
> -     SMU_FEATURE_DPM_SOCCLK_BIT,<br>
> -     SMU_FEATURE_DPM_UVD_BIT,<br>
> -     SMU_FEATURE_DPM_VCE_BIT,<br>
> -     SMU_FEATURE_ULV_BIT,<br>
> -     SMU_FEATURE_DPM_MP0CLK_BIT,<br>
> -     SMU_FEATURE_DPM_LINK_BIT,<br>
> -     SMU_FEATURE_DPM_DCEFCLK_BIT,<br>
> -     SMU_FEATURE_DS_GFXCLK_BIT,<br>
> -     SMU_FEATURE_DS_SOCCLK_BIT,<br>
> -     SMU_FEATURE_DS_LCLK_BIT,<br>
> -     SMU_FEATURE_PPT_BIT,<br>
> -     SMU_FEATURE_TDC_BIT,<br>
> -     SMU_FEATURE_THERMAL_BIT,<br>
> -     SMU_FEATURE_GFX_PER_CU_CG_BIT,<br>
> -     SMU_FEATURE_RM_BIT,<br>
> -     SMU_FEATURE_DS_DCEFCLK_BIT,<br>
> -     SMU_FEATURE_ACDC_BIT,<br>
> -     SMU_FEATURE_VR0HOT_BIT,<br>
> -     SMU_FEATURE_VR1HOT_BIT,<br>
> -     SMU_FEATURE_FW_CTF_BIT,<br>
> -     SMU_FEATURE_LED_DISPLAY_BIT,<br>
> -     SMU_FEATURE_FAN_CONTROL_BIT,<br>
> -     SMU_FEATURE_GFX_EDC_BIT,<br>
> -     SMU_FEATURE_GFXOFF_BIT,<br>
> -     SMU_FEATURE_CG_BIT,<br>
> -     SMU_FEATURE_DPM_FCLK_BIT,<br>
> -     SMU_FEATURE_DS_FCLK_BIT,<br>
> -     SMU_FEATURE_DS_MP1CLK_BIT,<br>
> -     SMU_FEATURE_DS_MP0CLK_BIT,<br>
> -     SMU_FEATURE_XGMI_BIT,<br>
> -     SMU_FEATURE_DPM_GFX_PACE_BIT,<br>
> -     SMU_FEATURE_MEM_VDDCI_SCALING_BIT,<br>
> -     SMU_FEATURE_MEM_MVDD_SCALING_BIT,<br>
> -     SMU_FEATURE_DS_UCLK_BIT,<br>
> -     SMU_FEATURE_GFX_ULV_BIT,<br>
> -     SMU_FEATURE_FW_DSTATE_BIT,<br>
> -     SMU_FEATURE_BACO_BIT,<br>
> -     SMU_FEATURE_VCN_PG_BIT,<br>
> -     SMU_FEATURE_JPEG_PG_BIT,<br>
> -     SMU_FEATURE_USB_PG_BIT,<br>
> -     SMU_FEATURE_RSMU_SMN_CG_BIT,<br>
> -     SMU_FEATURE_APCC_PLUS_BIT,<br>
> -     SMU_FEATURE_GTHR_BIT,<br>
> -     SMU_FEATURE_GFX_DCS_BIT,<br>
> -     SMU_FEATURE_GFX_SS_BIT,<br>
> -     SMU_FEATURE_OUT_OF_BAND_MONITOR_BIT,<br>
> -     SMU_FEATURE_TEMP_DEPENDENT_VMIN_BIT,<br>
> -     SMU_FEATURE_MMHUB_PG_BIT,<br>
> -     SMU_FEATURE_ATHUB_PG_BIT,<br>
> +     SMU_FEATURE_MASKS<br>
>        SMU_FEATURE_COUNT,<br>
>  };<br>
> <br>
> --<br>
> 2.22.0<br>
> <br>
> _______________________________________________<br>
> amd-gfx mailing list<br>
> amd-gfx@lists.freedesktop.org<br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>