<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>if any DPM feature is enabled, then DPM is running, return true.</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>if all DPM feature is disabled, the DPM is not running, return false.</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">so the macro of "</span><i style="font-size: 12pt; font-variant-ligatures: inherit; font-variant-caps: inherit; font-weight: inherit;">SMC_DPM_FEATURE</i><span style="color: rgb(0, 0, 0); font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt;">"
should be include all dpm feature, whether is enabled or supported.</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>i think the <a id="OWAAM823302" class="_1OtrSZdhKXVv3UhaivrdJ4 mention ms-bgc-nlr ms-fcl-b" href="mailto:Jack.Gui@amd.com">@Gui, Jack</a>'s patch is right.</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span><br>
</span></div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span>Best Regards,<br>
Kevin<br>
</span><span></span><br>
</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> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Quan, Evan <Evan.Quan@amd.com><br>
<b>Sent:</b> Monday, August 12, 2019 5:38 PM<br>
<b>To:</b> Gui, Jack <Jack.Gui@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Gui, Jack <Jack.Gui@amd.com><br>
<b>Subject:</b> RE: [PATCH 2/2] drm/amd/powerplay: add arcturus_is_dpm_running function for arcturus</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Please set FEATURE_DPM_PREFETCHER_MASK | FEATURE_DPM_GFXCLK_MASK only. For now, only these two are enabled on arcturus.<br>
<br>
With that fixed, the patch is reviewed-by: Evan Quan <evan.quan@amd.com><br>
> -----Original Message-----<br>
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of<br>
> Chengming Gui<br>
> Sent: Monday, August 12, 2019 4:22 PM<br>
> To: amd-gfx@lists.freedesktop.org<br>
> Cc: Gui, Jack <Jack.Gui@amd.com><br>
> Subject: [PATCH 2/2] drm/amd/powerplay: add arcturus_is_dpm_running<br>
> function for arcturus<br>
> <br>
> add arcturus_is_dpm_running function<br>
> <br>
> Signed-off-by: Chengming Gui <Jack.Gui@amd.com><br>
> ---<br>
> drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 21<br>
> +++++++++++++++++++++<br>
> 1 file changed, 21 insertions(+)<br>
> <br>
> diff --git a/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c<br>
> b/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c<br>
> index 03ce871..9107beb 100644<br>
> --- a/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c<br>
> +++ b/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c<br>
> @@ -51,6 +51,15 @@<br>
> #define SMU_FEATURES_HIGH_MASK 0xFFFFFFFF00000000<br>
> #define SMU_FEATURES_HIGH_SHIFT 32<br>
> <br>
> +#define SMC_DPM_FEATURE ( \<br>
> + FEATURE_DPM_PREFETCHER_MASK | \<br>
> + FEATURE_DPM_GFXCLK_MASK | \<br>
> + FEATURE_DPM_UCLK_MASK | \<br>
> + FEATURE_DPM_SOCCLK_MASK | \<br>
> + FEATURE_DPM_MP0CLK_MASK | \<br>
> + FEATURE_DPM_FCLK_MASK | \<br>
> + FEATURE_DPM_XGMI_MASK)<br>
> +<br>
> /* possible frequency drift (1Mhz) */<br>
> #define EPSILON 1<br>
> <br>
> @@ -1873,6 +1882,17 @@ static void arcturus_dump_pptable(struct<br>
> smu_context *smu)<br>
> <br>
> }<br>
> <br>
> +static bool arcturus_is_dpm_running(struct smu_context *smu) {<br>
> + int ret = 0;<br>
> + uint32_t feature_mask[2];<br>
> + unsigned long feature_enabled;<br>
> + ret = smu_feature_get_enabled_mask(smu, feature_mask, 2);<br>
> + feature_enabled = (unsigned long)((uint64_t)feature_mask[0] |<br>
> + ((uint64_t)feature_mask[1] << 32));<br>
> + return !!(feature_enabled & SMC_DPM_FEATURE); }<br>
> +<br>
> static const struct pptable_funcs arcturus_ppt_funcs = {<br>
> /* translate smu index into arcturus specific index */<br>
> .get_smu_msg_index = arcturus_get_smu_msg_index, @@ -1910,6<br>
> +1930,7 @@ static const struct pptable_funcs arcturus_ppt_funcs = {<br>
> /* debug (internal used) */<br>
> .dump_pptable = arcturus_dump_pptable,<br>
> .get_power_limit = arcturus_get_power_limit,<br>
> + .is_dpm_running = arcturus_is_dpm_running,<br>
> };<br>
> <br>
> void arcturus_set_ppt_funcs(struct smu_context *smu)<br>
> --<br>
> 2.7.4<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>
_______________________________________________<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></div>
</span></font></div>
</body>
</html>