[PATCH 2/2] drm/amd/powerplay: add arcturus_is_dpm_running function for arcturus

Quan, Evan Evan.Quan at amd.com
Mon Aug 12 09:38:56 UTC 2019


Please set FEATURE_DPM_PREFETCHER_MASK | FEATURE_DPM_GFXCLK_MASK only. For now, only these two are enabled on arcturus.

With that fixed, the patch is reviewed-by: Evan Quan <evan.quan at amd.com>
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of
> Chengming Gui
> Sent: Monday, August 12, 2019 4:22 PM
> To: amd-gfx at lists.freedesktop.org
> Cc: Gui, Jack <Jack.Gui at amd.com>
> Subject: [PATCH 2/2] drm/amd/powerplay: add arcturus_is_dpm_running
> function for arcturus
> 
> add arcturus_is_dpm_running function
> 
> Signed-off-by: Chengming Gui <Jack.Gui at amd.com>
> ---
>  drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 21
> +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> diff --git a/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c
> b/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c
> index 03ce871..9107beb 100644
> --- a/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c
> +++ b/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c
> @@ -51,6 +51,15 @@
>  #define SMU_FEATURES_HIGH_MASK       0xFFFFFFFF00000000
>  #define SMU_FEATURES_HIGH_SHIFT      32
> 
> +#define SMC_DPM_FEATURE ( \
> +	FEATURE_DPM_PREFETCHER_MASK | \
> +	FEATURE_DPM_GFXCLK_MASK | \
> +	FEATURE_DPM_UCLK_MASK | \
> +	FEATURE_DPM_SOCCLK_MASK | \
> +	FEATURE_DPM_MP0CLK_MASK | \
> +	FEATURE_DPM_FCLK_MASK | \
> +	FEATURE_DPM_XGMI_MASK)
> +
>  /* possible frequency drift (1Mhz) */
>  #define EPSILON				1
> 
> @@ -1873,6 +1882,17 @@ static void arcturus_dump_pptable(struct
> smu_context *smu)
> 
>  }
> 
> +static bool arcturus_is_dpm_running(struct smu_context *smu) {
> +	int ret = 0;
> +	uint32_t feature_mask[2];
> +	unsigned long feature_enabled;
> +	ret = smu_feature_get_enabled_mask(smu, feature_mask, 2);
> +	feature_enabled = (unsigned long)((uint64_t)feature_mask[0] |
> +			   ((uint64_t)feature_mask[1] << 32));
> +	return !!(feature_enabled & SMC_DPM_FEATURE); }
> +
>  static const struct pptable_funcs arcturus_ppt_funcs = {
>  	/* translate smu index into arcturus specific index */
>  	.get_smu_msg_index = arcturus_get_smu_msg_index, @@ -1910,6
> +1930,7 @@ static const struct pptable_funcs arcturus_ppt_funcs = {
>  	/* debug (internal used) */
>  	.dump_pptable = arcturus_dump_pptable,
>  	.get_power_limit = arcturus_get_power_limit,
> +	.is_dpm_running = arcturus_is_dpm_running,
>  };
> 
>  void arcturus_set_ppt_funcs(struct smu_context *smu)
> --
> 2.7.4
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list