diff options
author | Rex Zhu <Rex.Zhu@amd.com> | 2017-09-06 04:08:03 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-09-18 23:30:34 -0400 |
commit | f93f0c3a7e8635a507b3f084f5f8b48441c79c9d (patch) | |
tree | 72987112716cc21ba7d67d333db211364518cf69 /drivers | |
parent | cfa289fd4986c504b0396cce167802dfcf4943d0 (diff) |
drm/amd/powerplay: use struct amd_pm_funcs in powerplay
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Rex Zhu <Rex.Zhu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers')
14 files changed, 80 insertions, 138 deletions
diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h index 140ff6438390..20457bb5a906 100644 --- a/drivers/gpu/drm/amd/include/amd_shared.h +++ b/drivers/gpu/drm/amd/include/amd_shared.h | |||
@@ -257,6 +257,10 @@ struct amd_ip_funcs { | |||
257 | void (*get_clockgating_state)(void *handle, u32 *flags); | 257 | void (*get_clockgating_state)(void *handle, u32 *flags); |
258 | }; | 258 | }; |
259 | 259 | ||
260 | enum amd_pp_task; | ||
261 | |||
262 | struct pp_states_info; | ||
263 | |||
260 | struct amd_pm_funcs { | 264 | struct amd_pm_funcs { |
261 | int (*get_temperature)(void *handle); | 265 | int (*get_temperature)(void *handle); |
262 | int (*pre_set_power_state)(void *handle); | 266 | int (*pre_set_power_state)(void *handle); |
@@ -298,6 +302,17 @@ struct amd_pm_funcs { | |||
298 | struct amd_pp_profile *request); | 302 | struct amd_pp_profile *request); |
299 | int (*switch_power_profile)(void *handle, | 303 | int (*switch_power_profile)(void *handle, |
300 | enum amd_pp_profile_type type); | 304 | enum amd_pp_profile_type type); |
305 | int (*load_firmware)(void *handle); | ||
306 | int (*wait_for_fw_loading_complete)(void *handle); | ||
307 | enum amd_dpm_forced_level (*get_performance_level)(void *handle); | ||
308 | enum amd_pm_state_type (*get_current_power_state)(void *handle); | ||
309 | int (*dispatch_tasks)(void *handle, enum amd_pp_task task_id, | ||
310 | void *input, void *output); | ||
311 | int (*get_fan_speed_rpm)(void *handle, uint32_t *rpm); | ||
312 | int (*get_pp_num_states)(void *handle, struct pp_states_info *data); | ||
313 | int (*get_pp_table)(void *handle, char **table); | ||
314 | int (*set_pp_table)(void *handle, const char *buf, size_t size); | ||
301 | }; | 315 | }; |
302 | 316 | ||
317 | |||
303 | #endif /* __AMD_SHARED_H__ */ | 318 | #endif /* __AMD_SHARED_H__ */ |
diff --git a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c index 75c810f93e9e..2634d792404a 100644 --- a/drivers/gpu/drm/amd/powerplay/amd_powerplay.c +++ b/drivers/gpu/drm/amd/powerplay/amd_powerplay.c | |||
@@ -376,11 +376,12 @@ static enum amd_dpm_forced_level pp_dpm_get_performance_level( | |||
376 | return level; | 376 | return level; |
377 | } | 377 | } |
378 | 378 | ||
379 | static int pp_dpm_get_sclk(void *handle, bool low) | 379 | static uint32_t pp_dpm_get_sclk(void *handle, bool low) |
380 | { | 380 | { |
381 | struct pp_hwmgr *hwmgr; | 381 | struct pp_hwmgr *hwmgr; |
382 | struct pp_instance *pp_handle = (struct pp_instance *)handle; | 382 | struct pp_instance *pp_handle = (struct pp_instance *)handle; |
383 | int ret = 0; | 383 | int ret = 0; |
384 | uint32_t clk = 0; | ||
384 | 385 | ||
385 | ret = pp_check(pp_handle); | 386 | ret = pp_check(pp_handle); |
386 | 387 | ||
@@ -394,16 +395,17 @@ static int pp_dpm_get_sclk(void *handle, bool low) | |||
394 | return 0; | 395 | return 0; |
395 | } | 396 | } |
396 | mutex_lock(&pp_handle->pp_lock); | 397 | mutex_lock(&pp_handle->pp_lock); |
397 | ret = hwmgr->hwmgr_func->get_sclk(hwmgr, low); | 398 | clk = hwmgr->hwmgr_func->get_sclk(hwmgr, low); |
398 | mutex_unlock(&pp_handle->pp_lock); | 399 | mutex_unlock(&pp_handle->pp_lock); |
399 | return ret; | 400 | return clk; |
400 | } | 401 | } |
401 | 402 | ||
402 | static int pp_dpm_get_mclk(void *handle, bool low) | 403 | static uint32_t pp_dpm_get_mclk(void *handle, bool low) |
403 | { | 404 | { |
404 | struct pp_hwmgr *hwmgr; | 405 | struct pp_hwmgr *hwmgr; |
405 | struct pp_instance *pp_handle = (struct pp_instance *)handle; | 406 | struct pp_instance *pp_handle = (struct pp_instance *)handle; |
406 | int ret = 0; | 407 | int ret = 0; |
408 | uint32_t clk = 0; | ||
407 | 409 | ||
408 | ret = pp_check(pp_handle); | 410 | ret = pp_check(pp_handle); |
409 | 411 | ||
@@ -417,12 +419,12 @@ static int pp_dpm_get_mclk(void *handle, bool low) | |||
417 | return 0; | 419 | return 0; |
418 | } | 420 | } |
419 | mutex_lock(&pp_handle->pp_lock); | 421 | mutex_lock(&pp_handle->pp_lock); |
420 | ret = hwmgr->hwmgr_func->get_mclk(hwmgr, low); | 422 | clk = hwmgr->hwmgr_func->get_mclk(hwmgr, low); |
421 | mutex_unlock(&pp_handle->pp_lock); | 423 | mutex_unlock(&pp_handle->pp_lock); |
422 | return ret; | 424 | return clk; |
423 | } | 425 | } |
424 | 426 | ||
425 | static int pp_dpm_powergate_vce(void *handle, bool gate) | 427 | static void pp_dpm_powergate_vce(void *handle, bool gate) |
426 | { | 428 | { |
427 | struct pp_hwmgr *hwmgr; | 429 | struct pp_hwmgr *hwmgr; |
428 | struct pp_instance *pp_handle = (struct pp_instance *)handle; | 430 | struct pp_instance *pp_handle = (struct pp_instance *)handle; |
@@ -431,21 +433,20 @@ static int pp_dpm_powergate_vce(void *handle, bool gate) | |||
431 | ret = pp_check(pp_handle); | 433 | ret = pp_check(pp_handle); |
432 | 434 | ||
433 | if (ret != 0) | 435 | if (ret != 0) |
434 | return ret; | 436 | return; |
435 | 437 | ||
436 | hwmgr = pp_handle->hwmgr; | 438 | hwmgr = pp_handle->hwmgr; |
437 | 439 | ||
438 | if (hwmgr->hwmgr_func->powergate_vce == NULL) { | 440 | if (hwmgr->hwmgr_func->powergate_vce == NULL) { |
439 | pr_info("%s was not implemented.\n", __func__); | 441 | pr_info("%s was not implemented.\n", __func__); |
440 | return 0; | 442 | return; |
441 | } | 443 | } |
442 | mutex_lock(&pp_handle->pp_lock); | 444 | mutex_lock(&pp_handle->pp_lock); |
443 | ret = hwmgr->hwmgr_func->powergate_vce(hwmgr, gate); | 445 | hwmgr->hwmgr_func->powergate_vce(hwmgr, gate); |
444 | mutex_unlock(&pp_handle->pp_lock); | 446 | mutex_unlock(&pp_handle->pp_lock); |
445 | return ret; | ||
446 | } | 447 | } |
447 | 448 | ||
448 | static int pp_dpm_powergate_uvd(void *handle, bool gate) | 449 | static void pp_dpm_powergate_uvd(void *handle, bool gate) |
449 | { | 450 | { |
450 | struct pp_hwmgr *hwmgr; | 451 | struct pp_hwmgr *hwmgr; |
451 | struct pp_instance *pp_handle = (struct pp_instance *)handle; | 452 | struct pp_instance *pp_handle = (struct pp_instance *)handle; |
@@ -454,18 +455,17 @@ static int pp_dpm_powergate_uvd(void *handle, bool gate) | |||
454 | ret = pp_check(pp_handle); | 455 | ret = pp_check(pp_handle); |
455 | 456 | ||
456 | if (ret != 0) | 457 | if (ret != 0) |
457 | return ret; | 458 | return; |
458 | 459 | ||
459 | hwmgr = pp_handle->hwmgr; | 460 | hwmgr = pp_handle->hwmgr; |
460 | 461 | ||
461 | if (hwmgr->hwmgr_func->powergate_uvd == NULL) { | 462 | if (hwmgr->hwmgr_func->powergate_uvd == NULL) { |
462 | pr_info("%s was not implemented.\n", __func__); | 463 | pr_info("%s was not implemented.\n", __func__); |
463 | return 0; | 464 | return; |
464 | } | 465 | } |
465 | mutex_lock(&pp_handle->pp_lock); | 466 | mutex_lock(&pp_handle->pp_lock); |
466 | ret = hwmgr->hwmgr_func->powergate_uvd(hwmgr, gate); | 467 | hwmgr->hwmgr_func->powergate_uvd(hwmgr, gate); |
467 | mutex_unlock(&pp_handle->pp_lock); | 468 | mutex_unlock(&pp_handle->pp_lock); |
468 | return ret; | ||
469 | } | 469 | } |
470 | 470 | ||
471 | static int pp_dpm_dispatch_tasks(void *handle, enum amd_pp_task task_id, | 471 | static int pp_dpm_dispatch_tasks(void *handle, enum amd_pp_task task_id, |
@@ -530,7 +530,7 @@ static enum amd_pm_state_type pp_dpm_get_current_power_state(void *handle) | |||
530 | return pm_type; | 530 | return pm_type; |
531 | } | 531 | } |
532 | 532 | ||
533 | static int pp_dpm_set_fan_control_mode(void *handle, uint32_t mode) | 533 | static void pp_dpm_set_fan_control_mode(void *handle, uint32_t mode) |
534 | { | 534 | { |
535 | struct pp_hwmgr *hwmgr; | 535 | struct pp_hwmgr *hwmgr; |
536 | struct pp_instance *pp_handle = (struct pp_instance *)handle; | 536 | struct pp_instance *pp_handle = (struct pp_instance *)handle; |
@@ -539,25 +539,25 @@ static int pp_dpm_set_fan_control_mode(void *handle, uint32_t mode) | |||
539 | ret = pp_check(pp_handle); | 539 | ret = pp_check(pp_handle); |
540 | 540 | ||
541 | if (ret != 0) | 541 | if (ret != 0) |
542 | return ret; | 542 | return; |
543 | 543 | ||
544 | hwmgr = pp_handle->hwmgr; | 544 | hwmgr = pp_handle->hwmgr; |
545 | 545 | ||
546 | if (hwmgr->hwmgr_func->set_fan_control_mode == NULL) { | 546 | if (hwmgr->hwmgr_func->set_fan_control_mode == NULL) { |
547 | pr_info("%s was not implemented.\n", __func__); | 547 | pr_info("%s was not implemented.\n", __func__); |
548 | return 0; | 548 | return; |
549 | } | 549 | } |
550 | mutex_lock(&pp_handle->pp_lock); | 550 | mutex_lock(&pp_handle->pp_lock); |
551 | ret = hwmgr->hwmgr_func->set_fan_control_mode(hwmgr, mode); | 551 | hwmgr->hwmgr_func->set_fan_control_mode(hwmgr, mode); |
552 | mutex_unlock(&pp_handle->pp_lock); | 552 | mutex_unlock(&pp_handle->pp_lock); |
553 | return ret; | ||
554 | } | 553 | } |
555 | 554 | ||
556 | static int pp_dpm_get_fan_control_mode(void *handle) | 555 | static uint32_t pp_dpm_get_fan_control_mode(void *handle) |
557 | { | 556 | { |
558 | struct pp_hwmgr *hwmgr; | 557 | struct pp_hwmgr *hwmgr; |
559 | struct pp_instance *pp_handle = (struct pp_instance *)handle; | 558 | struct pp_instance *pp_handle = (struct pp_instance *)handle; |
560 | int ret = 0; | 559 | int ret = 0; |
560 | uint32_t mode = 0; | ||
561 | 561 | ||
562 | ret = pp_check(pp_handle); | 562 | ret = pp_check(pp_handle); |
563 | 563 | ||
@@ -571,9 +571,9 @@ static int pp_dpm_get_fan_control_mode(void *handle) | |||
571 | return 0; | 571 | return 0; |
572 | } | 572 | } |
573 | mutex_lock(&pp_handle->pp_lock); | 573 | mutex_lock(&pp_handle->pp_lock); |
574 | ret = hwmgr->hwmgr_func->get_fan_control_mode(hwmgr); | 574 | mode = hwmgr->hwmgr_func->get_fan_control_mode(hwmgr); |
575 | mutex_unlock(&pp_handle->pp_lock); | 575 | mutex_unlock(&pp_handle->pp_lock); |
576 | return ret; | 576 | return mode; |
577 | } | 577 | } |
578 | 578 | ||
579 | static int pp_dpm_set_fan_speed_percent(void *handle, uint32_t percent) | 579 | static int pp_dpm_set_fan_speed_percent(void *handle, uint32_t percent) |
@@ -1096,7 +1096,7 @@ static int pp_dpm_switch_power_profile(void *handle, | |||
1096 | return 0; | 1096 | return 0; |
1097 | } | 1097 | } |
1098 | 1098 | ||
1099 | const struct amd_powerplay_funcs pp_dpm_funcs = { | 1099 | const struct amd_pm_funcs pp_dpm_funcs = { |
1100 | .get_temperature = pp_dpm_get_temperature, | 1100 | .get_temperature = pp_dpm_get_temperature, |
1101 | .load_firmware = pp_dpm_load_fw, | 1101 | .load_firmware = pp_dpm_load_fw, |
1102 | .wait_for_fw_loading_complete = pp_dpm_fw_loading_complete, | 1102 | .wait_for_fw_loading_complete = pp_dpm_fw_loading_complete, |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c index 5baf1a48294a..576b61eb6b8f 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.c | |||
@@ -147,7 +147,7 @@ int cz_enable_disable_vce_dpm(struct pp_hwmgr *hwmgr, bool enable) | |||
147 | } | 147 | } |
148 | 148 | ||
149 | 149 | ||
150 | int cz_dpm_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate) | 150 | void cz_dpm_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate) |
151 | { | 151 | { |
152 | struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend); | 152 | struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend); |
153 | 153 | ||
@@ -173,10 +173,9 @@ int cz_dpm_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate) | |||
173 | cz_dpm_update_uvd_dpm(hwmgr, false); | 173 | cz_dpm_update_uvd_dpm(hwmgr, false); |
174 | } | 174 | } |
175 | 175 | ||
176 | return 0; | ||
177 | } | 176 | } |
178 | 177 | ||
179 | int cz_dpm_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate) | 178 | void cz_dpm_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate) |
180 | { | 179 | { |
181 | struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend); | 180 | struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend); |
182 | 181 | ||
@@ -205,9 +204,6 @@ int cz_dpm_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate) | |||
205 | AMD_CG_STATE_UNGATE); | 204 | AMD_CG_STATE_UNGATE); |
206 | cz_dpm_update_vce_dpm(hwmgr); | 205 | cz_dpm_update_vce_dpm(hwmgr); |
207 | cz_enable_disable_vce_dpm(hwmgr, true); | 206 | cz_enable_disable_vce_dpm(hwmgr, true); |
208 | return 0; | ||
209 | } | 207 | } |
210 | |||
211 | return 0; | ||
212 | } | 208 | } |
213 | 209 | ||
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.h b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.h index 1954ceaed439..92f707bc46e7 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.h +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_clockpowergating.h | |||
@@ -29,8 +29,8 @@ | |||
29 | 29 | ||
30 | extern int cz_phm_set_asic_block_gating(struct pp_hwmgr *hwmgr, enum PHM_AsicBlock block, enum PHM_ClockGateSetting gating); | 30 | extern int cz_phm_set_asic_block_gating(struct pp_hwmgr *hwmgr, enum PHM_AsicBlock block, enum PHM_ClockGateSetting gating); |
31 | extern const struct phm_master_table_header cz_phm_enable_clock_power_gatings_master; | 31 | extern const struct phm_master_table_header cz_phm_enable_clock_power_gatings_master; |
32 | extern int cz_dpm_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate); | 32 | extern void cz_dpm_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate); |
33 | extern int cz_dpm_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate); | 33 | extern void cz_dpm_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate); |
34 | extern int cz_enable_disable_vce_dpm(struct pp_hwmgr *hwmgr, bool enable); | 34 | extern int cz_enable_disable_vce_dpm(struct pp_hwmgr *hwmgr, bool enable); |
35 | extern int cz_enable_disable_uvd_dpm(struct pp_hwmgr *hwmgr, bool enable); | 35 | extern int cz_enable_disable_uvd_dpm(struct pp_hwmgr *hwmgr, bool enable); |
36 | #endif /* _CZ_CLOCK_POWER_GATING_H_ */ | 36 | #endif /* _CZ_CLOCK_POWER_GATING_H_ */ |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c index d3b46462072d..045fdb3da056 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | |||
@@ -1393,14 +1393,14 @@ int cz_dpm_powerup_vce(struct pp_hwmgr *hwmgr) | |||
1393 | return 0; | 1393 | return 0; |
1394 | } | 1394 | } |
1395 | 1395 | ||
1396 | static int cz_dpm_get_mclk(struct pp_hwmgr *hwmgr, bool low) | 1396 | static uint32_t cz_dpm_get_mclk(struct pp_hwmgr *hwmgr, bool low) |
1397 | { | 1397 | { |
1398 | struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend); | 1398 | struct cz_hwmgr *cz_hwmgr = (struct cz_hwmgr *)(hwmgr->backend); |
1399 | 1399 | ||
1400 | return cz_hwmgr->sys_info.bootup_uma_clock; | 1400 | return cz_hwmgr->sys_info.bootup_uma_clock; |
1401 | } | 1401 | } |
1402 | 1402 | ||
1403 | static int cz_dpm_get_sclk(struct pp_hwmgr *hwmgr, bool low) | 1403 | static uint32_t cz_dpm_get_sclk(struct pp_hwmgr *hwmgr, bool low) |
1404 | { | 1404 | { |
1405 | struct pp_power_state *ps; | 1405 | struct pp_power_state *ps; |
1406 | struct cz_power_state *cz_ps; | 1406 | struct cz_power_state *cz_ps; |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c b/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c index fa4fbc25ebe1..7462f9562b89 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/hardwaremanager.c | |||
@@ -155,24 +155,6 @@ int phm_powerdown_uvd(struct pp_hwmgr *hwmgr) | |||
155 | return 0; | 155 | return 0; |
156 | } | 156 | } |
157 | 157 | ||
158 | int phm_powergate_uvd(struct pp_hwmgr *hwmgr, bool gate) | ||
159 | { | ||
160 | PHM_FUNC_CHECK(hwmgr); | ||
161 | |||
162 | if (hwmgr->hwmgr_func->powergate_uvd != NULL) | ||
163 | return hwmgr->hwmgr_func->powergate_uvd(hwmgr, gate); | ||
164 | return 0; | ||
165 | } | ||
166 | |||
167 | int phm_powergate_vce(struct pp_hwmgr *hwmgr, bool gate) | ||
168 | { | ||
169 | PHM_FUNC_CHECK(hwmgr); | ||
170 | |||
171 | if (hwmgr->hwmgr_func->powergate_vce != NULL) | ||
172 | return hwmgr->hwmgr_func->powergate_vce(hwmgr, gate); | ||
173 | return 0; | ||
174 | } | ||
175 | |||
176 | int phm_enable_clock_power_gatings(struct pp_hwmgr *hwmgr) | 158 | int phm_enable_clock_power_gatings(struct pp_hwmgr *hwmgr) |
177 | { | 159 | { |
178 | PHM_FUNC_CHECK(hwmgr); | 160 | PHM_FUNC_CHECK(hwmgr); |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c index 594b978f46d9..603035a5a4db 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/rv_hwmgr.c | |||
@@ -501,12 +501,12 @@ static int rv_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, | |||
501 | return 0; | 501 | return 0; |
502 | } | 502 | } |
503 | 503 | ||
504 | static int rv_dpm_get_mclk(struct pp_hwmgr *hwmgr, bool low) | 504 | static uint32_t rv_dpm_get_mclk(struct pp_hwmgr *hwmgr, bool low) |
505 | { | 505 | { |
506 | return 0; | 506 | return 0; |
507 | } | 507 | } |
508 | 508 | ||
509 | static int rv_dpm_get_sclk(struct pp_hwmgr *hwmgr, bool low) | 509 | static uint32_t rv_dpm_get_sclk(struct pp_hwmgr *hwmgr, bool low) |
510 | { | 510 | { |
511 | return 0; | 511 | return 0; |
512 | } | 512 | } |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c index 261b828ad590..48f60dedac2b 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.c | |||
@@ -140,7 +140,7 @@ int smu7_disable_clock_power_gating(struct pp_hwmgr *hwmgr) | |||
140 | return 0; | 140 | return 0; |
141 | } | 141 | } |
142 | 142 | ||
143 | int smu7_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate) | 143 | void smu7_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate) |
144 | { | 144 | { |
145 | struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); | 145 | struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); |
146 | 146 | ||
@@ -166,10 +166,9 @@ int smu7_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate) | |||
166 | smu7_update_uvd_dpm(hwmgr, false); | 166 | smu7_update_uvd_dpm(hwmgr, false); |
167 | } | 167 | } |
168 | 168 | ||
169 | return 0; | ||
170 | } | 169 | } |
171 | 170 | ||
172 | int smu7_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate) | 171 | void smu7_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate) |
173 | { | 172 | { |
174 | struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); | 173 | struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); |
175 | 174 | ||
@@ -194,7 +193,6 @@ int smu7_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate) | |||
194 | AMD_PG_STATE_UNGATE); | 193 | AMD_PG_STATE_UNGATE); |
195 | smu7_update_vce_dpm(hwmgr, false); | 194 | smu7_update_vce_dpm(hwmgr, false); |
196 | } | 195 | } |
197 | return 0; | ||
198 | } | 196 | } |
199 | 197 | ||
200 | int smu7_powergate_samu(struct pp_hwmgr *hwmgr, bool bgate) | 198 | int smu7_powergate_samu(struct pp_hwmgr *hwmgr, bool bgate) |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.h b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.h index c96ed9ed7eaf..7b54d48b2ce2 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.h +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_clockpowergating.h | |||
@@ -27,8 +27,8 @@ | |||
27 | #include "smu7_hwmgr.h" | 27 | #include "smu7_hwmgr.h" |
28 | #include "pp_asicblocks.h" | 28 | #include "pp_asicblocks.h" |
29 | 29 | ||
30 | int smu7_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate); | 30 | void smu7_powergate_vce(struct pp_hwmgr *hwmgr, bool bgate); |
31 | int smu7_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate); | 31 | void smu7_powergate_uvd(struct pp_hwmgr *hwmgr, bool bgate); |
32 | int smu7_powerdown_uvd(struct pp_hwmgr *hwmgr); | 32 | int smu7_powerdown_uvd(struct pp_hwmgr *hwmgr); |
33 | int smu7_powergate_samu(struct pp_hwmgr *hwmgr, bool bgate); | 33 | int smu7_powergate_samu(struct pp_hwmgr *hwmgr, bool bgate); |
34 | int smu7_powergate_acp(struct pp_hwmgr *hwmgr, bool bgate); | 34 | int smu7_powergate_acp(struct pp_hwmgr *hwmgr, bool bgate); |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c index 8b8e202b45b4..f1f1e4b390ca 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | |||
@@ -2798,7 +2798,7 @@ static int smu7_apply_state_adjust_rules(struct pp_hwmgr *hwmgr, | |||
2798 | } | 2798 | } |
2799 | 2799 | ||
2800 | 2800 | ||
2801 | static int smu7_dpm_get_mclk(struct pp_hwmgr *hwmgr, bool low) | 2801 | static uint32_t smu7_dpm_get_mclk(struct pp_hwmgr *hwmgr, bool low) |
2802 | { | 2802 | { |
2803 | struct pp_power_state *ps; | 2803 | struct pp_power_state *ps; |
2804 | struct smu7_power_state *smu7_ps; | 2804 | struct smu7_power_state *smu7_ps; |
@@ -2820,7 +2820,7 @@ static int smu7_dpm_get_mclk(struct pp_hwmgr *hwmgr, bool low) | |||
2820 | [smu7_ps->performance_level_count-1].memory_clock; | 2820 | [smu7_ps->performance_level_count-1].memory_clock; |
2821 | } | 2821 | } |
2822 | 2822 | ||
2823 | static int smu7_dpm_get_sclk(struct pp_hwmgr *hwmgr, bool low) | 2823 | static uint32_t smu7_dpm_get_sclk(struct pp_hwmgr *hwmgr, bool low) |
2824 | { | 2824 | { |
2825 | struct pp_power_state *ps; | 2825 | struct pp_power_state *ps; |
2826 | struct smu7_power_state *smu7_ps; | 2826 | struct smu7_power_state *smu7_ps; |
@@ -4302,31 +4302,27 @@ static int smu7_print_clock_levels(struct pp_hwmgr *hwmgr, | |||
4302 | return size; | 4302 | return size; |
4303 | } | 4303 | } |
4304 | 4304 | ||
4305 | static int smu7_set_fan_control_mode(struct pp_hwmgr *hwmgr, uint32_t mode) | 4305 | static void smu7_set_fan_control_mode(struct pp_hwmgr *hwmgr, uint32_t mode) |
4306 | { | 4306 | { |
4307 | int result = 0; | ||
4308 | |||
4309 | switch (mode) { | 4307 | switch (mode) { |
4310 | case AMD_FAN_CTRL_NONE: | 4308 | case AMD_FAN_CTRL_NONE: |
4311 | result = smu7_fan_ctrl_set_fan_speed_percent(hwmgr, 100); | 4309 | smu7_fan_ctrl_set_fan_speed_percent(hwmgr, 100); |
4312 | break; | 4310 | break; |
4313 | case AMD_FAN_CTRL_MANUAL: | 4311 | case AMD_FAN_CTRL_MANUAL: |
4314 | if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, | 4312 | if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, |
4315 | PHM_PlatformCaps_MicrocodeFanControl)) | 4313 | PHM_PlatformCaps_MicrocodeFanControl)) |
4316 | result = smu7_fan_ctrl_stop_smc_fan_control(hwmgr); | 4314 | smu7_fan_ctrl_stop_smc_fan_control(hwmgr); |
4317 | break; | 4315 | break; |
4318 | case AMD_FAN_CTRL_AUTO: | 4316 | case AMD_FAN_CTRL_AUTO: |
4319 | result = smu7_fan_ctrl_set_static_mode(hwmgr, mode); | 4317 | if (!smu7_fan_ctrl_set_static_mode(hwmgr, mode)) |
4320 | if (!result) | 4318 | smu7_fan_ctrl_start_smc_fan_control(hwmgr); |
4321 | result = smu7_fan_ctrl_start_smc_fan_control(hwmgr); | ||
4322 | break; | 4319 | break; |
4323 | default: | 4320 | default: |
4324 | break; | 4321 | break; |
4325 | } | 4322 | } |
4326 | return result; | ||
4327 | } | 4323 | } |
4328 | 4324 | ||
4329 | static int smu7_get_fan_control_mode(struct pp_hwmgr *hwmgr) | 4325 | static uint32_t smu7_get_fan_control_mode(struct pp_hwmgr *hwmgr) |
4330 | { | 4326 | { |
4331 | return hwmgr->fan_ctrl_enabled ? AMD_FAN_CTRL_AUTO : AMD_FAN_CTRL_MANUAL; | 4327 | return hwmgr->fan_ctrl_enabled ? AMD_FAN_CTRL_AUTO : AMD_FAN_CTRL_MANUAL; |
4332 | } | 4328 | } |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c index ad34178b4ae3..bd20d551e719 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c | |||
@@ -3872,7 +3872,7 @@ static int vega10_set_power_state_tasks(struct pp_hwmgr *hwmgr, | |||
3872 | return 0; | 3872 | return 0; |
3873 | } | 3873 | } |
3874 | 3874 | ||
3875 | static int vega10_dpm_get_sclk(struct pp_hwmgr *hwmgr, bool low) | 3875 | static uint32_t vega10_dpm_get_sclk(struct pp_hwmgr *hwmgr, bool low) |
3876 | { | 3876 | { |
3877 | struct pp_power_state *ps; | 3877 | struct pp_power_state *ps; |
3878 | struct vega10_power_state *vega10_ps; | 3878 | struct vega10_power_state *vega10_ps; |
@@ -3894,7 +3894,7 @@ static int vega10_dpm_get_sclk(struct pp_hwmgr *hwmgr, bool low) | |||
3894 | [vega10_ps->performance_level_count - 1].gfx_clock; | 3894 | [vega10_ps->performance_level_count - 1].gfx_clock; |
3895 | } | 3895 | } |
3896 | 3896 | ||
3897 | static int vega10_dpm_get_mclk(struct pp_hwmgr *hwmgr, bool low) | 3897 | static uint32_t vega10_dpm_get_mclk(struct pp_hwmgr *hwmgr, bool low) |
3898 | { | 3898 | { |
3899 | struct pp_power_state *ps; | 3899 | struct pp_power_state *ps; |
3900 | struct vega10_power_state *vega10_ps; | 3900 | struct vega10_power_state *vega10_ps; |
@@ -4216,27 +4216,23 @@ static int vega10_get_profiling_clk_mask(struct pp_hwmgr *hwmgr, enum amd_dpm_fo | |||
4216 | return 0; | 4216 | return 0; |
4217 | } | 4217 | } |
4218 | 4218 | ||
4219 | static int vega10_set_fan_control_mode(struct pp_hwmgr *hwmgr, uint32_t mode) | 4219 | static void vega10_set_fan_control_mode(struct pp_hwmgr *hwmgr, uint32_t mode) |
4220 | { | 4220 | { |
4221 | int result = 0; | ||
4222 | |||
4223 | switch (mode) { | 4221 | switch (mode) { |
4224 | case AMD_FAN_CTRL_NONE: | 4222 | case AMD_FAN_CTRL_NONE: |
4225 | result = vega10_fan_ctrl_set_fan_speed_percent(hwmgr, 100); | 4223 | vega10_fan_ctrl_set_fan_speed_percent(hwmgr, 100); |
4226 | break; | 4224 | break; |
4227 | case AMD_FAN_CTRL_MANUAL: | 4225 | case AMD_FAN_CTRL_MANUAL: |
4228 | if (PP_CAP(PHM_PlatformCaps_MicrocodeFanControl)) | 4226 | if (PP_CAP(PHM_PlatformCaps_MicrocodeFanControl)) |
4229 | result = vega10_fan_ctrl_stop_smc_fan_control(hwmgr); | 4227 | vega10_fan_ctrl_stop_smc_fan_control(hwmgr); |
4230 | break; | 4228 | break; |
4231 | case AMD_FAN_CTRL_AUTO: | 4229 | case AMD_FAN_CTRL_AUTO: |
4232 | result = vega10_fan_ctrl_set_static_mode(hwmgr, mode); | 4230 | if (!vega10_fan_ctrl_set_static_mode(hwmgr, mode)) |
4233 | if (!result) | 4231 | vega10_fan_ctrl_start_smc_fan_control(hwmgr); |
4234 | result = vega10_fan_ctrl_start_smc_fan_control(hwmgr); | ||
4235 | break; | 4232 | break; |
4236 | default: | 4233 | default: |
4237 | break; | 4234 | break; |
4238 | } | 4235 | } |
4239 | return result; | ||
4240 | } | 4236 | } |
4241 | 4237 | ||
4242 | static int vega10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, | 4238 | static int vega10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, |
@@ -4282,7 +4278,7 @@ static int vega10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, | |||
4282 | return ret; | 4278 | return ret; |
4283 | } | 4279 | } |
4284 | 4280 | ||
4285 | static int vega10_get_fan_control_mode(struct pp_hwmgr *hwmgr) | 4281 | static uint32_t vega10_get_fan_control_mode(struct pp_hwmgr *hwmgr) |
4286 | { | 4282 | { |
4287 | struct vega10_hwmgr *data = (struct vega10_hwmgr *)(hwmgr->backend); | 4283 | struct vega10_hwmgr *data = (struct vega10_hwmgr *)(hwmgr->backend); |
4288 | 4284 | ||
@@ -4697,20 +4693,20 @@ int vega10_enable_disable_uvd_dpm(struct pp_hwmgr *hwmgr, bool enable) | |||
4697 | return 0; | 4693 | return 0; |
4698 | } | 4694 | } |
4699 | 4695 | ||
4700 | static int vega10_power_gate_vce(struct pp_hwmgr *hwmgr, bool bgate) | 4696 | static void vega10_power_gate_vce(struct pp_hwmgr *hwmgr, bool bgate) |
4701 | { | 4697 | { |
4702 | struct vega10_hwmgr *data = (struct vega10_hwmgr *)(hwmgr->backend); | 4698 | struct vega10_hwmgr *data = (struct vega10_hwmgr *)(hwmgr->backend); |
4703 | 4699 | ||
4704 | data->vce_power_gated = bgate; | 4700 | data->vce_power_gated = bgate; |
4705 | return vega10_enable_disable_vce_dpm(hwmgr, !bgate); | 4701 | vega10_enable_disable_vce_dpm(hwmgr, !bgate); |
4706 | } | 4702 | } |
4707 | 4703 | ||
4708 | static int vega10_power_gate_uvd(struct pp_hwmgr *hwmgr, bool bgate) | 4704 | static void vega10_power_gate_uvd(struct pp_hwmgr *hwmgr, bool bgate) |
4709 | { | 4705 | { |
4710 | struct vega10_hwmgr *data = (struct vega10_hwmgr *)(hwmgr->backend); | 4706 | struct vega10_hwmgr *data = (struct vega10_hwmgr *)(hwmgr->backend); |
4711 | 4707 | ||
4712 | data->uvd_power_gated = bgate; | 4708 | data->uvd_power_gated = bgate; |
4713 | return vega10_enable_disable_uvd_dpm(hwmgr, !bgate); | 4709 | vega10_enable_disable_uvd_dpm(hwmgr, !bgate); |
4714 | } | 4710 | } |
4715 | 4711 | ||
4716 | static inline bool vega10_are_power_levels_equal( | 4712 | static inline bool vega10_are_power_levels_equal( |
diff --git a/drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h b/drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h index 832340b8d1af..435da2647727 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h +++ b/drivers/gpu/drm/amd/powerplay/inc/amd_powerplay.h | |||
@@ -31,7 +31,7 @@ | |||
31 | #include "dm_pp_interface.h" | 31 | #include "dm_pp_interface.h" |
32 | 32 | ||
33 | extern const struct amd_ip_funcs pp_ip_funcs; | 33 | extern const struct amd_ip_funcs pp_ip_funcs; |
34 | extern const struct amd_powerplay_funcs pp_dpm_funcs; | 34 | extern const struct amd_pm_funcs pp_dpm_funcs; |
35 | 35 | ||
36 | #define PP_DPM_DISABLED 0xCCCC | 36 | #define PP_DPM_DISABLED 0xCCCC |
37 | 37 | ||
@@ -267,49 +267,10 @@ struct pp_display_clock_request { | |||
267 | support << PP_STATE_SUPPORT_SHIFT |\ | 267 | support << PP_STATE_SUPPORT_SHIFT |\ |
268 | state << PP_STATE_SHIFT) | 268 | state << PP_STATE_SHIFT) |
269 | 269 | ||
270 | struct amd_powerplay_funcs { | ||
271 | int (*get_temperature)(void *handle); | ||
272 | int (*load_firmware)(void *handle); | ||
273 | int (*wait_for_fw_loading_complete)(void *handle); | ||
274 | int (*force_performance_level)(void *handle, enum amd_dpm_forced_level level); | ||
275 | enum amd_dpm_forced_level (*get_performance_level)(void *handle); | ||
276 | enum amd_pm_state_type (*get_current_power_state)(void *handle); | ||
277 | int (*get_sclk)(void *handle, bool low); | ||
278 | int (*get_mclk)(void *handle, bool low); | ||
279 | int (*powergate_vce)(void *handle, bool gate); | ||
280 | int (*powergate_uvd)(void *handle, bool gate); | ||
281 | int (*dispatch_tasks)(void *handle, enum amd_pp_task task_id, | ||
282 | void *input, void *output); | ||
283 | int (*set_fan_control_mode)(void *handle, uint32_t mode); | ||
284 | int (*get_fan_control_mode)(void *handle); | ||
285 | int (*set_fan_speed_percent)(void *handle, uint32_t percent); | ||
286 | int (*get_fan_speed_percent)(void *handle, uint32_t *speed); | ||
287 | int (*get_fan_speed_rpm)(void *handle, uint32_t *rpm); | ||
288 | int (*get_pp_num_states)(void *handle, struct pp_states_info *data); | ||
289 | int (*get_pp_table)(void *handle, char **table); | ||
290 | int (*set_pp_table)(void *handle, const char *buf, size_t size); | ||
291 | int (*force_clock_level)(void *handle, enum pp_clock_type type, uint32_t mask); | ||
292 | int (*print_clock_levels)(void *handle, enum pp_clock_type type, char *buf); | ||
293 | int (*get_sclk_od)(void *handle); | ||
294 | int (*set_sclk_od)(void *handle, uint32_t value); | ||
295 | int (*get_mclk_od)(void *handle); | ||
296 | int (*set_mclk_od)(void *handle, uint32_t value); | ||
297 | int (*read_sensor)(void *handle, int idx, void *value, int *size); | ||
298 | struct amd_vce_state* (*get_vce_clock_state)(void *handle, unsigned idx); | ||
299 | int (*reset_power_profile_state)(void *handle, | ||
300 | struct amd_pp_profile *request); | ||
301 | int (*get_power_profile_state)(void *handle, | ||
302 | struct amd_pp_profile *query); | ||
303 | int (*set_power_profile_state)(void *handle, | ||
304 | struct amd_pp_profile *request); | ||
305 | int (*switch_power_profile)(void *handle, | ||
306 | enum amd_pp_profile_type type); | ||
307 | }; | ||
308 | |||
309 | struct amd_powerplay { | 270 | struct amd_powerplay { |
310 | void *pp_handle; | 271 | void *pp_handle; |
311 | const struct amd_ip_funcs *ip_funcs; | 272 | const struct amd_ip_funcs *ip_funcs; |
312 | const struct amd_powerplay_funcs *pp_funcs; | 273 | const struct amd_pm_funcs *pp_funcs; |
313 | }; | 274 | }; |
314 | 275 | ||
315 | int amd_powerplay_create(struct amd_pp_init *pp_init, | 276 | int amd_powerplay_create(struct amd_pp_init *pp_init, |
diff --git a/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h b/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h index 03adece4efea..629990f505dd 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h +++ b/drivers/gpu/drm/amd/powerplay/inc/hardwaremanager.h | |||
@@ -375,8 +375,6 @@ struct phm_odn_clock_levels { | |||
375 | 375 | ||
376 | extern int phm_disable_clock_power_gatings(struct pp_hwmgr *hwmgr); | 376 | extern int phm_disable_clock_power_gatings(struct pp_hwmgr *hwmgr); |
377 | extern int phm_enable_clock_power_gatings(struct pp_hwmgr *hwmgr); | 377 | extern int phm_enable_clock_power_gatings(struct pp_hwmgr *hwmgr); |
378 | extern int phm_powergate_uvd(struct pp_hwmgr *hwmgr, bool gate); | ||
379 | extern int phm_powergate_vce(struct pp_hwmgr *hwmgr, bool gate); | ||
380 | extern int phm_powerdown_uvd(struct pp_hwmgr *hwmgr); | 378 | extern int phm_powerdown_uvd(struct pp_hwmgr *hwmgr); |
381 | extern int phm_setup_asic(struct pp_hwmgr *hwmgr); | 379 | extern int phm_setup_asic(struct pp_hwmgr *hwmgr); |
382 | extern int phm_enable_dynamic_state_management(struct pp_hwmgr *hwmgr); | 380 | extern int phm_enable_dynamic_state_management(struct pp_hwmgr *hwmgr); |
diff --git a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h index 2a10d8174126..f4b6f0ebda75 100644 --- a/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h +++ b/drivers/gpu/drm/amd/powerplay/inc/hwmgr.h | |||
@@ -270,10 +270,10 @@ struct pp_hwmgr_func { | |||
270 | unsigned long, struct pp_power_state *); | 270 | unsigned long, struct pp_power_state *); |
271 | int (*get_num_of_pp_table_entries)(struct pp_hwmgr *hwmgr); | 271 | int (*get_num_of_pp_table_entries)(struct pp_hwmgr *hwmgr); |
272 | int (*powerdown_uvd)(struct pp_hwmgr *hwmgr); | 272 | int (*powerdown_uvd)(struct pp_hwmgr *hwmgr); |
273 | int (*powergate_vce)(struct pp_hwmgr *hwmgr, bool bgate); | 273 | void (*powergate_vce)(struct pp_hwmgr *hwmgr, bool bgate); |
274 | int (*powergate_uvd)(struct pp_hwmgr *hwmgr, bool bgate); | 274 | void (*powergate_uvd)(struct pp_hwmgr *hwmgr, bool bgate); |
275 | int (*get_mclk)(struct pp_hwmgr *hwmgr, bool low); | 275 | uint32_t (*get_mclk)(struct pp_hwmgr *hwmgr, bool low); |
276 | int (*get_sclk)(struct pp_hwmgr *hwmgr, bool low); | 276 | uint32_t (*get_sclk)(struct pp_hwmgr *hwmgr, bool low); |
277 | int (*power_state_set)(struct pp_hwmgr *hwmgr, | 277 | int (*power_state_set)(struct pp_hwmgr *hwmgr, |
278 | const void *state); | 278 | const void *state); |
279 | int (*enable_clock_power_gating)(struct pp_hwmgr *hwmgr); | 279 | int (*enable_clock_power_gating)(struct pp_hwmgr *hwmgr); |
@@ -287,8 +287,8 @@ struct pp_hwmgr_func { | |||
287 | int (*get_temperature)(struct pp_hwmgr *hwmgr); | 287 | int (*get_temperature)(struct pp_hwmgr *hwmgr); |
288 | int (*stop_thermal_controller)(struct pp_hwmgr *hwmgr); | 288 | int (*stop_thermal_controller)(struct pp_hwmgr *hwmgr); |
289 | int (*get_fan_speed_info)(struct pp_hwmgr *hwmgr, struct phm_fan_speed_info *fan_speed_info); | 289 | int (*get_fan_speed_info)(struct pp_hwmgr *hwmgr, struct phm_fan_speed_info *fan_speed_info); |
290 | int (*set_fan_control_mode)(struct pp_hwmgr *hwmgr, uint32_t mode); | 290 | void (*set_fan_control_mode)(struct pp_hwmgr *hwmgr, uint32_t mode); |
291 | int (*get_fan_control_mode)(struct pp_hwmgr *hwmgr); | 291 | uint32_t (*get_fan_control_mode)(struct pp_hwmgr *hwmgr); |
292 | int (*set_fan_speed_percent)(struct pp_hwmgr *hwmgr, uint32_t percent); | 292 | int (*set_fan_speed_percent)(struct pp_hwmgr *hwmgr, uint32_t percent); |
293 | int (*get_fan_speed_percent)(struct pp_hwmgr *hwmgr, uint32_t *speed); | 293 | int (*get_fan_speed_percent)(struct pp_hwmgr *hwmgr, uint32_t *speed); |
294 | int (*set_fan_speed_rpm)(struct pp_hwmgr *hwmgr, uint32_t percent); | 294 | int (*set_fan_speed_rpm)(struct pp_hwmgr *hwmgr, uint32_t percent); |