Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amd/pm: add vcn/jepg enable functions for yellow carp

This patch is to add vcn/jepg enable functions to power up/down them
with smu messages. VCN/JEPG are poweroff by default.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: James Zhu <James.Zhu@amd.com>
Tested-by: James Zhu <James.Zhu@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Aaron Liu <aaron.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Huang Rui and committed by
Alex Deucher
3975cd8f db72c3fa

+33
+33
drivers/gpu/drm/amd/pm/swsmu/smu13/yellow_carp_ppt.c
··· 124 124 return -ENOMEM; 125 125 } 126 126 127 + static int yellow_carp_dpm_set_vcn_enable(struct smu_context *smu, bool enable) 128 + { 129 + int ret = 0; 130 + 131 + /* vcn dpm on is a prerequisite for vcn power gate messages */ 132 + if (enable) 133 + ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_PowerUpVcn, 134 + 0, NULL); 135 + else 136 + ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_PowerDownVcn, 137 + 0, NULL); 138 + 139 + return ret; 140 + } 141 + 142 + static int yellow_carp_dpm_set_jpeg_enable(struct smu_context *smu, bool enable) 143 + { 144 + int ret = 0; 145 + 146 + if (enable) 147 + ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_PowerUpJpeg, 148 + 0, NULL); 149 + else 150 + ret = smu_cmn_send_smc_msg_with_param(smu, 151 + SMU_MSG_PowerDownJpeg, 0, 152 + NULL); 153 + 154 + return ret; 155 + } 156 + 157 + 127 158 static bool yellow_carp_is_dpm_running(struct smu_context *smu) 128 159 { 129 160 struct amdgpu_device *adev = smu->adev; ··· 190 159 .fini_smc_tables = smu_v13_0_1_fini_smc_tables, 191 160 .send_smc_msg_with_param = smu_cmn_send_smc_msg_with_param, 192 161 .send_smc_msg = smu_cmn_send_smc_msg, 162 + .dpm_set_vcn_enable = yellow_carp_dpm_set_vcn_enable, 163 + .dpm_set_jpeg_enable = yellow_carp_dpm_set_jpeg_enable, 193 164 .set_default_dpm_table = smu_v13_0_1_set_default_dpm_tables, 194 165 .is_dpm_running = yellow_carp_is_dpm_running, 195 166 .get_enabled_mask = smu_cmn_get_enabled_32_bits_mask,