All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/2] drm/amdgpu: Set proper function to set xgmi pstate
@ 2019-04-05 16:01 Liu, Shaoyun
       [not found] ` <1554480103-28214-1-git-send-email-shaoyun.liu-5C7GfCeVMHo@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Liu, Shaoyun @ 2019-04-05 16:01 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Liu, Shaoyun

Driver need to call SMU to set xgmi pstate

Change-Id: Iad7fd0e3b3155e45be8fe9119686c5bafa3c176c
Signed-off-by: shaoyunl <shaoyun.liu@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
index 3368347..a48c84c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
@@ -24,6 +24,7 @@
 #include <linux/list.h>
 #include "amdgpu.h"
 #include "amdgpu_xgmi.h"
+#include "amdgpu_smu.h"
 
 
 static DEFINE_MUTEX(xgmi_mutex);
@@ -216,7 +217,17 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device *adev, int pstate)
 
 	if (hive->pstate == pstate)
 		return 0;
-	/* Todo : sent the message to SMU for pstate change */
+
+	dev_dbg(adev->dev, "Set xgmi pstate %d.\n", pstate);
+
+	if (is_support_sw_smu(adev))
+		ret = smu_set_xgmi_pstate(&adev->smu, pstate);
+	if (ret)
+		dev_err(adev->dev,
+			"XGMI: Set pstate failure on device %llx, hive %llx, ret %d",
+			adev->gmc.xgmi.node_id,
+			adev->gmc.xgmi.hive_id, ret);
+
 	return ret;
 }
 
-- 
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] 3+ messages in thread

* Re: [PATCH 2/2] drm/amdgpu: Set proper function to set xgmi pstate
       [not found] ` <1554480103-28214-1-git-send-email-shaoyun.liu-5C7GfCeVMHo@public.gmane.org>
@ 2019-04-09 14:56   ` Liu, Shaoyun
  2019-04-10  1:31   ` Quan, Evan
  1 sibling, 0 replies; 3+ messages in thread
From: Liu, Shaoyun @ 2019-04-09 14:56 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

ping

On 2019-04-05 12:01 p.m., Liu, Shaoyun wrote:
> Driver need to call SMU to set xgmi pstate
>
> Change-Id: Iad7fd0e3b3155e45be8fe9119686c5bafa3c176c
> Signed-off-by: shaoyunl <shaoyun.liu@amd.com>
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 13 ++++++++++++-
>   1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
> index 3368347..a48c84c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
> @@ -24,6 +24,7 @@
>   #include <linux/list.h>
>   #include "amdgpu.h"
>   #include "amdgpu_xgmi.h"
> +#include "amdgpu_smu.h"
>   
>   
>   static DEFINE_MUTEX(xgmi_mutex);
> @@ -216,7 +217,17 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device *adev, int pstate)
>   
>   	if (hive->pstate == pstate)
>   		return 0;
> -	/* Todo : sent the message to SMU for pstate change */
> +
> +	dev_dbg(adev->dev, "Set xgmi pstate %d.\n", pstate);
> +
> +	if (is_support_sw_smu(adev))
> +		ret = smu_set_xgmi_pstate(&adev->smu, pstate);
> +	if (ret)
> +		dev_err(adev->dev,
> +			"XGMI: Set pstate failure on device %llx, hive %llx, ret %d",
> +			adev->gmc.xgmi.node_id,
> +			adev->gmc.xgmi.hive_id, ret);
> +
>   	return ret;
>   }
>   
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* RE: [PATCH 2/2] drm/amdgpu: Set proper function to set xgmi pstate
       [not found] ` <1554480103-28214-1-git-send-email-shaoyun.liu-5C7GfCeVMHo@public.gmane.org>
  2019-04-09 14:56   ` Liu, Shaoyun
@ 2019-04-10  1:31   ` Quan, Evan
  1 sibling, 0 replies; 3+ messages in thread
From: Quan, Evan @ 2019-04-10  1:31 UTC (permalink / raw)
  To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW; +Cc: Liu, Shaoyun

'pstate' here (int) is with different data type from the 1st patch of this series(uint32_t there).
Please check whether that can cause any potential issues.
With that confirmed, 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 Liu,
> Shaoyun
> Sent: Saturday, April 06, 2019 12:02 AM
> To: amd-gfx@lists.freedesktop.org
> Cc: Liu, Shaoyun <Shaoyun.Liu@amd.com>
> Subject: [PATCH 2/2] drm/amdgpu: Set proper function to set xgmi pstate
> 
> Driver need to call SMU to set xgmi pstate
> 
> Change-Id: Iad7fd0e3b3155e45be8fe9119686c5bafa3c176c
> Signed-off-by: shaoyunl <shaoyun.liu@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
> index 3368347..a48c84c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
> @@ -24,6 +24,7 @@
>  #include <linux/list.h>
>  #include "amdgpu.h"
>  #include "amdgpu_xgmi.h"
> +#include "amdgpu_smu.h"
> 
> 
>  static DEFINE_MUTEX(xgmi_mutex);
> @@ -216,7 +217,17 @@ int amdgpu_xgmi_set_pstate(struct amdgpu_device
> *adev, int pstate)
> 
>  	if (hive->pstate == pstate)
>  		return 0;
> -	/* Todo : sent the message to SMU for pstate change */
> +
> +	dev_dbg(adev->dev, "Set xgmi pstate %d.\n", pstate);
> +
> +	if (is_support_sw_smu(adev))
> +		ret = smu_set_xgmi_pstate(&adev->smu, pstate);
> +	if (ret)
> +		dev_err(adev->dev,
> +			"XGMI: Set pstate failure on device %llx, hive %llx,
> ret %d",
> +			adev->gmc.xgmi.node_id,
> +			adev->gmc.xgmi.hive_id, ret);
> +
>  	return ret;
>  }
> 
> --
> 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] 3+ messages in thread

end of thread, other threads:[~2019-04-10  1:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-05 16:01 [PATCH 2/2] drm/amdgpu: Set proper function to set xgmi pstate Liu, Shaoyun
     [not found] ` <1554480103-28214-1-git-send-email-shaoyun.liu-5C7GfCeVMHo@public.gmane.org>
2019-04-09 14:56   ` Liu, Shaoyun
2019-04-10  1:31   ` 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.