drm/amd/powerplay: expose the function of smu read argument
authorLikun Gao <Likun.Gao@amd.com>
Thu, 20 Dec 2018 12:09:00 +0000 (20:09 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 19 Mar 2019 20:03:56 +0000 (15:03 -0500)
Expose the function of smu_read_smc_arg to get argument value from SMU11.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Kevin Wang <Kevin1.Wang@amd.com>
Acked-by: Alex Deucher <alexander.deucher@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 fb5ca7136eb35d4640cf726d16952610b67ed15a..8eb2b75829e7a2c8c9bd6c30935f6c54176dc06c 100644 (file)
@@ -221,6 +221,7 @@ struct smu_funcs
        int (*system_features_control)(struct smu_context *smu, bool en);
        int (*send_smc_msg)(struct smu_context *smu, uint16_t msg);
        int (*send_smc_msg_with_param)(struct smu_context *smu, uint16_t msg, uint32_t param);
+       int (*read_smc_arg)(struct smu_context *smu, uint32_t *arg);
 
 };
 
@@ -270,6 +271,8 @@ struct smu_funcs
        ((smu)->funcs->send_smc_msg? (smu)->funcs->send_smc_msg((smu), (msg)) : 0)
 #define smu_send_smc_msg_with_param(smu, msg, param) \
        ((smu)->funcs->send_smc_msg_with_param? (smu)->funcs->send_smc_msg_with_param((smu), (msg), (param)) : 0)
+#define smu_read_smc_arg(smu, arg) \
+       ((smu)->funcs->read_smc_arg? (smu)->funcs->read_smc_arg((smu), (arg)) : 0)
 #define smu_store_powerplay_table(smu) \
        ((smu)->ppt_funcs->store_powerplay_table ? (smu)->ppt_funcs->store_powerplay_table((smu)) : 0)
 #define smu_check_powerplay_table(smu) \
index 1b82c254e5808f81ac214d3eb60f6f9a70d0b17f..ff3cfdbd620e96a426e64879e9fbcd6006f81209 100644 (file)
@@ -213,7 +213,7 @@ static int smu_v11_0_check_fw_version(struct smu_context *smu)
        if (ret)
                goto err;
 
-       ret = smu_v11_0_read_arg(smu, &smu_version);
+       ret = smu_read_smc_arg(smu, &smu_version);
        if (ret)
                goto err;
 
@@ -670,6 +670,7 @@ static const struct smu_funcs smu_v11_0_funcs = {
        .check_fw_version = smu_v11_0_check_fw_version,
        .send_smc_msg = smu_v11_0_send_msg,
        .send_smc_msg_with_param = smu_v11_0_send_msg_with_param,
+       .read_smc_arg = smu_v11_0_read_arg,
        .read_pptable_from_vbios = smu_v11_0_read_pptable_from_vbios,
        .init_smc_tables = smu_v11_0_init_smc_tables,
        .fini_smc_tables = smu_v11_0_fini_smc_tables,