2 * Copyright 2015 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
24 #include <linux/types.h>
25 #include <linux/kernel.h>
26 #include <linux/gfp.h>
27 #include <linux/slab.h>
28 #include <linux/firmware.h>
29 #include "amd_shared.h"
30 #include "amd_powerplay.h"
31 #include "power_state.h"
36 static const struct amd_pm_funcs pp_dpm_funcs;
38 static int amd_powerplay_create(struct amdgpu_device *adev)
40 struct pp_hwmgr *hwmgr;
45 hwmgr = kzalloc(sizeof(struct pp_hwmgr), GFP_KERNEL);
50 hwmgr->not_vf = !amdgpu_sriov_vf(adev);
51 hwmgr->pm_en = (amdgpu_dpm && hwmgr->not_vf) ? true : false;
52 hwmgr->device = amdgpu_cgs_create_device(adev);
53 mutex_init(&hwmgr->smu_lock);
54 hwmgr->chip_family = adev->family;
55 hwmgr->chip_id = adev->asic_type;
56 hwmgr->feature_mask = adev->pm.pp_feature;
57 hwmgr->display_config = &adev->pm.pm_display_cfg;
58 adev->powerplay.pp_handle = hwmgr;
59 adev->powerplay.pp_funcs = &pp_dpm_funcs;
64 static void amd_powerplay_destroy(struct amdgpu_device *adev)
66 struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle;
68 kfree(hwmgr->hardcode_pp_table);
69 hwmgr->hardcode_pp_table = NULL;
75 static int pp_early_init(void *handle)
78 struct amdgpu_device *adev = handle;
80 ret = amd_powerplay_create(adev);
85 ret = hwmgr_early_init(adev->powerplay.pp_handle);
92 static int pp_sw_init(void *handle)
94 struct amdgpu_device *adev = handle;
95 struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle;
98 ret = hwmgr_sw_init(hwmgr);
100 pr_debug("powerplay sw init %s\n", ret ? "failed" : "successfully");
105 static int pp_sw_fini(void *handle)
107 struct amdgpu_device *adev = handle;
108 struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle;
110 hwmgr_sw_fini(hwmgr);
112 release_firmware(adev->pm.fw);
118 static int pp_hw_init(void *handle)
121 struct amdgpu_device *adev = handle;
122 struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle;
124 ret = hwmgr_hw_init(hwmgr);
127 pr_err("powerplay hw init failed\n");
132 static int pp_hw_fini(void *handle)
134 struct amdgpu_device *adev = handle;
135 struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle;
137 hwmgr_hw_fini(hwmgr);
142 static void pp_reserve_vram_for_smu(struct amdgpu_device *adev)
145 void *cpu_ptr = NULL;
147 struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle;
149 if (amdgpu_bo_create_kernel(adev, adev->pm.smu_prv_buffer_size,
150 PAGE_SIZE, AMDGPU_GEM_DOMAIN_GTT,
151 &adev->pm.smu_prv_buffer,
154 DRM_ERROR("amdgpu: failed to create smu prv buffer\n");
158 if (hwmgr->hwmgr_func->notify_cac_buffer_info)
159 r = hwmgr->hwmgr_func->notify_cac_buffer_info(hwmgr,
160 lower_32_bits((unsigned long)cpu_ptr),
161 upper_32_bits((unsigned long)cpu_ptr),
162 lower_32_bits(gpu_addr),
163 upper_32_bits(gpu_addr),
164 adev->pm.smu_prv_buffer_size);
167 amdgpu_bo_free_kernel(&adev->pm.smu_prv_buffer, NULL, NULL);
168 adev->pm.smu_prv_buffer = NULL;
169 DRM_ERROR("amdgpu: failed to notify SMU buffer address\n");
173 static int pp_late_init(void *handle)
175 struct amdgpu_device *adev = handle;
176 struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle;
178 if (hwmgr && hwmgr->pm_en) {
179 mutex_lock(&hwmgr->smu_lock);
180 hwmgr_handle_task(hwmgr,
181 AMD_PP_TASK_COMPLETE_INIT, NULL);
182 mutex_unlock(&hwmgr->smu_lock);
184 if (adev->pm.smu_prv_buffer_size != 0)
185 pp_reserve_vram_for_smu(adev);
190 static void pp_late_fini(void *handle)
192 struct amdgpu_device *adev = handle;
194 if (adev->pm.smu_prv_buffer)
195 amdgpu_bo_free_kernel(&adev->pm.smu_prv_buffer, NULL, NULL);
196 amd_powerplay_destroy(adev);
200 static bool pp_is_idle(void *handle)
205 static int pp_wait_for_idle(void *handle)
210 static int pp_sw_reset(void *handle)
215 static int pp_set_powergating_state(void *handle,
216 enum amd_powergating_state state)
221 static int pp_suspend(void *handle)
223 struct amdgpu_device *adev = handle;
224 struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle;
226 return hwmgr_suspend(hwmgr);
229 static int pp_resume(void *handle)
231 struct amdgpu_device *adev = handle;
232 struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle;
234 return hwmgr_resume(hwmgr);
237 static int pp_set_clockgating_state(void *handle,
238 enum amd_clockgating_state state)
243 static const struct amd_ip_funcs pp_ip_funcs = {
245 .early_init = pp_early_init,
246 .late_init = pp_late_init,
247 .sw_init = pp_sw_init,
248 .sw_fini = pp_sw_fini,
249 .hw_init = pp_hw_init,
250 .hw_fini = pp_hw_fini,
251 .late_fini = pp_late_fini,
252 .suspend = pp_suspend,
254 .is_idle = pp_is_idle,
255 .wait_for_idle = pp_wait_for_idle,
256 .soft_reset = pp_sw_reset,
257 .set_clockgating_state = pp_set_clockgating_state,
258 .set_powergating_state = pp_set_powergating_state,
261 const struct amdgpu_ip_block_version pp_smu_ip_block =
263 .type = AMD_IP_BLOCK_TYPE_SMC,
267 .funcs = &pp_ip_funcs,
270 /* This interface only be supported On Vi,
271 * because only smu7/8 can help to load gfx/sdma fw,
272 * smu need to be enabled before load other ip's fw.
273 * so call start smu to load smu7 fw and other ip's fw
275 static int pp_dpm_load_fw(void *handle)
277 struct pp_hwmgr *hwmgr = handle;
279 if (!hwmgr || !hwmgr->smumgr_funcs || !hwmgr->smumgr_funcs->start_smu)
282 if (hwmgr->smumgr_funcs->start_smu(hwmgr)) {
283 pr_err("fw load failed\n");
290 static int pp_dpm_fw_loading_complete(void *handle)
295 static int pp_set_clockgating_by_smu(void *handle, uint32_t msg_id)
297 struct pp_hwmgr *hwmgr = handle;
299 if (!hwmgr || !hwmgr->pm_en)
302 if (hwmgr->hwmgr_func->update_clock_gatings == NULL) {
303 pr_info_ratelimited("%s was not implemented.\n", __func__);
307 return hwmgr->hwmgr_func->update_clock_gatings(hwmgr, &msg_id);
310 static void pp_dpm_en_umd_pstate(struct pp_hwmgr *hwmgr,
311 enum amd_dpm_forced_level *level)
313 uint32_t profile_mode_mask = AMD_DPM_FORCED_LEVEL_PROFILE_STANDARD |
314 AMD_DPM_FORCED_LEVEL_PROFILE_MIN_SCLK |
315 AMD_DPM_FORCED_LEVEL_PROFILE_MIN_MCLK |
316 AMD_DPM_FORCED_LEVEL_PROFILE_PEAK;
318 if (!(hwmgr->dpm_level & profile_mode_mask)) {
319 /* enter umd pstate, save current level, disable gfx cg*/
320 if (*level & profile_mode_mask) {
321 hwmgr->saved_dpm_level = hwmgr->dpm_level;
322 hwmgr->en_umd_pstate = true;
323 amdgpu_device_ip_set_clockgating_state(hwmgr->adev,
324 AMD_IP_BLOCK_TYPE_GFX,
325 AMD_CG_STATE_UNGATE);
326 amdgpu_device_ip_set_powergating_state(hwmgr->adev,
327 AMD_IP_BLOCK_TYPE_GFX,
328 AMD_PG_STATE_UNGATE);
331 /* exit umd pstate, restore level, enable gfx cg*/
332 if (!(*level & profile_mode_mask)) {
333 if (*level == AMD_DPM_FORCED_LEVEL_PROFILE_EXIT)
334 *level = hwmgr->saved_dpm_level;
335 hwmgr->en_umd_pstate = false;
336 amdgpu_device_ip_set_clockgating_state(hwmgr->adev,
337 AMD_IP_BLOCK_TYPE_GFX,
339 amdgpu_device_ip_set_powergating_state(hwmgr->adev,
340 AMD_IP_BLOCK_TYPE_GFX,
346 static int pp_dpm_force_performance_level(void *handle,
347 enum amd_dpm_forced_level level)
349 struct pp_hwmgr *hwmgr = handle;
351 if (!hwmgr || !hwmgr->pm_en)
354 if (level == hwmgr->dpm_level)
357 mutex_lock(&hwmgr->smu_lock);
358 pp_dpm_en_umd_pstate(hwmgr, &level);
359 hwmgr->request_dpm_level = level;
360 hwmgr_handle_task(hwmgr, AMD_PP_TASK_READJUST_POWER_STATE, NULL);
361 mutex_unlock(&hwmgr->smu_lock);
366 static enum amd_dpm_forced_level pp_dpm_get_performance_level(
369 struct pp_hwmgr *hwmgr = handle;
370 enum amd_dpm_forced_level level;
372 if (!hwmgr || !hwmgr->pm_en)
375 mutex_lock(&hwmgr->smu_lock);
376 level = hwmgr->dpm_level;
377 mutex_unlock(&hwmgr->smu_lock);
381 static uint32_t pp_dpm_get_sclk(void *handle, bool low)
383 struct pp_hwmgr *hwmgr = handle;
386 if (!hwmgr || !hwmgr->pm_en)
389 if (hwmgr->hwmgr_func->get_sclk == NULL) {
390 pr_info_ratelimited("%s was not implemented.\n", __func__);
393 mutex_lock(&hwmgr->smu_lock);
394 clk = hwmgr->hwmgr_func->get_sclk(hwmgr, low);
395 mutex_unlock(&hwmgr->smu_lock);
399 static uint32_t pp_dpm_get_mclk(void *handle, bool low)
401 struct pp_hwmgr *hwmgr = handle;
404 if (!hwmgr || !hwmgr->pm_en)
407 if (hwmgr->hwmgr_func->get_mclk == NULL) {
408 pr_info_ratelimited("%s was not implemented.\n", __func__);
411 mutex_lock(&hwmgr->smu_lock);
412 clk = hwmgr->hwmgr_func->get_mclk(hwmgr, low);
413 mutex_unlock(&hwmgr->smu_lock);
417 static void pp_dpm_powergate_vce(void *handle, bool gate)
419 struct pp_hwmgr *hwmgr = handle;
421 if (!hwmgr || !hwmgr->pm_en)
424 if (hwmgr->hwmgr_func->powergate_vce == NULL) {
425 pr_info_ratelimited("%s was not implemented.\n", __func__);
428 mutex_lock(&hwmgr->smu_lock);
429 hwmgr->hwmgr_func->powergate_vce(hwmgr, gate);
430 mutex_unlock(&hwmgr->smu_lock);
433 static void pp_dpm_powergate_uvd(void *handle, bool gate)
435 struct pp_hwmgr *hwmgr = handle;
437 if (!hwmgr || !hwmgr->pm_en)
440 if (hwmgr->hwmgr_func->powergate_uvd == NULL) {
441 pr_info_ratelimited("%s was not implemented.\n", __func__);
444 mutex_lock(&hwmgr->smu_lock);
445 hwmgr->hwmgr_func->powergate_uvd(hwmgr, gate);
446 mutex_unlock(&hwmgr->smu_lock);
449 static int pp_dpm_dispatch_tasks(void *handle, enum amd_pp_task task_id,
450 enum amd_pm_state_type *user_state)
453 struct pp_hwmgr *hwmgr = handle;
455 if (!hwmgr || !hwmgr->pm_en)
458 mutex_lock(&hwmgr->smu_lock);
459 ret = hwmgr_handle_task(hwmgr, task_id, user_state);
460 mutex_unlock(&hwmgr->smu_lock);
465 static enum amd_pm_state_type pp_dpm_get_current_power_state(void *handle)
467 struct pp_hwmgr *hwmgr = handle;
468 struct pp_power_state *state;
469 enum amd_pm_state_type pm_type;
471 if (!hwmgr || !hwmgr->pm_en || !hwmgr->current_ps)
474 mutex_lock(&hwmgr->smu_lock);
476 state = hwmgr->current_ps;
478 switch (state->classification.ui_label) {
479 case PP_StateUILabel_Battery:
480 pm_type = POWER_STATE_TYPE_BATTERY;
482 case PP_StateUILabel_Balanced:
483 pm_type = POWER_STATE_TYPE_BALANCED;
485 case PP_StateUILabel_Performance:
486 pm_type = POWER_STATE_TYPE_PERFORMANCE;
489 if (state->classification.flags & PP_StateClassificationFlag_Boot)
490 pm_type = POWER_STATE_TYPE_INTERNAL_BOOT;
492 pm_type = POWER_STATE_TYPE_DEFAULT;
495 mutex_unlock(&hwmgr->smu_lock);
500 static void pp_dpm_set_fan_control_mode(void *handle, uint32_t mode)
502 struct pp_hwmgr *hwmgr = handle;
504 if (!hwmgr || !hwmgr->pm_en)
507 if (hwmgr->hwmgr_func->set_fan_control_mode == NULL) {
508 pr_info_ratelimited("%s was not implemented.\n", __func__);
511 mutex_lock(&hwmgr->smu_lock);
512 hwmgr->hwmgr_func->set_fan_control_mode(hwmgr, mode);
513 mutex_unlock(&hwmgr->smu_lock);
516 static uint32_t pp_dpm_get_fan_control_mode(void *handle)
518 struct pp_hwmgr *hwmgr = handle;
521 if (!hwmgr || !hwmgr->pm_en)
524 if (hwmgr->hwmgr_func->get_fan_control_mode == NULL) {
525 pr_info_ratelimited("%s was not implemented.\n", __func__);
528 mutex_lock(&hwmgr->smu_lock);
529 mode = hwmgr->hwmgr_func->get_fan_control_mode(hwmgr);
530 mutex_unlock(&hwmgr->smu_lock);
534 static int pp_dpm_set_fan_speed_percent(void *handle, uint32_t percent)
536 struct pp_hwmgr *hwmgr = handle;
539 if (!hwmgr || !hwmgr->pm_en)
542 if (hwmgr->hwmgr_func->set_fan_speed_percent == NULL) {
543 pr_info_ratelimited("%s was not implemented.\n", __func__);
546 mutex_lock(&hwmgr->smu_lock);
547 ret = hwmgr->hwmgr_func->set_fan_speed_percent(hwmgr, percent);
548 mutex_unlock(&hwmgr->smu_lock);
552 static int pp_dpm_get_fan_speed_percent(void *handle, uint32_t *speed)
554 struct pp_hwmgr *hwmgr = handle;
557 if (!hwmgr || !hwmgr->pm_en)
560 if (hwmgr->hwmgr_func->get_fan_speed_percent == NULL) {
561 pr_info_ratelimited("%s was not implemented.\n", __func__);
565 mutex_lock(&hwmgr->smu_lock);
566 ret = hwmgr->hwmgr_func->get_fan_speed_percent(hwmgr, speed);
567 mutex_unlock(&hwmgr->smu_lock);
571 static int pp_dpm_get_fan_speed_rpm(void *handle, uint32_t *rpm)
573 struct pp_hwmgr *hwmgr = handle;
576 if (!hwmgr || !hwmgr->pm_en)
579 if (hwmgr->hwmgr_func->get_fan_speed_rpm == NULL)
582 mutex_lock(&hwmgr->smu_lock);
583 ret = hwmgr->hwmgr_func->get_fan_speed_rpm(hwmgr, rpm);
584 mutex_unlock(&hwmgr->smu_lock);
588 static int pp_dpm_set_fan_speed_rpm(void *handle, uint32_t rpm)
590 struct pp_hwmgr *hwmgr = handle;
593 if (!hwmgr || !hwmgr->pm_en)
596 if (hwmgr->hwmgr_func->set_fan_speed_rpm == NULL) {
597 pr_info_ratelimited("%s was not implemented.\n", __func__);
600 mutex_lock(&hwmgr->smu_lock);
601 ret = hwmgr->hwmgr_func->set_fan_speed_rpm(hwmgr, rpm);
602 mutex_unlock(&hwmgr->smu_lock);
606 static int pp_dpm_get_pp_num_states(void *handle,
607 struct pp_states_info *data)
609 struct pp_hwmgr *hwmgr = handle;
612 memset(data, 0, sizeof(*data));
614 if (!hwmgr || !hwmgr->pm_en ||!hwmgr->ps)
617 mutex_lock(&hwmgr->smu_lock);
619 data->nums = hwmgr->num_ps;
621 for (i = 0; i < hwmgr->num_ps; i++) {
622 struct pp_power_state *state = (struct pp_power_state *)
623 ((unsigned long)hwmgr->ps + i * hwmgr->ps_size);
624 switch (state->classification.ui_label) {
625 case PP_StateUILabel_Battery:
626 data->states[i] = POWER_STATE_TYPE_BATTERY;
628 case PP_StateUILabel_Balanced:
629 data->states[i] = POWER_STATE_TYPE_BALANCED;
631 case PP_StateUILabel_Performance:
632 data->states[i] = POWER_STATE_TYPE_PERFORMANCE;
635 if (state->classification.flags & PP_StateClassificationFlag_Boot)
636 data->states[i] = POWER_STATE_TYPE_INTERNAL_BOOT;
638 data->states[i] = POWER_STATE_TYPE_DEFAULT;
641 mutex_unlock(&hwmgr->smu_lock);
645 static int pp_dpm_get_pp_table(void *handle, char **table)
647 struct pp_hwmgr *hwmgr = handle;
650 if (!hwmgr || !hwmgr->pm_en ||!hwmgr->soft_pp_table)
653 mutex_lock(&hwmgr->smu_lock);
654 *table = (char *)hwmgr->soft_pp_table;
655 size = hwmgr->soft_pp_table_size;
656 mutex_unlock(&hwmgr->smu_lock);
660 static int amd_powerplay_reset(void *handle)
662 struct pp_hwmgr *hwmgr = handle;
665 ret = hwmgr_hw_fini(hwmgr);
669 ret = hwmgr_hw_init(hwmgr);
673 return hwmgr_handle_task(hwmgr, AMD_PP_TASK_COMPLETE_INIT, NULL);
676 static int pp_dpm_set_pp_table(void *handle, const char *buf, size_t size)
678 struct pp_hwmgr *hwmgr = handle;
681 if (!hwmgr || !hwmgr->pm_en)
684 mutex_lock(&hwmgr->smu_lock);
685 if (!hwmgr->hardcode_pp_table) {
686 hwmgr->hardcode_pp_table = kmemdup(hwmgr->soft_pp_table,
687 hwmgr->soft_pp_table_size,
689 if (!hwmgr->hardcode_pp_table)
693 memcpy(hwmgr->hardcode_pp_table, buf, size);
695 hwmgr->soft_pp_table = hwmgr->hardcode_pp_table;
697 ret = amd_powerplay_reset(handle);
701 if (hwmgr->hwmgr_func->avfs_control) {
702 ret = hwmgr->hwmgr_func->avfs_control(hwmgr, false);
706 mutex_unlock(&hwmgr->smu_lock);
709 mutex_unlock(&hwmgr->smu_lock);
713 static int pp_dpm_force_clock_level(void *handle,
714 enum pp_clock_type type, uint32_t mask)
716 struct pp_hwmgr *hwmgr = handle;
719 if (!hwmgr || !hwmgr->pm_en)
722 if (hwmgr->hwmgr_func->force_clock_level == NULL) {
723 pr_info_ratelimited("%s was not implemented.\n", __func__);
727 if (hwmgr->dpm_level != AMD_DPM_FORCED_LEVEL_MANUAL) {
728 pr_debug("force clock level is for dpm manual mode only.\n");
732 mutex_lock(&hwmgr->smu_lock);
733 ret = hwmgr->hwmgr_func->force_clock_level(hwmgr, type, mask);
734 mutex_unlock(&hwmgr->smu_lock);
738 static int pp_dpm_print_clock_levels(void *handle,
739 enum pp_clock_type type, char *buf)
741 struct pp_hwmgr *hwmgr = handle;
744 if (!hwmgr || !hwmgr->pm_en)
747 if (hwmgr->hwmgr_func->print_clock_levels == NULL) {
748 pr_info_ratelimited("%s was not implemented.\n", __func__);
751 mutex_lock(&hwmgr->smu_lock);
752 ret = hwmgr->hwmgr_func->print_clock_levels(hwmgr, type, buf);
753 mutex_unlock(&hwmgr->smu_lock);
757 static int pp_dpm_get_sclk_od(void *handle)
759 struct pp_hwmgr *hwmgr = handle;
762 if (!hwmgr || !hwmgr->pm_en)
765 if (hwmgr->hwmgr_func->get_sclk_od == NULL) {
766 pr_info_ratelimited("%s was not implemented.\n", __func__);
769 mutex_lock(&hwmgr->smu_lock);
770 ret = hwmgr->hwmgr_func->get_sclk_od(hwmgr);
771 mutex_unlock(&hwmgr->smu_lock);
775 static int pp_dpm_set_sclk_od(void *handle, uint32_t value)
777 struct pp_hwmgr *hwmgr = handle;
780 if (!hwmgr || !hwmgr->pm_en)
783 if (hwmgr->hwmgr_func->set_sclk_od == NULL) {
784 pr_info_ratelimited("%s was not implemented.\n", __func__);
788 mutex_lock(&hwmgr->smu_lock);
789 ret = hwmgr->hwmgr_func->set_sclk_od(hwmgr, value);
790 mutex_unlock(&hwmgr->smu_lock);
794 static int pp_dpm_get_mclk_od(void *handle)
796 struct pp_hwmgr *hwmgr = handle;
799 if (!hwmgr || !hwmgr->pm_en)
802 if (hwmgr->hwmgr_func->get_mclk_od == NULL) {
803 pr_info_ratelimited("%s was not implemented.\n", __func__);
806 mutex_lock(&hwmgr->smu_lock);
807 ret = hwmgr->hwmgr_func->get_mclk_od(hwmgr);
808 mutex_unlock(&hwmgr->smu_lock);
812 static int pp_dpm_set_mclk_od(void *handle, uint32_t value)
814 struct pp_hwmgr *hwmgr = handle;
817 if (!hwmgr || !hwmgr->pm_en)
820 if (hwmgr->hwmgr_func->set_mclk_od == NULL) {
821 pr_info_ratelimited("%s was not implemented.\n", __func__);
824 mutex_lock(&hwmgr->smu_lock);
825 ret = hwmgr->hwmgr_func->set_mclk_od(hwmgr, value);
826 mutex_unlock(&hwmgr->smu_lock);
830 static int pp_dpm_read_sensor(void *handle, int idx,
831 void *value, int *size)
833 struct pp_hwmgr *hwmgr = handle;
836 if (!hwmgr || !hwmgr->pm_en || !value)
840 case AMDGPU_PP_SENSOR_STABLE_PSTATE_SCLK:
841 *((uint32_t *)value) = hwmgr->pstate_sclk;
843 case AMDGPU_PP_SENSOR_STABLE_PSTATE_MCLK:
844 *((uint32_t *)value) = hwmgr->pstate_mclk;
846 case AMDGPU_PP_SENSOR_MIN_FAN_RPM:
847 *((uint32_t *)value) = hwmgr->thermal_controller.fanInfo.ulMinRPM;
849 case AMDGPU_PP_SENSOR_MAX_FAN_RPM:
850 *((uint32_t *)value) = hwmgr->thermal_controller.fanInfo.ulMaxRPM;
853 mutex_lock(&hwmgr->smu_lock);
854 ret = hwmgr->hwmgr_func->read_sensor(hwmgr, idx, value, size);
855 mutex_unlock(&hwmgr->smu_lock);
860 static struct amd_vce_state*
861 pp_dpm_get_vce_clock_state(void *handle, unsigned idx)
863 struct pp_hwmgr *hwmgr = handle;
865 if (!hwmgr || !hwmgr->pm_en)
868 if (idx < hwmgr->num_vce_state_tables)
869 return &hwmgr->vce_states[idx];
873 static int pp_get_power_profile_mode(void *handle, char *buf)
875 struct pp_hwmgr *hwmgr = handle;
877 if (!hwmgr || !hwmgr->pm_en || !buf)
880 if (hwmgr->hwmgr_func->get_power_profile_mode == NULL) {
881 pr_info_ratelimited("%s was not implemented.\n", __func__);
882 return snprintf(buf, PAGE_SIZE, "\n");
885 return hwmgr->hwmgr_func->get_power_profile_mode(hwmgr, buf);
888 static int pp_set_power_profile_mode(void *handle, long *input, uint32_t size)
890 struct pp_hwmgr *hwmgr = handle;
893 if (!hwmgr || !hwmgr->pm_en)
896 if (hwmgr->hwmgr_func->set_power_profile_mode == NULL) {
897 pr_info_ratelimited("%s was not implemented.\n", __func__);
901 if (hwmgr->dpm_level != AMD_DPM_FORCED_LEVEL_MANUAL) {
902 pr_debug("power profile setting is for manual dpm mode only.\n");
906 mutex_lock(&hwmgr->smu_lock);
907 ret = hwmgr->hwmgr_func->set_power_profile_mode(hwmgr, input, size);
908 mutex_unlock(&hwmgr->smu_lock);
912 static int pp_odn_edit_dpm_table(void *handle, uint32_t type, long *input, uint32_t size)
914 struct pp_hwmgr *hwmgr = handle;
916 if (!hwmgr || !hwmgr->pm_en)
919 if (hwmgr->hwmgr_func->odn_edit_dpm_table == NULL) {
920 pr_info_ratelimited("%s was not implemented.\n", __func__);
924 return hwmgr->hwmgr_func->odn_edit_dpm_table(hwmgr, type, input, size);
927 static int pp_dpm_set_mp1_state(void *handle, enum pp_mp1_state mp1_state)
929 struct pp_hwmgr *hwmgr = handle;
931 if (!hwmgr || !hwmgr->pm_en)
934 if (hwmgr->hwmgr_func->set_mp1_state)
935 return hwmgr->hwmgr_func->set_mp1_state(hwmgr, mp1_state);
940 static int pp_dpm_switch_power_profile(void *handle,
941 enum PP_SMC_POWER_PROFILE type, bool en)
943 struct pp_hwmgr *hwmgr = handle;
947 if (!hwmgr || !hwmgr->pm_en)
950 if (hwmgr->hwmgr_func->set_power_profile_mode == NULL) {
951 pr_info_ratelimited("%s was not implemented.\n", __func__);
955 if (!(type < PP_SMC_POWER_PROFILE_CUSTOM))
958 mutex_lock(&hwmgr->smu_lock);
961 hwmgr->workload_mask &= ~(1 << hwmgr->workload_prority[type]);
962 index = fls(hwmgr->workload_mask);
963 index = index > 0 && index <= Workload_Policy_Max ? index - 1 : 0;
964 workload = hwmgr->workload_setting[index];
966 hwmgr->workload_mask |= (1 << hwmgr->workload_prority[type]);
967 index = fls(hwmgr->workload_mask);
968 index = index <= Workload_Policy_Max ? index - 1 : 0;
969 workload = hwmgr->workload_setting[index];
972 if (type == PP_SMC_POWER_PROFILE_COMPUTE &&
973 hwmgr->hwmgr_func->disable_power_features_for_compute_performance) {
974 if (hwmgr->hwmgr_func->disable_power_features_for_compute_performance(hwmgr, en)) {
975 mutex_unlock(&hwmgr->smu_lock);
980 if (hwmgr->dpm_level != AMD_DPM_FORCED_LEVEL_MANUAL)
981 hwmgr->hwmgr_func->set_power_profile_mode(hwmgr, &workload, 0);
982 mutex_unlock(&hwmgr->smu_lock);
987 static int pp_set_power_limit(void *handle, uint32_t limit)
989 struct pp_hwmgr *hwmgr = handle;
990 uint32_t max_power_limit;
992 if (!hwmgr || !hwmgr->pm_en)
995 if (hwmgr->hwmgr_func->set_power_limit == NULL) {
996 pr_info_ratelimited("%s was not implemented.\n", __func__);
1001 limit = hwmgr->default_power_limit;
1003 max_power_limit = hwmgr->default_power_limit;
1004 if (hwmgr->od_enabled) {
1005 max_power_limit *= (100 + hwmgr->platform_descriptor.TDPODLimit);
1006 max_power_limit /= 100;
1009 if (limit > max_power_limit)
1012 mutex_lock(&hwmgr->smu_lock);
1013 hwmgr->hwmgr_func->set_power_limit(hwmgr, limit);
1014 hwmgr->power_limit = limit;
1015 mutex_unlock(&hwmgr->smu_lock);
1019 static int pp_get_power_limit(void *handle, uint32_t *limit, bool default_limit)
1021 struct pp_hwmgr *hwmgr = handle;
1023 if (!hwmgr || !hwmgr->pm_en ||!limit)
1026 mutex_lock(&hwmgr->smu_lock);
1028 if (default_limit) {
1029 *limit = hwmgr->default_power_limit;
1030 if (hwmgr->od_enabled) {
1031 *limit *= (100 + hwmgr->platform_descriptor.TDPODLimit);
1036 *limit = hwmgr->power_limit;
1038 mutex_unlock(&hwmgr->smu_lock);
1043 static int pp_display_configuration_change(void *handle,
1044 const struct amd_pp_display_configuration *display_config)
1046 struct pp_hwmgr *hwmgr = handle;
1048 if (!hwmgr || !hwmgr->pm_en)
1051 mutex_lock(&hwmgr->smu_lock);
1052 phm_store_dal_configuration_data(hwmgr, display_config);
1053 mutex_unlock(&hwmgr->smu_lock);
1057 static int pp_get_display_power_level(void *handle,
1058 struct amd_pp_simple_clock_info *output)
1060 struct pp_hwmgr *hwmgr = handle;
1063 if (!hwmgr || !hwmgr->pm_en ||!output)
1066 mutex_lock(&hwmgr->smu_lock);
1067 ret = phm_get_dal_power_level(hwmgr, output);
1068 mutex_unlock(&hwmgr->smu_lock);
1072 static int pp_get_current_clocks(void *handle,
1073 struct amd_pp_clock_info *clocks)
1075 struct amd_pp_simple_clock_info simple_clocks = { 0 };
1076 struct pp_clock_info hw_clocks;
1077 struct pp_hwmgr *hwmgr = handle;
1080 if (!hwmgr || !hwmgr->pm_en)
1083 mutex_lock(&hwmgr->smu_lock);
1085 phm_get_dal_power_level(hwmgr, &simple_clocks);
1087 if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps,
1088 PHM_PlatformCaps_PowerContainment))
1089 ret = phm_get_clock_info(hwmgr, &hwmgr->current_ps->hardware,
1090 &hw_clocks, PHM_PerformanceLevelDesignation_PowerContainment);
1092 ret = phm_get_clock_info(hwmgr, &hwmgr->current_ps->hardware,
1093 &hw_clocks, PHM_PerformanceLevelDesignation_Activity);
1096 pr_debug("Error in phm_get_clock_info \n");
1097 mutex_unlock(&hwmgr->smu_lock);
1101 clocks->min_engine_clock = hw_clocks.min_eng_clk;
1102 clocks->max_engine_clock = hw_clocks.max_eng_clk;
1103 clocks->min_memory_clock = hw_clocks.min_mem_clk;
1104 clocks->max_memory_clock = hw_clocks.max_mem_clk;
1105 clocks->min_bus_bandwidth = hw_clocks.min_bus_bandwidth;
1106 clocks->max_bus_bandwidth = hw_clocks.max_bus_bandwidth;
1108 clocks->max_engine_clock_in_sr = hw_clocks.max_eng_clk;
1109 clocks->min_engine_clock_in_sr = hw_clocks.min_eng_clk;
1111 if (simple_clocks.level == 0)
1112 clocks->max_clocks_state = PP_DAL_POWERLEVEL_7;
1114 clocks->max_clocks_state = simple_clocks.level;
1116 if (0 == phm_get_current_shallow_sleep_clocks(hwmgr, &hwmgr->current_ps->hardware, &hw_clocks)) {
1117 clocks->max_engine_clock_in_sr = hw_clocks.max_eng_clk;
1118 clocks->min_engine_clock_in_sr = hw_clocks.min_eng_clk;
1120 mutex_unlock(&hwmgr->smu_lock);
1124 static int pp_get_clock_by_type(void *handle, enum amd_pp_clock_type type, struct amd_pp_clocks *clocks)
1126 struct pp_hwmgr *hwmgr = handle;
1129 if (!hwmgr || !hwmgr->pm_en)
1135 mutex_lock(&hwmgr->smu_lock);
1136 ret = phm_get_clock_by_type(hwmgr, type, clocks);
1137 mutex_unlock(&hwmgr->smu_lock);
1141 static int pp_get_clock_by_type_with_latency(void *handle,
1142 enum amd_pp_clock_type type,
1143 struct pp_clock_levels_with_latency *clocks)
1145 struct pp_hwmgr *hwmgr = handle;
1148 if (!hwmgr || !hwmgr->pm_en ||!clocks)
1151 mutex_lock(&hwmgr->smu_lock);
1152 ret = phm_get_clock_by_type_with_latency(hwmgr, type, clocks);
1153 mutex_unlock(&hwmgr->smu_lock);
1157 static int pp_get_clock_by_type_with_voltage(void *handle,
1158 enum amd_pp_clock_type type,
1159 struct pp_clock_levels_with_voltage *clocks)
1161 struct pp_hwmgr *hwmgr = handle;
1164 if (!hwmgr || !hwmgr->pm_en ||!clocks)
1167 mutex_lock(&hwmgr->smu_lock);
1169 ret = phm_get_clock_by_type_with_voltage(hwmgr, type, clocks);
1171 mutex_unlock(&hwmgr->smu_lock);
1175 static int pp_set_watermarks_for_clocks_ranges(void *handle,
1178 struct pp_hwmgr *hwmgr = handle;
1181 if (!hwmgr || !hwmgr->pm_en || !clock_ranges)
1184 mutex_lock(&hwmgr->smu_lock);
1185 ret = phm_set_watermarks_for_clocks_ranges(hwmgr,
1187 mutex_unlock(&hwmgr->smu_lock);
1192 static int pp_display_clock_voltage_request(void *handle,
1193 struct pp_display_clock_request *clock)
1195 struct pp_hwmgr *hwmgr = handle;
1198 if (!hwmgr || !hwmgr->pm_en ||!clock)
1201 mutex_lock(&hwmgr->smu_lock);
1202 ret = phm_display_clock_voltage_request(hwmgr, clock);
1203 mutex_unlock(&hwmgr->smu_lock);
1208 static int pp_get_display_mode_validation_clocks(void *handle,
1209 struct amd_pp_simple_clock_info *clocks)
1211 struct pp_hwmgr *hwmgr = handle;
1214 if (!hwmgr || !hwmgr->pm_en ||!clocks)
1217 clocks->level = PP_DAL_POWERLEVEL_7;
1219 mutex_lock(&hwmgr->smu_lock);
1221 if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, PHM_PlatformCaps_DynamicPatchPowerState))
1222 ret = phm_get_max_high_clocks(hwmgr, clocks);
1224 mutex_unlock(&hwmgr->smu_lock);
1228 static int pp_dpm_powergate_mmhub(void *handle)
1230 struct pp_hwmgr *hwmgr = handle;
1232 if (!hwmgr || !hwmgr->pm_en)
1235 if (hwmgr->hwmgr_func->powergate_mmhub == NULL) {
1236 pr_info_ratelimited("%s was not implemented.\n", __func__);
1240 return hwmgr->hwmgr_func->powergate_mmhub(hwmgr);
1243 static int pp_dpm_powergate_gfx(void *handle, bool gate)
1245 struct pp_hwmgr *hwmgr = handle;
1247 if (!hwmgr || !hwmgr->pm_en)
1250 if (hwmgr->hwmgr_func->powergate_gfx == NULL) {
1251 pr_info_ratelimited("%s was not implemented.\n", __func__);
1255 return hwmgr->hwmgr_func->powergate_gfx(hwmgr, gate);
1258 static void pp_dpm_powergate_acp(void *handle, bool gate)
1260 struct pp_hwmgr *hwmgr = handle;
1262 if (!hwmgr || !hwmgr->pm_en)
1265 if (hwmgr->hwmgr_func->powergate_acp == NULL) {
1266 pr_info_ratelimited("%s was not implemented.\n", __func__);
1270 hwmgr->hwmgr_func->powergate_acp(hwmgr, gate);
1273 static void pp_dpm_powergate_sdma(void *handle, bool gate)
1275 struct pp_hwmgr *hwmgr = handle;
1280 if (hwmgr->hwmgr_func->powergate_sdma == NULL) {
1281 pr_info_ratelimited("%s was not implemented.\n", __func__);
1285 hwmgr->hwmgr_func->powergate_sdma(hwmgr, gate);
1288 static int pp_set_powergating_by_smu(void *handle,
1289 uint32_t block_type, bool gate)
1293 switch (block_type) {
1294 case AMD_IP_BLOCK_TYPE_UVD:
1295 case AMD_IP_BLOCK_TYPE_VCN:
1296 pp_dpm_powergate_uvd(handle, gate);
1298 case AMD_IP_BLOCK_TYPE_VCE:
1299 pp_dpm_powergate_vce(handle, gate);
1301 case AMD_IP_BLOCK_TYPE_GMC:
1302 pp_dpm_powergate_mmhub(handle);
1304 case AMD_IP_BLOCK_TYPE_GFX:
1305 ret = pp_dpm_powergate_gfx(handle, gate);
1307 case AMD_IP_BLOCK_TYPE_ACP:
1308 pp_dpm_powergate_acp(handle, gate);
1310 case AMD_IP_BLOCK_TYPE_SDMA:
1311 pp_dpm_powergate_sdma(handle, gate);
1319 static int pp_notify_smu_enable_pwe(void *handle)
1321 struct pp_hwmgr *hwmgr = handle;
1323 if (!hwmgr || !hwmgr->pm_en)
1326 if (hwmgr->hwmgr_func->smus_notify_pwe == NULL) {
1327 pr_info_ratelimited("%s was not implemented.\n", __func__);
1331 mutex_lock(&hwmgr->smu_lock);
1332 hwmgr->hwmgr_func->smus_notify_pwe(hwmgr);
1333 mutex_unlock(&hwmgr->smu_lock);
1338 static int pp_enable_mgpu_fan_boost(void *handle)
1340 struct pp_hwmgr *hwmgr = handle;
1345 if (!hwmgr->pm_en ||
1346 hwmgr->hwmgr_func->enable_mgpu_fan_boost == NULL)
1349 mutex_lock(&hwmgr->smu_lock);
1350 hwmgr->hwmgr_func->enable_mgpu_fan_boost(hwmgr);
1351 mutex_unlock(&hwmgr->smu_lock);
1356 static int pp_set_min_deep_sleep_dcefclk(void *handle, uint32_t clock)
1358 struct pp_hwmgr *hwmgr = handle;
1360 if (!hwmgr || !hwmgr->pm_en)
1363 if (hwmgr->hwmgr_func->set_min_deep_sleep_dcefclk == NULL) {
1364 pr_debug("%s was not implemented.\n", __func__);
1368 mutex_lock(&hwmgr->smu_lock);
1369 hwmgr->hwmgr_func->set_min_deep_sleep_dcefclk(hwmgr, clock);
1370 mutex_unlock(&hwmgr->smu_lock);
1375 static int pp_set_hard_min_dcefclk_by_freq(void *handle, uint32_t clock)
1377 struct pp_hwmgr *hwmgr = handle;
1379 if (!hwmgr || !hwmgr->pm_en)
1382 if (hwmgr->hwmgr_func->set_hard_min_dcefclk_by_freq == NULL) {
1383 pr_debug("%s was not implemented.\n", __func__);
1387 mutex_lock(&hwmgr->smu_lock);
1388 hwmgr->hwmgr_func->set_hard_min_dcefclk_by_freq(hwmgr, clock);
1389 mutex_unlock(&hwmgr->smu_lock);
1394 static int pp_set_hard_min_fclk_by_freq(void *handle, uint32_t clock)
1396 struct pp_hwmgr *hwmgr = handle;
1398 if (!hwmgr || !hwmgr->pm_en)
1401 if (hwmgr->hwmgr_func->set_hard_min_fclk_by_freq == NULL) {
1402 pr_debug("%s was not implemented.\n", __func__);
1406 mutex_lock(&hwmgr->smu_lock);
1407 hwmgr->hwmgr_func->set_hard_min_fclk_by_freq(hwmgr, clock);
1408 mutex_unlock(&hwmgr->smu_lock);
1413 static int pp_set_active_display_count(void *handle, uint32_t count)
1415 struct pp_hwmgr *hwmgr = handle;
1418 if (!hwmgr || !hwmgr->pm_en)
1421 mutex_lock(&hwmgr->smu_lock);
1422 ret = phm_set_active_display_count(hwmgr, count);
1423 mutex_unlock(&hwmgr->smu_lock);
1428 static int pp_get_asic_baco_capability(void *handle, bool *cap)
1430 struct pp_hwmgr *hwmgr = handle;
1436 if (!hwmgr->pm_en || !hwmgr->hwmgr_func->get_asic_baco_capability)
1439 mutex_lock(&hwmgr->smu_lock);
1440 hwmgr->hwmgr_func->get_asic_baco_capability(hwmgr, cap);
1441 mutex_unlock(&hwmgr->smu_lock);
1446 static int pp_get_asic_baco_state(void *handle, int *state)
1448 struct pp_hwmgr *hwmgr = handle;
1453 if (!hwmgr->pm_en || !hwmgr->hwmgr_func->get_asic_baco_state)
1456 mutex_lock(&hwmgr->smu_lock);
1457 hwmgr->hwmgr_func->get_asic_baco_state(hwmgr, (enum BACO_STATE *)state);
1458 mutex_unlock(&hwmgr->smu_lock);
1463 static int pp_set_asic_baco_state(void *handle, int state)
1465 struct pp_hwmgr *hwmgr = handle;
1470 if (!hwmgr->pm_en || !hwmgr->hwmgr_func->set_asic_baco_state)
1473 mutex_lock(&hwmgr->smu_lock);
1474 hwmgr->hwmgr_func->set_asic_baco_state(hwmgr, (enum BACO_STATE)state);
1475 mutex_unlock(&hwmgr->smu_lock);
1480 static int pp_get_ppfeature_status(void *handle, char *buf)
1482 struct pp_hwmgr *hwmgr = handle;
1485 if (!hwmgr || !hwmgr->pm_en || !buf)
1488 if (hwmgr->hwmgr_func->get_ppfeature_status == NULL) {
1489 pr_info_ratelimited("%s was not implemented.\n", __func__);
1493 mutex_lock(&hwmgr->smu_lock);
1494 ret = hwmgr->hwmgr_func->get_ppfeature_status(hwmgr, buf);
1495 mutex_unlock(&hwmgr->smu_lock);
1500 static int pp_set_ppfeature_status(void *handle, uint64_t ppfeature_masks)
1502 struct pp_hwmgr *hwmgr = handle;
1505 if (!hwmgr || !hwmgr->pm_en)
1508 if (hwmgr->hwmgr_func->set_ppfeature_status == NULL) {
1509 pr_info_ratelimited("%s was not implemented.\n", __func__);
1513 mutex_lock(&hwmgr->smu_lock);
1514 ret = hwmgr->hwmgr_func->set_ppfeature_status(hwmgr, ppfeature_masks);
1515 mutex_unlock(&hwmgr->smu_lock);
1520 static int pp_asic_reset_mode_2(void *handle)
1522 struct pp_hwmgr *hwmgr = handle;
1525 if (!hwmgr || !hwmgr->pm_en)
1528 if (hwmgr->hwmgr_func->asic_reset == NULL) {
1529 pr_info_ratelimited("%s was not implemented.\n", __func__);
1533 mutex_lock(&hwmgr->smu_lock);
1534 ret = hwmgr->hwmgr_func->asic_reset(hwmgr, SMU_ASIC_RESET_MODE_2);
1535 mutex_unlock(&hwmgr->smu_lock);
1540 static int pp_smu_i2c_bus_access(void *handle, bool acquire)
1542 struct pp_hwmgr *hwmgr = handle;
1545 if (!hwmgr || !hwmgr->pm_en)
1548 if (hwmgr->hwmgr_func->smu_i2c_bus_access == NULL) {
1549 pr_info_ratelimited("%s was not implemented.\n", __func__);
1553 mutex_lock(&hwmgr->smu_lock);
1554 ret = hwmgr->hwmgr_func->smu_i2c_bus_access(hwmgr, acquire);
1555 mutex_unlock(&hwmgr->smu_lock);
1560 static int pp_set_df_cstate(void *handle, enum pp_df_cstate state)
1562 struct pp_hwmgr *hwmgr = handle;
1567 if (!hwmgr->pm_en || !hwmgr->hwmgr_func->set_df_cstate)
1570 mutex_lock(&hwmgr->smu_lock);
1571 hwmgr->hwmgr_func->set_df_cstate(hwmgr, state);
1572 mutex_unlock(&hwmgr->smu_lock);
1577 static int pp_set_xgmi_pstate(void *handle, uint32_t pstate)
1579 struct pp_hwmgr *hwmgr = handle;
1584 if (!hwmgr->pm_en || !hwmgr->hwmgr_func->set_xgmi_pstate)
1587 mutex_lock(&hwmgr->smu_lock);
1588 hwmgr->hwmgr_func->set_xgmi_pstate(hwmgr, pstate);
1589 mutex_unlock(&hwmgr->smu_lock);
1594 static const struct amd_pm_funcs pp_dpm_funcs = {
1595 .load_firmware = pp_dpm_load_fw,
1596 .wait_for_fw_loading_complete = pp_dpm_fw_loading_complete,
1597 .force_performance_level = pp_dpm_force_performance_level,
1598 .get_performance_level = pp_dpm_get_performance_level,
1599 .get_current_power_state = pp_dpm_get_current_power_state,
1600 .dispatch_tasks = pp_dpm_dispatch_tasks,
1601 .set_fan_control_mode = pp_dpm_set_fan_control_mode,
1602 .get_fan_control_mode = pp_dpm_get_fan_control_mode,
1603 .set_fan_speed_percent = pp_dpm_set_fan_speed_percent,
1604 .get_fan_speed_percent = pp_dpm_get_fan_speed_percent,
1605 .get_fan_speed_rpm = pp_dpm_get_fan_speed_rpm,
1606 .set_fan_speed_rpm = pp_dpm_set_fan_speed_rpm,
1607 .get_pp_num_states = pp_dpm_get_pp_num_states,
1608 .get_pp_table = pp_dpm_get_pp_table,
1609 .set_pp_table = pp_dpm_set_pp_table,
1610 .force_clock_level = pp_dpm_force_clock_level,
1611 .print_clock_levels = pp_dpm_print_clock_levels,
1612 .get_sclk_od = pp_dpm_get_sclk_od,
1613 .set_sclk_od = pp_dpm_set_sclk_od,
1614 .get_mclk_od = pp_dpm_get_mclk_od,
1615 .set_mclk_od = pp_dpm_set_mclk_od,
1616 .read_sensor = pp_dpm_read_sensor,
1617 .get_vce_clock_state = pp_dpm_get_vce_clock_state,
1618 .switch_power_profile = pp_dpm_switch_power_profile,
1619 .set_clockgating_by_smu = pp_set_clockgating_by_smu,
1620 .set_powergating_by_smu = pp_set_powergating_by_smu,
1621 .get_power_profile_mode = pp_get_power_profile_mode,
1622 .set_power_profile_mode = pp_set_power_profile_mode,
1623 .odn_edit_dpm_table = pp_odn_edit_dpm_table,
1624 .set_mp1_state = pp_dpm_set_mp1_state,
1625 .set_power_limit = pp_set_power_limit,
1626 .get_power_limit = pp_get_power_limit,
1628 .get_sclk = pp_dpm_get_sclk,
1629 .get_mclk = pp_dpm_get_mclk,
1630 .display_configuration_change = pp_display_configuration_change,
1631 .get_display_power_level = pp_get_display_power_level,
1632 .get_current_clocks = pp_get_current_clocks,
1633 .get_clock_by_type = pp_get_clock_by_type,
1634 .get_clock_by_type_with_latency = pp_get_clock_by_type_with_latency,
1635 .get_clock_by_type_with_voltage = pp_get_clock_by_type_with_voltage,
1636 .set_watermarks_for_clocks_ranges = pp_set_watermarks_for_clocks_ranges,
1637 .display_clock_voltage_request = pp_display_clock_voltage_request,
1638 .get_display_mode_validation_clocks = pp_get_display_mode_validation_clocks,
1639 .notify_smu_enable_pwe = pp_notify_smu_enable_pwe,
1640 .enable_mgpu_fan_boost = pp_enable_mgpu_fan_boost,
1641 .set_active_display_count = pp_set_active_display_count,
1642 .set_min_deep_sleep_dcefclk = pp_set_min_deep_sleep_dcefclk,
1643 .set_hard_min_dcefclk_by_freq = pp_set_hard_min_dcefclk_by_freq,
1644 .set_hard_min_fclk_by_freq = pp_set_hard_min_fclk_by_freq,
1645 .get_asic_baco_capability = pp_get_asic_baco_capability,
1646 .get_asic_baco_state = pp_get_asic_baco_state,
1647 .set_asic_baco_state = pp_set_asic_baco_state,
1648 .get_ppfeature_status = pp_get_ppfeature_status,
1649 .set_ppfeature_status = pp_set_ppfeature_status,
1650 .asic_reset_mode_2 = pp_asic_reset_mode_2,
1651 .smu_i2c_bus_access = pp_smu_i2c_bus_access,
1652 .set_df_cstate = pp_set_df_cstate,
1653 .set_xgmi_pstate = pp_set_xgmi_pstate,