drm/amd/swSMU: add callback to set AC/DC power source (v2)
authorEvan Quan <evan.quan@amd.com>
Fri, 20 Mar 2020 18:03:25 +0000 (14:03 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 25 Mar 2020 21:00:11 +0000 (17:00 -0400)
This is needed to tell the SMU firmware what state is in
in certain cases.  DC mode does not allow overclocking
for example.

v2: split Evan's original patch (Alex)

Bug: https://gitlab.freedesktop.org/drm/amd/issues/1043
Reviewed-by: Evan Quan <evan.quan@amd.com>
Signed-off-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_internal.h

index 657a6f17e91f350a2e1a8b337dac29b5152784c7..323e7e61493b7fca6e6a89eb3663c773d971b2c9 100644 (file)
@@ -570,6 +570,7 @@ struct pptable_funcs {
        int (*override_pcie_parameters)(struct smu_context *smu);
        uint32_t (*get_pptable_power_limit)(struct smu_context *smu);
        int (*disable_umc_cdr_12gbps_workaround)(struct smu_context *smu);
+       int (*set_power_source)(struct smu_context *smu, enum smu_power_src_type power_src);
 };
 
 int smu_load_microcode(struct smu_context *smu);
index 6900877de84597c1ff951ed22d6c95f7b332dab4..40c35bcc5a0a2c9a358e6773375e156c7a5bc01c 100644 (file)
@@ -211,4 +211,7 @@ static inline int smu_send_smc_msg(struct smu_context *smu, enum smu_message_typ
 #define smu_disable_umc_cdr_12gbps_workaround(smu) \
        ((smu)->ppt_funcs->disable_umc_cdr_12gbps_workaround ? (smu)->ppt_funcs->disable_umc_cdr_12gbps_workaround((smu)) : 0)
 
+#define smu_set_power_source(smu, power_src) \
+       ((smu)->ppt_funcs->set_power_source ? (smu)->ppt_funcs->set_power_source((smu), (power_src)) : 0)
+
 #endif