drm/powerplay: Add smu set xgmi pstate interface
authorshaoyunl <shaoyun.liu@amd.com>
Thu, 11 Apr 2019 15:01:07 +0000 (11:01 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 12 Apr 2019 16:29:28 +0000 (11:29 -0500)
XGMI pstate is controlled by SMU, driver need this interface to communicate
with SMU

Signed-off-by: shaoyunl <shaoyun.liu@amd.com>
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h
drivers/gpu/drm/amd/powerplay/smu_v11_0.c

index 26a7d2c7f4fab2cedc1bb3d41ab27eb0e52842fe..c8b168b3413b6d529d892d116b77edddbbb22132 100644 (file)
@@ -540,6 +540,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) \
@@ -723,6 +725,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,
index d2e2a4e2d0eb160c0a7987420efa4805db970353..c478b38662d09946fef1ff66b27db81d89550f7f 100644 (file)
@@ -1893,6 +1893,13 @@ set_fan_speed_rpm_failed:
        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,
@@ -1947,6 +1954,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)
@@ -1954,7 +1962,6 @@ void smu_v11_0_set_smu_funcs(struct smu_context *smu)
        struct amdgpu_device *adev = smu->adev;
 
        smu->funcs = &smu_v11_0_funcs;
-
        switch (adev->asic_type) {
        case CHIP_VEGA20:
                vega20_set_ppt_funcs(smu);