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.
25 #include "eventsubchains.h"
26 #include "eventtasks.h"
27 #include "hardwaremanager.h"
29 const pem_event_action reset_display_phy_access_tasks
[] = {
30 pem_task_reset_display_phys_access
,
34 const pem_event_action broadcast_power_policy_tasks
[] = {
35 /* PEM_Task_BroadcastPowerPolicyChange, */
39 const pem_event_action unregister_interrupt_tasks
[] = {
40 pem_task_unregister_interrupts
,
44 /* Disable GFX Voltage Islands Power Gating */
45 const pem_event_action disable_gfx_voltage_island_powergating_tasks
[] = {
46 pem_task_disable_voltage_island_power_gating
,
50 const pem_event_action disable_gfx_clockgating_tasks
[] = {
51 pem_task_disable_gfx_clock_gating
,
55 const pem_event_action block_adjust_power_state_tasks
[] = {
56 pem_task_block_adjust_power_state
,
61 const pem_event_action unblock_adjust_power_state_tasks
[] = {
62 pem_task_unblock_adjust_power_state
,
66 const pem_event_action set_performance_state_tasks
[] = {
67 pem_task_set_performance_state
,
71 const pem_event_action get_2d_performance_state_tasks
[] = {
72 pem_task_get_2D_performance_state_id
,
76 const pem_event_action conditionally_force3D_performance_state_tasks
[] = {
77 pem_task_conditionally_force_3d_performance_state
,
81 const pem_event_action process_vbios_eventinfo_tasks
[] = {
82 /* PEM_Task_ProcessVbiosEventInfo,*/
86 const pem_event_action enable_dynamic_state_management_tasks
[] = {
87 /* PEM_Task_ResetBAPMPolicyChangedFlag,*/
88 pem_task_get_boot_state_id
,
89 pem_task_enable_dynamic_state_management
,
90 pem_task_register_interrupts
,
94 const pem_event_action enable_clock_power_gatings_tasks
[] = {
95 pem_task_enable_clock_power_gatings_tasks
,
96 pem_task_powerdown_uvd_tasks
,
97 pem_task_powerdown_vce_tasks
,
101 const pem_event_action setup_asic_tasks
[] = {
106 const pem_event_action power_budget_tasks
[] = {
108 * PEM_Task_PowerBudgetWaiverAvailable,
109 * PEM_Task_PowerBudgetWarningMessage,
110 * PEM_Task_PruneStatesBasedOnPowerBudget,
115 const pem_event_action system_config_tasks
[] = {
116 /* PEM_Task_PruneStatesBasedOnSystemConfig,*/
121 const pem_event_action conditionally_force_3d_performance_state_tasks
[] = {
122 pem_task_conditionally_force_3d_performance_state
,
126 const pem_event_action ungate_all_display_phys_tasks
[] = {
127 /* PEM_Task_GetDisplayPhyAccessInfo */
131 const pem_event_action uninitialize_display_phy_access_tasks
[] = {
132 /* PEM_Task_UninitializeDisplayPhysAccess, */
136 const pem_event_action disable_gfx_voltage_island_power_gating_tasks
[] = {
137 /* PEM_Task_DisableVoltageIslandPowerGating, */
141 const pem_event_action disable_gfx_clock_gating_tasks
[] = {
142 pem_task_disable_gfx_clock_gating
,
146 const pem_event_action set_boot_state_tasks
[] = {
147 pem_task_get_boot_state_id
,
148 pem_task_set_boot_state
,
152 const pem_event_action adjust_power_state_tasks
[] = {
153 pem_task_notify_hw_mgr_display_configuration_change
,
154 pem_task_adjust_power_state
,
155 pem_task_notify_smc_display_config_after_power_state_adjustment
,
156 pem_task_update_allowed_performance_levels
,
157 /* to do pem_task_Enable_disable_bapm, */
161 const pem_event_action disable_dynamic_state_management_tasks
[] = {
162 pem_task_unregister_interrupts
,
163 pem_task_get_boot_state_id
,
164 pem_task_disable_dynamic_state_management
,
168 const pem_event_action disable_clock_power_gatings_tasks
[] = {
169 pem_task_disable_clock_power_gatings_tasks
,
173 const pem_event_action cleanup_asic_tasks
[] = {
174 /* PEM_Task_DisableFPS,*/
175 pem_task_cleanup_asic
,
179 const pem_event_action prepare_for_pnp_stop_tasks
[] = {
180 /* PEM_Task_PrepareForPnpStop,*/
184 const pem_event_action set_power_source_tasks
[] = {
185 pem_task_set_power_source
,
186 pem_task_notify_hw_of_power_source
,
190 const pem_event_action set_power_saving_state_tasks
[] = {
191 pem_task_reset_power_saving_state
,
192 pem_task_get_power_saving_state
,
193 pem_task_set_power_saving_state
,
194 /* PEM_Task_ResetODDCState,
195 * PEM_Task_GetODDCState,
196 * PEM_Task_SetODDCState,*/
200 const pem_event_action enable_disable_fps_tasks
[] = {
201 /* PEM_Task_EnableDisableFPS,*/
205 const pem_event_action set_nbmcu_state_tasks
[] = {
206 /* PEM_Task_NBMCUStateChange,*/
210 const pem_event_action reset_hardware_dc_notification_tasks
[] = {
211 /* PEM_Task_ResetHardwareDCNotification,*/
216 const pem_event_action notify_smu_suspend_tasks
[] = {
217 /* PEM_Task_NotifySMUSuspend,*/
221 const pem_event_action disable_smc_firmware_ctf_tasks
[] = {
222 /* PEM_Task_DisableSMCFirmwareCTF,*/
226 const pem_event_action disable_fps_tasks
[] = {
227 /* PEM_Task_DisableFPS,*/
231 const pem_event_action vari_bright_suspend_tasks
[] = {
232 /* PEM_Task_VariBright_Suspend,*/
236 const pem_event_action reset_fan_speed_to_default_tasks
[] = {
237 /* PEM_Task_ResetFanSpeedToDefault,*/
241 const pem_event_action power_down_asic_tasks
[] = {
242 /* PEM_Task_DisableFPS,*/
243 pem_task_power_down_asic
,
247 const pem_event_action disable_stutter_mode_tasks
[] = {
248 /* PEM_Task_DisableStutterMode,*/
252 const pem_event_action set_connected_standby_tasks
[] = {
253 /* PEM_Task_SetConnectedStandby,*/
257 const pem_event_action block_hw_access_tasks
[] = {
258 pem_task_block_hw_access
,
262 const pem_event_action unblock_hw_access_tasks
[] = {
263 pem_task_un_block_hw_access
,
267 const pem_event_action resume_connected_standby_tasks
[] = {
268 /* PEM_Task_ResumeConnectedStandby,*/
272 const pem_event_action notify_smu_resume_tasks
[] = {
273 /* PEM_Task_NotifySMUResume,*/
277 const pem_event_action reset_display_configCounter_tasks
[] = {
278 pem_task_reset_display_phys_access
,
282 const pem_event_action update_dal_configuration_tasks
[] = {
283 /* PEM_Task_CheckVBlankTime,*/
287 const pem_event_action vari_bright_resume_tasks
[] = {
288 /* PEM_Task_VariBright_Resume,*/
292 const pem_event_action notify_hw_power_source_tasks
[] = {
293 pem_task_notify_hw_of_power_source
,
297 const pem_event_action process_vbios_event_info_tasks
[] = {
298 /* PEM_Task_ProcessVbiosEventInfo,*/
302 const pem_event_action enable_gfx_clock_gating_tasks
[] = {
303 pem_task_enable_gfx_clock_gating
,
307 const pem_event_action enable_gfx_voltage_island_power_gating_tasks
[] = {
308 pem_task_enable_voltage_island_power_gating
,
312 const pem_event_action reset_clock_gating_tasks
[] = {
313 /* PEM_Task_ResetClockGating*/
317 const pem_event_action notify_smu_vpu_recovery_end_tasks
[] = {
318 /* PEM_Task_NotifySmuVPURecoveryEnd,*/
322 const pem_event_action disable_vpu_cap_tasks
[] = {
323 /* PEM_Task_DisableVPUCap,*/
327 const pem_event_action execute_escape_sequence_tasks
[] = {
328 /* PEM_Task_ExecuteEscapesequence,*/
332 const pem_event_action notify_power_state_change_tasks
[] = {
333 pem_task_notify_power_state_change
,
337 const pem_event_action enable_cgpg_tasks
[] = {
338 pem_task_enable_cgpg
,
342 const pem_event_action disable_cgpg_tasks
[] = {
343 pem_task_disable_cgpg
,
347 const pem_event_action enable_user_2d_performance_tasks
[] = {
348 /* PEM_Task_SetUser2DPerformanceFlag,*/
349 /* PEM_Task_UpdateUser2DPerformanceEnableEvents,*/
353 const pem_event_action add_user_2d_performance_state_tasks
[] = {
354 /* PEM_Task_Get2DPerformanceTemplate,*/
355 /* PEM_Task_AllocateNewPowerStateMemory,*/
356 /* PEM_Task_CopyNewPowerStateInfo,*/
357 /* PEM_Task_UpdateNewPowerStateClocks,*/
358 /* PEM_Task_UpdateNewPowerStateUser2DPerformanceFlag,*/
359 /* PEM_Task_AddPowerState,*/
360 /* PEM_Task_ReleaseNewPowerStateMemory,*/
364 const pem_event_action delete_user_2d_performance_state_tasks
[] = {
365 /* PEM_Task_GetCurrentUser2DPerformanceStateID,*/
366 /* PEM_Task_DeletePowerState,*/
367 /* PEM_Task_SetCurrentUser2DPerformanceStateID,*/
371 const pem_event_action disable_user_2d_performance_tasks
[] = {
372 /* PEM_Task_ResetUser2DPerformanceFlag,*/
373 /* PEM_Task_UpdateUser2DPerformanceDisableEvents,*/
377 const pem_event_action enable_stutter_mode_tasks
[] = {
378 pem_task_enable_stutter_mode
,
382 const pem_event_action enable_disable_bapm_tasks
[] = {
383 /*PEM_Task_EnableDisableBAPM,*/
387 const pem_event_action reset_boot_state_tasks
[] = {
388 pem_task_reset_boot_state
,
392 const pem_event_action create_new_user_performance_state_tasks
[] = {
393 pem_task_create_user_performance_state
,
397 const pem_event_action initialize_thermal_controller_tasks
[] = {
398 pem_task_initialize_thermal_controller
,
402 const pem_event_action uninitialize_thermal_controller_tasks
[] = {
403 pem_task_uninitialize_thermal_controller
,
407 const pem_event_action set_cpu_power_state
[] = {
408 pem_task_set_cpu_power_state
,