Skip to content

Commit 2c02b38

Browse files
Evan Quanalexdeucher
authored andcommitted
drm/amd/swSMU: add callback to set AC/DC power source (v2)
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 <[email protected]> Signed-off-by: Evan Quan <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 77bb2f2 commit 2c02b38

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,7 @@ struct pptable_funcs {
570570
int (*override_pcie_parameters)(struct smu_context *smu);
571571
uint32_t (*get_pptable_power_limit)(struct smu_context *smu);
572572
int (*disable_umc_cdr_12gbps_workaround)(struct smu_context *smu);
573+
int (*set_power_source)(struct smu_context *smu, enum smu_power_src_type power_src);
573574
};
574575

575576
int smu_load_microcode(struct smu_context *smu);

drivers/gpu/drm/amd/powerplay/smu_internal.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,4 +211,7 @@ static inline int smu_send_smc_msg(struct smu_context *smu, enum smu_message_typ
211211
#define smu_disable_umc_cdr_12gbps_workaround(smu) \
212212
((smu)->ppt_funcs->disable_umc_cdr_12gbps_workaround ? (smu)->ppt_funcs->disable_umc_cdr_12gbps_workaround((smu)) : 0)
213213

214+
#define smu_set_power_source(smu, power_src) \
215+
((smu)->ppt_funcs->set_power_source ? (smu)->ppt_funcs->set_power_source((smu), (power_src)) : 0)
216+
214217
#endif

0 commit comments

Comments
 (0)