Skip to contentSkip to conversation

drm/powerplay: Add smu set xgmi pstate interface

PATCH In review Liu, Shaoyun 2 participants 4 messages Apr 5, 2019 – Apr 10, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/powerplay: Add smu set xgmi pstate interface

XGMI pstate is controlled by SMU, driver need this interface to communicate with SMU

Change-Id I3a30797332557725d48d392bea0c9d59e2d0e427
---
 drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 4 ++++
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c      | 8 ++++++++
 2 files changed, 12 insertions(+)
drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h +4 -0
index 2083139..0e52d1b 100644
@@ -546,6 +546,8 @@ struct smu_funcs
 	int (*get_fan_speed_percent)(struct smu_context *smu, uint32_t *speed);
 	int (*set_fan_speed_percent)(struct smu_context *smu, uint32_t speed);
 	int (*set_fan_speed_rpm)(struct smu_context *smu, uint32_t speed);
+	int (*set_xgmi_pstate)(struct smu_context *smu, uint32_t pstate);
+
 };
 
 #define smu_init_microcode(smu) \
@@ -729,6 +731,8 @@ struct smu_funcs
 	((smu)->funcs->get_sclk ? (smu)->funcs->get_sclk((smu), (low)) : 0)
 #define smu_get_mclk(smu, low) \
 	((smu)->funcs->get_mclk ? (smu)->funcs->get_mclk((smu), (low)) : 0)
