All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amd/powerplay: remove redundancy debug log about smu unsupported features
@ 2019-08-12  8:22 Chengming Gui
       [not found] ` <1565598138-13844-1-git-send-email-Jack.Gui-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: Chengming Gui @ 2019-08-12  8:22 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Chengming Gui

remove redundancy debug log about smu unsupported features

Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
---
 drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c b/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c
index e6fcbdf..03ce871 100644
--- a/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c
+++ b/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c
@@ -215,7 +215,6 @@ static int arcturus_get_smu_feature_index(struct smu_context *smc, uint32_t inde
 
 	mapping = arcturus_feature_mask_map[index];
 	if (!(mapping.valid_mapping)) {
-		pr_warn("Unsupported SMU feature: %d\n", index);
 		return -EINVAL;
 	}
 
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/2] drm/amd/powerplay: add arcturus_is_dpm_running function for arcturus
       [not found] ` <1565598138-13844-1-git-send-email-Jack.Gui-5C7GfCeVMHo@public.gmane.org>
@ 2019-08-12  8:22   ` Chengming Gui
       [not found]     ` <1565598138-13844-2-git-send-email-Jack.Gui-5C7GfCeVMHo@public.gmane.org>
  2019-08-12  8:35   ` [PATCH 1/2] drm/amd/powerplay: remove redundancy debug log about smu unsupported features Kevin Wang
  2019-08-12  9:34   ` Quan, Evan
  2 siblings, 1 reply; 9+ messages in thread
From: Chengming Gui @ 2019-08-12  8:22 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Chengming Gui

add arcturus_is_dpm_running function

Signed-off-by: Chengming Gui <Jack.Gui@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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/2] drm/amd/powerplay: remove redundancy debug log about smu unsupported features
       [not found] ` <1565598138-13844-1-git-send-email-Jack.Gui-5C7GfCeVMHo@public.gmane.org>
  2019-08-12  8:22   ` [PATCH 2/2] drm/amd/powerplay: add arcturus_is_dpm_running function for arcturus Chengming Gui
@ 2019-08-12  8:35   ` Kevin Wang
  2019-08-12  9:34   ` Quan, Evan
  2 siblings, 0 replies; 9+ messages in thread
From: Kevin Wang @ 2019-08-12  8:35 UTC (permalink / raw)
  To: Gui, Jack, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Reviewed-by: Kevin Wang <kevin1.wang@amd.com>

On 8/12/19 4:22 PM, Chengming Gui wrote:
> remove redundancy debug log about smu unsupported features
>
> Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
> ---
>   drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 1 -
>   1 file changed, 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c b/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c
> index e6fcbdf..03ce871 100644
> --- a/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c
> +++ b/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c
> @@ -215,7 +215,6 @@ static int arcturus_get_smu_feature_index(struct smu_context *smc, uint32_t inde
>   
>   	mapping = arcturus_feature_mask_map[index];
>   	if (!(mapping.valid_mapping)) {
> -		pr_warn("Unsupported SMU feature: %d\n", index);
>   		return -EINVAL;
>   	}
>   
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] drm/amd/powerplay: add arcturus_is_dpm_running function for arcturus
       [not found]     ` <1565598138-13844-2-git-send-email-Jack.Gui-5C7GfCeVMHo@public.gmane.org>
@ 2019-08-12  8:36       ` Kevin Wang
  2019-08-12  9:38       ` Quan, Evan
  1 sibling, 0 replies; 9+ messages in thread
From: Kevin Wang @ 2019-08-12  8:36 UTC (permalink / raw)
  To: Gui, Jack, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Reviewed-by: Kevin Wang <kevin1.wang@amd.com>

On 8/12/19 4:22 PM, Chengming Gui wrote:
> add arcturus_is_dpm_running function
>
> Signed-off-by: Chengming Gui <Jack.Gui@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)
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH 1/2] drm/amd/powerplay: remove redundancy debug log about smu unsupported features
       [not found] ` <1565598138-13844-1-git-send-email-Jack.Gui-5C7GfCeVMHo@public.gmane.org>
  2019-08-12  8:22   ` [PATCH 2/2] drm/amd/powerplay: add arcturus_is_dpm_running function for arcturus Chengming Gui
  2019-08-12  8:35   ` [PATCH 1/2] drm/amd/powerplay: remove redundancy debug log about smu unsupported features Kevin Wang
@ 2019-08-12  9:34   ` Quan, Evan
  2 siblings, 0 replies; 9+ messages in thread
From: Quan, Evan @ 2019-08-12  9:34 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Gui, Jack

Reviewed-by: Evan Quan <evan.quan@amd.com>

> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of
> Chengming Gui
> Sent: Monday, August 12, 2019 4:22 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Gui, Jack <Jack.Gui@amd.com>
> Subject: [PATCH 1/2] drm/amd/powerplay: remove redundancy debug log
> about smu unsupported features
> 
> remove redundancy debug log about smu unsupported features
> 
> Signed-off-by: Chengming Gui <Jack.Gui@amd.com>
> ---
>  drivers/gpu/drm/amd/powerplay/arcturus_ppt.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c
> b/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c
> index e6fcbdf..03ce871 100644
> --- a/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c
> +++ b/drivers/gpu/drm/amd/powerplay/arcturus_ppt.c
> @@ -215,7 +215,6 @@ static int arcturus_get_smu_feature_index(struct
> smu_context *smc, uint32_t inde
> 
>  	mapping = arcturus_feature_mask_map[index];
>  	if (!(mapping.valid_mapping)) {
> -		pr_warn("Unsupported SMU feature: %d\n", index);
>  		return -EINVAL;
>  	}
> 
> --
> 2.7.4
> 
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH 2/2] drm/amd/powerplay: add arcturus_is_dpm_running function for arcturus
       [not found]     ` <1565598138-13844-2-git-send-email-Jack.Gui-5C7GfCeVMHo@public.gmane.org>
  2019-08-12  8:36       ` Kevin Wang
@ 2019-08-12  9:38       ` Quan, Evan
       [not found]         ` <MN2PR12MB33441DEDEEB00F8F321F72BBE4D30-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  1 sibling, 1 reply; 9+ messages in thread
From: Quan, Evan @ 2019-08-12  9:38 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Gui, Jack

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@amd.com>
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of
> Chengming Gui
> Sent: Monday, August 12, 2019 4:22 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Gui, Jack <Jack.Gui@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@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@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH 2/2] drm/amd/powerplay: add arcturus_is_dpm_running function for arcturus
       [not found]         ` <MN2PR12MB33441DEDEEB00F8F321F72BBE4D30-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2019-08-12  9:51           ` Gui, Jack
       [not found]             ` <MN2PR12MB35820DB4E84513D7F47606088BD30-rweVpJHSKTr2mYjuiDFEwwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  2019-08-12  9:52           ` Wang, Kevin(Yang)
  1 sibling, 1 reply; 9+ messages in thread
From: Gui, Jack @ 2019-08-12  9:51 UTC (permalink / raw)
  To: Quan, Evan, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Hi Evan,

All supported feature can be set there, 
Anyone of these features is running, we can judge dpm is running.  

BR,
Jack Gui

-----Original Message-----
From: Quan, Evan <Evan.Quan@amd.com> 
Sent: Monday, August 12, 2019 5:39 PM
To: Gui, Jack <Jack.Gui@amd.com>; amd-gfx@lists.freedesktop.org
Cc: Gui, Jack <Jack.Gui@amd.com>
Subject: RE: [PATCH 2/2] drm/amd/powerplay: add arcturus_is_dpm_running function for arcturus

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@amd.com>
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of 
> Chengming Gui
> Sent: Monday, August 12, 2019 4:22 PM
> To: amd-gfx@lists.freedesktop.org
> Cc: Gui, Jack <Jack.Gui@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@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@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/2] drm/amd/powerplay: add arcturus_is_dpm_running function for arcturus
       [not found]         ` <MN2PR12MB33441DEDEEB00F8F321F72BBE4D30-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
  2019-08-12  9:51           ` Gui, Jack
@ 2019-08-12  9:52           ` Wang, Kevin(Yang)
  1 sibling, 0 replies; 9+ messages in thread
From: Wang, Kevin(Yang) @ 2019-08-12  9:52 UTC (permalink / raw)
  To: Quan, Evan, Gui, Jack, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW


[-- Attachment #1.1: Type: text/plain, Size: 3962 bytes --]

if any DPM feature is enabled, then DPM is running, return true.
if all DPM feature is disabled, the DPM is not running, return false.
so the macro of  "SMC_DPM_FEATURE" should be include all dpm feature, whether is enabled or supported.
i think the @Gui, Jack<mailto:Jack.Gui-5C7GfCeVMHo@public.gmane.org>'s patch is right.

Best Regards,
Kevin

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Quan, Evan <Evan.Quan-5C7GfCeVMHo@public.gmane.org>
Sent: Monday, August 12, 2019 5:38 PM
To: Gui, Jack <Jack.Gui-5C7GfCeVMHo@public.gmane.org>; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org <amd-gfx@lists.freedesktop.org>
Cc: Gui, Jack <Jack.Gui-5C7GfCeVMHo@public.gmane.org>
Subject: RE: [PATCH 2/2] drm/amd/powerplay: add arcturus_is_dpm_running function for arcturus

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-5C7GfCeVMHo@public.gmane.org>
> -----Original Message-----
> From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> On Behalf Of
> Chengming Gui
> Sent: Monday, August 12, 2019 4:22 PM
> To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> Cc: Gui, Jack <Jack.Gui-5C7GfCeVMHo@public.gmane.org>
> 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-5C7GfCeVMHo@public.gmane.org>
> ---
>  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-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[-- Attachment #1.2: Type: text/html, Size: 7508 bytes --]

[-- Attachment #2: Type: text/plain, Size: 153 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: [PATCH 2/2] drm/amd/powerplay: add arcturus_is_dpm_running function for arcturus
       [not found]             ` <MN2PR12MB35820DB4E84513D7F47606088BD30-rweVpJHSKTr2mYjuiDFEwwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
@ 2019-08-13  3:14               ` Quan, Evan
  0 siblings, 0 replies; 9+ messages in thread
From: Quan, Evan @ 2019-08-13  3:14 UTC (permalink / raw)
  To: Gui, Jack, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

OK, I see. That will be fine.

Regards,
Evan

> -----Original Message-----
> From: Gui, Jack <Jack.Gui@amd.com>
> Sent: Monday, August 12, 2019 5:51 PM
> To: Quan, Evan <Evan.Quan@amd.com>; amd-gfx@lists.freedesktop.org
> Subject: RE: [PATCH 2/2] drm/amd/powerplay: add
> arcturus_is_dpm_running function for arcturus
> 
> Hi Evan,
> 
> All supported feature can be set there, Anyone of these features is running,
> we can judge dpm is running.
> 
> BR,
> Jack Gui
> 
> -----Original Message-----
> From: Quan, Evan <Evan.Quan@amd.com>
> Sent: Monday, August 12, 2019 5:39 PM
> To: Gui, Jack <Jack.Gui@amd.com>; amd-gfx@lists.freedesktop.org
> Cc: Gui, Jack <Jack.Gui@amd.com>
> Subject: RE: [PATCH 2/2] drm/amd/powerplay: add
> arcturus_is_dpm_running function for arcturus
> 
> 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@amd.com>
> > -----Original Message-----
> > From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of
> > Chengming Gui
> > Sent: Monday, August 12, 2019 4:22 PM
> > To: amd-gfx@lists.freedesktop.org
> > Cc: Gui, Jack <Jack.Gui@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@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@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-08-13  3:14 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-12  8:22 [PATCH 1/2] drm/amd/powerplay: remove redundancy debug log about smu unsupported features Chengming Gui
     [not found] ` <1565598138-13844-1-git-send-email-Jack.Gui-5C7GfCeVMHo@public.gmane.org>
2019-08-12  8:22   ` [PATCH 2/2] drm/amd/powerplay: add arcturus_is_dpm_running function for arcturus Chengming Gui
     [not found]     ` <1565598138-13844-2-git-send-email-Jack.Gui-5C7GfCeVMHo@public.gmane.org>
2019-08-12  8:36       ` Kevin Wang
2019-08-12  9:38       ` Quan, Evan
     [not found]         ` <MN2PR12MB33441DEDEEB00F8F321F72BBE4D30-rweVpJHSKToDMgCC8P//OwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-08-12  9:51           ` Gui, Jack
     [not found]             ` <MN2PR12MB35820DB4E84513D7F47606088BD30-rweVpJHSKTr2mYjuiDFEwwdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2019-08-13  3:14               ` Quan, Evan
2019-08-12  9:52           ` Wang, Kevin(Yang)
2019-08-12  8:35   ` [PATCH 1/2] drm/amd/powerplay: remove redundancy debug log about smu unsupported features Kevin Wang
2019-08-12  9:34   ` Quan, Evan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.