+#define smu_set_xgmi_pstate(smu, pstate) \
+		((smu)->funcs->set_xgmi_pstate ? (smu)->funcs->set_xgmi_pstate((smu), (pstate)) : 0)
 
 
 extern int smu_get_atom_data_table(struct smu_context *smu, uint32_t table,
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +8 -0
index 9d75911..2e2ce71 100644
@@ -1952,6 +1952,13 @@ static int smu_v11_0_set_fan_speed_rpm(struct smu_context *smu,
 	return ret;
 }
 
+static int smu_v11_0_set_xgmi_pstate(struct smu_context *smu,
+				     uint32_t pstate)
+{
+	/* send msg to SMU to set pstate */
+	return 0;
+}
+
 static const struct smu_funcs smu_v11_0_funcs = {
 	.init_microcode = smu_v11_0_init_microcode,
 	.load_microcode = smu_v11_0_load_microcode,
@@ -2008,6 +2015,7 @@ static const struct smu_funcs smu_v11_0_funcs = {
 	.get_fan_speed_percent = smu_v11_0_get_fan_speed_percent,
 	.set_fan_speed_percent = smu_v11_0_set_fan_speed_percent,
 	.set_fan_speed_rpm = smu_v11_0_set_fan_speed_rpm,
+	.set_xgmi_pstate = smu_v11_0_set_xgmi_pstate,
 };
 
 void smu_v11_0_set_smu_funcs(struct smu_context *smu)
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1554480091-28163-1-git-send-email-shaoyun.liu-5C7GfCeVMHo@public.gmane.org

#2 lore raw

ping

Quoted 51 lines · Shaoyun

XGMI pstate is controlled by SMU, driver need this interface to communicate with SMU

Change-Id I3a30797332557725d48d392bea0c9d59e2d0e427
---
  drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 4 ++++
  drivers/gpu/drm/amd/powerplay/smu_v11_0.c      | 8 ++++++++
  2 files changed, 12 insertions(+)
drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h +4 -0
index 2083139..0e52d1b 100644
@@ -546,6 +546,8 @@ struct smu_funcs
  	int (*get_fan_speed_percent)(struct smu_context *smu, uint32_t *speed);
  	int (*set_fan_speed_percent)(struct smu_context *smu, uint32_t speed);
  	int (*set_fan_speed_rpm)(struct smu_context *smu, uint32_t speed);
+	int (*set_xgmi_pstate)(struct smu_context *smu, uint32_t pstate);
+
  };
 
  #define smu_init_microcode(smu) \
@@ -729,6 +731,8 @@ struct smu_funcs
  	((smu)->funcs->get_sclk ? (smu)->funcs->get_sclk((smu), (low)) : 0)
  #define smu_get_mclk(smu, low) \
  	((smu)->funcs->get_mclk ? (smu)->funcs->get_mclk((smu), (low)) : 0)
+#define smu_set_xgmi_pstate(smu, pstate) \
+		((smu)->funcs->set_xgmi_pstate ? (smu)->funcs->set_xgmi_pstate((smu), (pstate)) : 0)
 
 
  extern int smu_get_atom_data_table(struct smu_context *smu, uint32_t table,
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +7 -0
index 9d75911..2e2ce71 100644
@@ -1952,6 +1952,13 @@ static int smu_v11_0_set_fan_speed_rpm(struct smu_context *smu,
  	return ret;
  }
 
+static int smu_v11_0_set_xgmi_pstate(struct smu_context *smu,
+				     uint32_t pstate)
+{
+	/* send msg to SMU to set pstate */
+	return 0;
+}
+
  static const struct smu_funcs smu_v11_0_funcs = {
  	.init_microcode = smu_v11_0_init_microcode,
  	.load_microcode = smu_v11_0_load_microcode,

drivers/gpu/drm/amd/powerplay/smu_v11_0.c static const struct smu_funcs smu_v11_0_funcs = { · line 2021

Quoted 7 lines
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +1 -0
@@ -2008,6 +2015,7 @@ static const struct smu_funcs smu_v11_0_funcs = {
  	.get_fan_speed_percent = smu_v11_0_get_fan_speed_percent,
  	.set_fan_speed_percent = smu_v11_0_set_fan_speed_percent,
  	.set_fan_speed_rpm = smu_v11_0_set_fan_speed_rpm,
+	.set_xgmi_pstate = smu_v11_0_set_xgmi_pstate,
  };
 
  void smu_v11_0_set_smu_funcs(struct smu_context *smu)

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#3 lore raw
In reply to a message not in the archive

ping

Quoted 51 lines · Shaoyun

XGMI pstate is controlled by SMU, driver need this interface to communicate with SMU

Change-Id I3a30797332557725d48d392bea0c9d59e2d0e427
---
  drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 4 ++++
  drivers/gpu/drm/amd/powerplay/smu_v11_0.c      | 8 ++++++++
  2 files changed, 12 insertions(+)
drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h +4 -0
index 2083139..0e52d1b 100644
@@ -546,6 +546,8 @@ struct smu_funcs
  	int (*get_fan_speed_percent)(struct smu_context *smu, uint32_t *speed);
  	int (*set_fan_speed_percent)(struct smu_context *smu, uint32_t speed);
  	int (*set_fan_speed_rpm)(struct smu_context *smu, uint32_t speed);
+	int (*set_xgmi_pstate)(struct smu_context *smu, uint32_t pstate);
+
  };
 
  #define smu_init_microcode(smu) \
@@ -729,6 +731,8 @@ struct smu_funcs
  	((smu)->funcs->get_sclk ? (smu)->funcs->get_sclk((smu), (low)) : 0)
  #define smu_get_mclk(smu, low) \
  	((smu)->funcs->get_mclk ? (smu)->funcs->get_mclk((smu), (low)) : 0)
+#define smu_set_xgmi_pstate(smu, pstate) \
+		((smu)->funcs->set_xgmi_pstate ? (smu)->funcs->set_xgmi_pstate((smu), (pstate)) : 0)
 
 
  extern int smu_get_atom_data_table(struct smu_context *smu, uint32_t table,
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +7 -0
index 9d75911..2e2ce71 100644
@@ -1952,6 +1952,13 @@ static int smu_v11_0_set_fan_speed_rpm(struct smu_context *smu,
  	return ret;
  }
 
+static int smu_v11_0_set_xgmi_pstate(struct smu_context *smu,
+				     uint32_t pstate)
+{
+	/* send msg to SMU to set pstate */
+	return 0;
+}
+
  static const struct smu_funcs smu_v11_0_funcs = {
  	.init_microcode = smu_v11_0_init_microcode,
  	.load_microcode = smu_v11_0_load_microcode,

drivers/gpu/drm/amd/powerplay/smu_v11_0.c static const struct smu_funcs smu_v11_0_funcs = { · line 2021

Quoted 7 lines
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +1 -0
@@ -2008,6 +2015,7 @@ static const struct smu_funcs smu_v11_0_funcs = {
  	.get_fan_speed_percent = smu_v11_0_get_fan_speed_percent,
  	.set_fan_speed_percent = smu_v11_0_set_fan_speed_percent,
  	.set_fan_speed_rpm = smu_v11_0_set_fan_speed_rpm,
+	.set_xgmi_pstate = smu_v11_0_set_xgmi_pstate,
  };
 
  void smu_v11_0_set_smu_funcs(struct smu_context *smu)

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by Evan Quan
#4 lore raw
In reply to a message not in the archive

However, if this is for vega20, please be noticed that vega20 still takes old powerplay routines at default.

Regards,
Evan

Quoted 77 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Liu, Shaoyun
Sent: Saturday, April 06, 2019 12:02 AM
To: [email protected]
Cc: Liu, Shaoyun <[email protected]>
Subject: [PATCH 1/2] drm/powerplay: Add smu set xgmi pstate interface

XGMI pstate is controlled by SMU, driver need this interface to communicate with SMU

Change-Id I3a30797332557725d48d392bea0c9d59e2d0e427
---
 drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 4 ++++
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c      | 8 ++++++++
 2 files changed, 12 insertions(+)
drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h +2 -0
index 2083139..0e52d1b 100644
@@ -546,6 +546,8 @@ struct smu_funcs
 	int (*get_fan_speed_percent)(struct smu_context *smu, uint32_t
 *speed);
 	int (*set_fan_speed_percent)(struct smu_context *smu, uint32_t
 speed);
 	int (*set_fan_speed_rpm)(struct smu_context *smu, uint32_t
 speed);
+	int (*set_xgmi_pstate)(struct smu_context *smu, uint32_t pstate);
+

};

#define smu_init_microcode(smu) \

drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h +3 -0
@@ -729,6 +731,8 @@ struct smu_funcs
 	((smu)->funcs->get_sclk ? (smu)->funcs->get_sclk((smu), (low)) : 0)
 #define smu_get_mclk(smu, low) \
 	((smu)->funcs->get_mclk ? (smu)->funcs->get_mclk((smu), (low)) : 0)
+#define smu_set_xgmi_pstate(smu, pstate) \
+		((smu)->funcs->set_xgmi_pstate ? (smu)->funcs-
 >set_xgmi_pstate((smu),
+(pstate)) : 0)
 
 
 extern int smu_get_atom_data_table(struct smu_context *smu, uint32_t

table, diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c
index 9d75911..2e2ce71 100644

drivers/gpu/drm/amd/powerplay/smu_v11_0.c +7 -0
@@ -1952,6 +1952,13 @@ static int smu_v11_0_set_fan_speed_rpm(struct
 smu_context *smu,
 	return ret;
 }
 
+static int smu_v11_0_set_xgmi_pstate(struct smu_context *smu,
+				     uint32_t pstate)
+{
+	/* send msg to SMU to set pstate */
+	return 0;
+}
+
 static const struct smu_funcs smu_v11_0_funcs = {
 	.init_microcode = smu_v11_0_init_microcode,

.load_microcode = smu_v11_0_load_microcode, @@ -2008,6 +2015,7
@@ static const struct smu_funcs smu_v11_0_funcs = {

drivers/gpu/drm/amd/powerplay/smu_v11_0.c +1 -1
 	.get_fan_speed_percent = smu_v11_0_get_fan_speed_percent,
 	.set_fan_speed_percent = smu_v11_0_set_fan_speed_percent,
 	.set_fan_speed_rpm = smu_v11_0_set_fan_speed_rpm,
+	.set_xgmi_pstate = smu_v11_0_set_xgmi_pstate,
 };
 
 void smu_v11_0_set_smu_funcs(struct smu_context *smu)
--

2.7.4

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx