diff options
author | Rex Zhu <Rex.Zhu@amd.com> | 2017-09-01 01:48:11 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-09-12 14:22:14 -0400 |
commit | 47047263c52779f1f3393c32e3e53661b53a372e (patch) | |
tree | 331b968b47b868c6e0d41cd33aa6c69ae7efdcba /drivers/gpu | |
parent | df1e63942063a0638a5813e5904988d834db2665 (diff) |
drm/amd/powerplay: delete eventmgr related files.
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/gpu')
16 files changed, 0 insertions, 2405 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/eventmgr/Makefile b/drivers/gpu/drm/amd/powerplay/eventmgr/Makefile deleted file mode 100644 index 7509e3850087..000000000000 --- a/drivers/gpu/drm/amd/powerplay/eventmgr/Makefile +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | # | ||
2 | # Makefile for the 'event manager' sub-component of powerplay. | ||
3 | # It provides the event management services for the driver. | ||
4 | |||
5 | EVENT_MGR = eventmgr.o eventinit.o eventmanagement.o \ | ||
6 | eventactionchains.o eventsubchains.o eventtasks.o psm.o | ||
7 | |||
8 | AMD_PP_EVENT = $(addprefix $(AMD_PP_PATH)/eventmgr/,$(EVENT_MGR)) | ||
9 | |||
10 | AMD_POWERPLAY_FILES += $(AMD_PP_EVENT) | ||
11 | |||
diff --git a/drivers/gpu/drm/amd/powerplay/eventmgr/eventactionchains.c b/drivers/gpu/drm/amd/powerplay/eventmgr/eventactionchains.c deleted file mode 100644 index 8cee4e0f9fde..000000000000 --- a/drivers/gpu/drm/amd/powerplay/eventmgr/eventactionchains.c +++ /dev/null | |||
@@ -1,291 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2015 Advanced Micro Devices, Inc. | ||
3 | * | ||
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: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
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. | ||
21 | * | ||
22 | */ | ||
23 | #include "eventmgr.h" | ||
24 | #include "eventactionchains.h" | ||
25 | #include "eventsubchains.h" | ||
26 | |||
27 | static const pem_event_action * const initialize_event[] = { | ||
28 | block_adjust_power_state_tasks, | ||
29 | power_budget_tasks, | ||
30 | system_config_tasks, | ||
31 | setup_asic_tasks, | ||
32 | enable_dynamic_state_management_tasks, | ||
33 | get_2d_performance_state_tasks, | ||
34 | set_performance_state_tasks, | ||
35 | initialize_thermal_controller_tasks, | ||
36 | conditionally_force_3d_performance_state_tasks, | ||
37 | process_vbios_eventinfo_tasks, | ||
38 | broadcast_power_policy_tasks, | ||
39 | NULL | ||
40 | }; | ||
41 | |||
42 | const struct action_chain initialize_action_chain = { | ||
43 | "Initialize", | ||
44 | initialize_event | ||
45 | }; | ||
46 | |||
47 | static const pem_event_action * const uninitialize_event[] = { | ||
48 | ungate_all_display_phys_tasks, | ||
49 | uninitialize_display_phy_access_tasks, | ||
50 | disable_gfx_voltage_island_power_gating_tasks, | ||
51 | disable_gfx_clock_gating_tasks, | ||
52 | uninitialize_thermal_controller_tasks, | ||
53 | set_boot_state_tasks, | ||
54 | adjust_power_state_tasks, | ||
55 | disable_dynamic_state_management_tasks, | ||
56 | disable_clock_power_gatings_tasks, | ||
57 | cleanup_asic_tasks, | ||
58 | prepare_for_pnp_stop_tasks, | ||
59 | NULL | ||
60 | }; | ||
61 | |||
62 | const struct action_chain uninitialize_action_chain = { | ||
63 | "Uninitialize", | ||
64 | uninitialize_event | ||
65 | }; | ||
66 | |||
67 | static const pem_event_action * const power_source_change_event_pp_enabled[] = { | ||
68 | set_power_source_tasks, | ||
69 | set_power_saving_state_tasks, | ||
70 | adjust_power_state_tasks, | ||
71 | enable_disable_fps_tasks, | ||
72 | set_nbmcu_state_tasks, | ||
73 | broadcast_power_policy_tasks, | ||
74 | NULL | ||
75 | }; | ||
76 | |||
77 | const struct action_chain power_source_change_action_chain_pp_enabled = { | ||
78 | "Power source change - PowerPlay enabled", | ||
79 | power_source_change_event_pp_enabled | ||
80 | }; | ||
81 | |||
82 | static const pem_event_action * const power_source_change_event_pp_disabled[] = { | ||
83 | set_power_source_tasks, | ||
84 | set_nbmcu_state_tasks, | ||
85 | NULL | ||
86 | }; | ||
87 | |||
88 | const struct action_chain power_source_changes_action_chain_pp_disabled = { | ||
89 | "Power source change - PowerPlay disabled", | ||
90 | power_source_change_event_pp_disabled | ||
91 | }; | ||
92 | |||
93 | static const pem_event_action * const power_source_change_event_hardware_dc[] = { | ||
94 | set_power_source_tasks, | ||
95 | set_power_saving_state_tasks, | ||
96 | adjust_power_state_tasks, | ||
97 | enable_disable_fps_tasks, | ||
98 | reset_hardware_dc_notification_tasks, | ||
99 | set_nbmcu_state_tasks, | ||
100 | broadcast_power_policy_tasks, | ||
101 | NULL | ||
102 | }; | ||
103 | |||
104 | const struct action_chain power_source_change_action_chain_hardware_dc = { | ||
105 | "Power source change - with Hardware DC switching", | ||
106 | power_source_change_event_hardware_dc | ||
107 | }; | ||
108 | |||
109 | static const pem_event_action * const suspend_event[] = { | ||
110 | reset_display_phy_access_tasks, | ||
111 | unregister_interrupt_tasks, | ||
112 | disable_gfx_voltage_island_power_gating_tasks, | ||
113 | disable_gfx_clock_gating_tasks, | ||
114 | notify_smu_suspend_tasks, | ||
115 | disable_smc_firmware_ctf_tasks, | ||
116 | set_boot_state_tasks, | ||
117 | adjust_power_state_tasks, | ||
118 | disable_fps_tasks, | ||
119 | vari_bright_suspend_tasks, | ||
120 | reset_fan_speed_to_default_tasks, | ||
121 | power_down_asic_tasks, | ||
122 | disable_stutter_mode_tasks, | ||
123 | set_connected_standby_tasks, | ||
124 | block_hw_access_tasks, | ||
125 | NULL | ||
126 | }; | ||
127 | |||
128 | const struct action_chain suspend_action_chain = { | ||
129 | "Suspend", | ||
130 | suspend_event | ||
131 | }; | ||
132 | |||
133 | static const pem_event_action * const resume_event[] = { | ||
134 | unblock_hw_access_tasks, | ||
135 | resume_connected_standby_tasks, | ||
136 | notify_smu_resume_tasks, | ||
137 | reset_display_configCounter_tasks, | ||
138 | update_dal_configuration_tasks, | ||
139 | vari_bright_resume_tasks, | ||
140 | setup_asic_tasks, | ||
141 | enable_stutter_mode_tasks, /*must do this in boot state and before SMC is started */ | ||
142 | enable_dynamic_state_management_tasks, | ||
143 | enable_disable_bapm_tasks, | ||
144 | initialize_thermal_controller_tasks, | ||
145 | get_2d_performance_state_tasks, | ||
146 | set_performance_state_tasks, | ||
147 | adjust_power_state_tasks, | ||
148 | enable_disable_fps_tasks, | ||
149 | notify_hw_power_source_tasks, | ||
150 | process_vbios_event_info_tasks, | ||
151 | enable_gfx_clock_gating_tasks, | ||
152 | enable_gfx_voltage_island_power_gating_tasks, | ||
153 | reset_clock_gating_tasks, | ||
154 | notify_smu_vpu_recovery_end_tasks, | ||
155 | disable_vpu_cap_tasks, | ||
156 | execute_escape_sequence_tasks, | ||
157 | NULL | ||
158 | }; | ||
159 | |||
160 | |||
161 | const struct action_chain resume_action_chain = { | ||
162 | "resume", | ||
163 | resume_event | ||
164 | }; | ||
165 | |||
166 | static const pem_event_action * const complete_init_event[] = { | ||
167 | unblock_adjust_power_state_tasks, | ||
168 | adjust_power_state_tasks, | ||
169 | enable_gfx_clock_gating_tasks, | ||
170 | enable_gfx_voltage_island_power_gating_tasks, | ||
171 | notify_power_state_change_tasks, | ||
172 | NULL | ||
173 | }; | ||
174 | |||
175 | const struct action_chain complete_init_action_chain = { | ||
176 | "complete init", | ||
177 | complete_init_event | ||
178 | }; | ||
179 | |||
180 | static const pem_event_action * const enable_gfx_clock_gating_event[] = { | ||
181 | enable_gfx_clock_gating_tasks, | ||
182 | NULL | ||
183 | }; | ||
184 | |||
185 | const struct action_chain enable_gfx_clock_gating_action_chain = { | ||
186 | "enable gfx clock gate", | ||
187 | enable_gfx_clock_gating_event | ||
188 | }; | ||
189 | |||
190 | static const pem_event_action * const disable_gfx_clock_gating_event[] = { | ||
191 | disable_gfx_clock_gating_tasks, | ||
192 | NULL | ||
193 | }; | ||
194 | |||
195 | const struct action_chain disable_gfx_clock_gating_action_chain = { | ||
196 | "disable gfx clock gate", | ||
197 | disable_gfx_clock_gating_event | ||
198 | }; | ||
199 | |||
200 | static const pem_event_action * const enable_cgpg_event[] = { | ||
201 | enable_cgpg_tasks, | ||
202 | NULL | ||
203 | }; | ||
204 | |||
205 | const struct action_chain enable_cgpg_action_chain = { | ||
206 | "eable cg pg", | ||
207 | enable_cgpg_event | ||
208 | }; | ||
209 | |||
210 | static const pem_event_action * const disable_cgpg_event[] = { | ||
211 | disable_cgpg_tasks, | ||
212 | NULL | ||
213 | }; | ||
214 | |||
215 | const struct action_chain disable_cgpg_action_chain = { | ||
216 | "disable cg pg", | ||
217 | disable_cgpg_event | ||
218 | }; | ||
219 | |||
220 | |||
221 | /* Enable user _2d performance and activate */ | ||
222 | |||
223 | static const pem_event_action * const enable_user_state_event[] = { | ||
224 | create_new_user_performance_state_tasks, | ||
225 | adjust_power_state_tasks, | ||
226 | NULL | ||
227 | }; | ||
228 | |||
229 | const struct action_chain enable_user_state_action_chain = { | ||
230 | "Enable user state", | ||
231 | enable_user_state_event | ||
232 | }; | ||
233 | |||
234 | static const pem_event_action * const enable_user_2d_performance_event[] = { | ||
235 | enable_user_2d_performance_tasks, | ||
236 | add_user_2d_performance_state_tasks, | ||
237 | set_performance_state_tasks, | ||
238 | adjust_power_state_tasks, | ||
239 | delete_user_2d_performance_state_tasks, | ||
240 | NULL | ||
241 | }; | ||
242 | |||
243 | const struct action_chain enable_user_2d_performance_action_chain = { | ||
244 | "enable_user_2d_performance_event_activate", | ||
245 | enable_user_2d_performance_event | ||
246 | }; | ||
247 | |||
248 | |||
249 | static const pem_event_action * const disable_user_2d_performance_event[] = { | ||
250 | disable_user_2d_performance_tasks, | ||
251 | delete_user_2d_performance_state_tasks, | ||
252 | NULL | ||
253 | }; | ||
254 | |||
255 | const struct action_chain disable_user_2d_performance_action_chain = { | ||
256 | "disable_user_2d_performance_event", | ||
257 | disable_user_2d_performance_event | ||
258 | }; | ||
259 | |||
260 | |||
261 | static const pem_event_action * const display_config_change_event[] = { | ||
262 | /* countDisplayConfigurationChangeEventTasks, */ | ||
263 | unblock_adjust_power_state_tasks, | ||
264 | set_cpu_power_state, | ||
265 | notify_hw_power_source_tasks, | ||
266 | get_2d_performance_state_tasks, | ||
267 | set_performance_state_tasks, | ||
268 | /* updateDALConfigurationTasks, | ||
269 | variBrightDisplayConfigurationChangeTasks, */ | ||
270 | adjust_power_state_tasks, | ||
271 | /*enableDisableFPSTasks, | ||
272 | setNBMCUStateTasks, | ||
273 | notifyPCIEDeviceReadyTasks,*/ | ||
274 | NULL | ||
275 | }; | ||
276 | |||
277 | const struct action_chain display_config_change_action_chain = { | ||
278 | "Display configuration change", | ||
279 | display_config_change_event | ||
280 | }; | ||
281 | |||
282 | static const pem_event_action * const readjust_power_state_event[] = { | ||
283 | adjust_power_state_tasks, | ||
284 | NULL | ||
285 | }; | ||
286 | |||
287 | const struct action_chain readjust_power_state_action_chain = { | ||
288 | "re-adjust power state", | ||
289 | readjust_power_state_event | ||
290 | }; | ||
291 | |||
diff --git a/drivers/gpu/drm/amd/powerplay/eventmgr/eventactionchains.h b/drivers/gpu/drm/amd/powerplay/eventmgr/eventactionchains.h deleted file mode 100644 index f181e53cdcda..000000000000 --- a/drivers/gpu/drm/amd/powerplay/eventmgr/eventactionchains.h +++ /dev/null | |||
@@ -1,62 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2015 Advanced Micro Devices, Inc. | ||
3 | * | ||
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: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
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. | ||
21 | * | ||
22 | */ | ||
23 | #ifndef _EVENT_ACTION_CHAINS_H_ | ||
24 | #define _EVENT_ACTION_CHAINS_H_ | ||
25 | #include "eventmgr.h" | ||
26 | |||
27 | extern const struct action_chain initialize_action_chain; | ||
28 | |||
29 | extern const struct action_chain uninitialize_action_chain; | ||
30 | |||
31 | extern const struct action_chain power_source_change_action_chain_pp_enabled; | ||
32 | |||
33 | extern const struct action_chain power_source_changes_action_chain_pp_disabled; | ||
34 | |||
35 | extern const struct action_chain power_source_change_action_chain_hardware_dc; | ||
36 | |||
37 | extern const struct action_chain suspend_action_chain; | ||
38 | |||
39 | extern const struct action_chain resume_action_chain; | ||
40 | |||
41 | extern const struct action_chain complete_init_action_chain; | ||
42 | |||
43 | extern const struct action_chain enable_gfx_clock_gating_action_chain; | ||
44 | |||
45 | extern const struct action_chain disable_gfx_clock_gating_action_chain; | ||
46 | |||
47 | extern const struct action_chain enable_cgpg_action_chain; | ||
48 | |||
49 | extern const struct action_chain disable_cgpg_action_chain; | ||
50 | |||
51 | extern const struct action_chain enable_user_2d_performance_action_chain; | ||
52 | |||
53 | extern const struct action_chain disable_user_2d_performance_action_chain; | ||
54 | |||
55 | extern const struct action_chain enable_user_state_action_chain; | ||
56 | |||
57 | extern const struct action_chain readjust_power_state_action_chain; | ||
58 | |||
59 | extern const struct action_chain display_config_change_action_chain; | ||
60 | |||
61 | #endif /*_EVENT_ACTION_CHAINS_H_*/ | ||
62 | |||
diff --git a/drivers/gpu/drm/amd/powerplay/eventmgr/eventinit.c b/drivers/gpu/drm/amd/powerplay/eventmgr/eventinit.c deleted file mode 100644 index a3cd230d636d..000000000000 --- a/drivers/gpu/drm/amd/powerplay/eventmgr/eventinit.c +++ /dev/null | |||
@@ -1,195 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2015 Advanced Micro Devices, Inc. | ||
3 | * | ||
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: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
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. | ||
21 | * | ||
22 | */ | ||
23 | #include "eventmgr.h" | ||
24 | #include "eventinit.h" | ||
25 | #include "ppinterrupt.h" | ||
26 | #include "hardwaremanager.h" | ||
27 | |||
28 | void pem_init_feature_info(struct pp_eventmgr *eventmgr) | ||
29 | { | ||
30 | |||
31 | /* PowerPlay info */ | ||
32 | eventmgr->ui_state_info[PP_PowerSource_AC].default_ui_lable = | ||
33 | PP_StateUILabel_Performance; | ||
34 | |||
35 | eventmgr->ui_state_info[PP_PowerSource_AC].current_ui_label = | ||
36 | PP_StateUILabel_Performance; | ||
37 | |||
38 | eventmgr->ui_state_info[PP_PowerSource_DC].default_ui_lable = | ||
39 | PP_StateUILabel_Battery; | ||
40 | |||
41 | eventmgr->ui_state_info[PP_PowerSource_DC].current_ui_label = | ||
42 | PP_StateUILabel_Battery; | ||
43 | |||
44 | if (phm_cap_enabled(eventmgr->platform_descriptor->platformCaps, PHM_PlatformCaps_PowerPlaySupport)) { | ||
45 | eventmgr->features[PP_Feature_PowerPlay].supported = true; | ||
46 | eventmgr->features[PP_Feature_PowerPlay].version = PEM_CURRENT_POWERPLAY_FEATURE_VERSION; | ||
47 | eventmgr->features[PP_Feature_PowerPlay].enabled_default = true; | ||
48 | eventmgr->features[PP_Feature_PowerPlay].enabled = true; | ||
49 | } else { | ||
50 | eventmgr->features[PP_Feature_PowerPlay].supported = false; | ||
51 | eventmgr->features[PP_Feature_PowerPlay].enabled = false; | ||
52 | eventmgr->features[PP_Feature_PowerPlay].enabled_default = false; | ||
53 | } | ||
54 | |||
55 | eventmgr->features[PP_Feature_Force3DClock].supported = true; | ||
56 | eventmgr->features[PP_Feature_Force3DClock].enabled = false; | ||
57 | eventmgr->features[PP_Feature_Force3DClock].enabled_default = false; | ||
58 | eventmgr->features[PP_Feature_Force3DClock].version = 1; | ||
59 | |||
60 | /* over drive*/ | ||
61 | eventmgr->features[PP_Feature_User2DPerformance].version = 4; | ||
62 | eventmgr->features[PP_Feature_User3DPerformance].version = 4; | ||
63 | eventmgr->features[PP_Feature_OverdriveTest].version = 4; | ||
64 | |||
65 | eventmgr->features[PP_Feature_OverDrive].version = 4; | ||
66 | eventmgr->features[PP_Feature_OverDrive].enabled = false; | ||
67 | eventmgr->features[PP_Feature_OverDrive].enabled_default = false; | ||
68 | |||
69 | eventmgr->features[PP_Feature_User2DPerformance].supported = false; | ||
70 | eventmgr->features[PP_Feature_User2DPerformance].enabled = false; | ||
71 | eventmgr->features[PP_Feature_User2DPerformance].enabled_default = false; | ||
72 | |||
73 | eventmgr->features[PP_Feature_User3DPerformance].supported = false; | ||
74 | eventmgr->features[PP_Feature_User3DPerformance].enabled = false; | ||
75 | eventmgr->features[PP_Feature_User3DPerformance].enabled_default = false; | ||
76 | |||
77 | eventmgr->features[PP_Feature_OverdriveTest].supported = false; | ||
78 | eventmgr->features[PP_Feature_OverdriveTest].enabled = false; | ||
79 | eventmgr->features[PP_Feature_OverdriveTest].enabled_default = false; | ||
80 | |||
81 | eventmgr->features[PP_Feature_OverDrive].supported = false; | ||
82 | |||
83 | eventmgr->features[PP_Feature_PowerBudgetWaiver].enabled_default = false; | ||
84 | eventmgr->features[PP_Feature_PowerBudgetWaiver].version = 1; | ||
85 | eventmgr->features[PP_Feature_PowerBudgetWaiver].supported = false; | ||
86 | eventmgr->features[PP_Feature_PowerBudgetWaiver].enabled = false; | ||
87 | |||
88 | /* Multi UVD States support */ | ||
89 | eventmgr->features[PP_Feature_MultiUVDState].supported = false; | ||
90 | eventmgr->features[PP_Feature_MultiUVDState].enabled = false; | ||
91 | eventmgr->features[PP_Feature_MultiUVDState].enabled_default = false; | ||
92 | |||
93 | /* Dynamic UVD States support */ | ||
94 | eventmgr->features[PP_Feature_DynamicUVDState].supported = false; | ||
95 | eventmgr->features[PP_Feature_DynamicUVDState].enabled = false; | ||
96 | eventmgr->features[PP_Feature_DynamicUVDState].enabled_default = false; | ||
97 | |||
98 | /* VCE DPM support */ | ||
99 | eventmgr->features[PP_Feature_VCEDPM].supported = false; | ||
100 | eventmgr->features[PP_Feature_VCEDPM].enabled = false; | ||
101 | eventmgr->features[PP_Feature_VCEDPM].enabled_default = false; | ||
102 | |||
103 | /* ACP PowerGating support */ | ||
104 | eventmgr->features[PP_Feature_ACP_POWERGATING].supported = false; | ||
105 | eventmgr->features[PP_Feature_ACP_POWERGATING].enabled = false; | ||
106 | eventmgr->features[PP_Feature_ACP_POWERGATING].enabled_default = false; | ||
107 | |||
108 | /* PPM support */ | ||
109 | eventmgr->features[PP_Feature_PPM].version = 1; | ||
110 | eventmgr->features[PP_Feature_PPM].supported = false; | ||
111 | eventmgr->features[PP_Feature_PPM].enabled = false; | ||
112 | |||
113 | /* FFC support (enables fan and temp settings, Gemini needs temp settings) */ | ||
114 | if (phm_cap_enabled(eventmgr->platform_descriptor->platformCaps, PHM_PlatformCaps_ODFuzzyFanControlSupport) || | ||
115 | phm_cap_enabled(eventmgr->platform_descriptor->platformCaps, PHM_PlatformCaps_GeminiRegulatorFanControlSupport)) { | ||
116 | eventmgr->features[PP_Feature_FFC].version = 1; | ||
117 | eventmgr->features[PP_Feature_FFC].supported = true; | ||
118 | eventmgr->features[PP_Feature_FFC].enabled = true; | ||
119 | eventmgr->features[PP_Feature_FFC].enabled_default = true; | ||
120 | } else { | ||
121 | eventmgr->features[PP_Feature_FFC].supported = false; | ||
122 | eventmgr->features[PP_Feature_FFC].enabled = false; | ||
123 | eventmgr->features[PP_Feature_FFC].enabled_default = false; | ||
124 | } | ||
125 | |||
126 | eventmgr->features[PP_Feature_VariBright].supported = false; | ||
127 | eventmgr->features[PP_Feature_VariBright].enabled = false; | ||
128 | eventmgr->features[PP_Feature_VariBright].enabled_default = false; | ||
129 | |||
130 | eventmgr->features[PP_Feature_BACO].supported = false; | ||
131 | eventmgr->features[PP_Feature_BACO].supported = false; | ||
132 | eventmgr->features[PP_Feature_BACO].enabled_default = false; | ||
133 | |||
134 | /* PowerDown feature support */ | ||
135 | eventmgr->features[PP_Feature_PowerDown].supported = false; | ||
136 | eventmgr->features[PP_Feature_PowerDown].enabled = false; | ||
137 | eventmgr->features[PP_Feature_PowerDown].enabled_default = false; | ||
138 | |||
139 | eventmgr->features[PP_Feature_FPS].version = 1; | ||
140 | eventmgr->features[PP_Feature_FPS].supported = false; | ||
141 | eventmgr->features[PP_Feature_FPS].enabled_default = false; | ||
142 | eventmgr->features[PP_Feature_FPS].enabled = false; | ||
143 | |||
144 | eventmgr->features[PP_Feature_ViPG].version = 1; | ||
145 | eventmgr->features[PP_Feature_ViPG].supported = false; | ||
146 | eventmgr->features[PP_Feature_ViPG].enabled_default = false; | ||
147 | eventmgr->features[PP_Feature_ViPG].enabled = false; | ||
148 | } | ||
149 | |||
150 | static int thermal_interrupt_callback(void *private_data, | ||
151 | unsigned src_id, const uint32_t *iv_entry) | ||
152 | { | ||
153 | /* TO DO hanle PEM_Event_ThermalNotification (struct pp_eventmgr *)private_data*/ | ||
154 | pr_info("current thermal is out of range \n"); | ||
155 | return 0; | ||
156 | } | ||
157 | |||
158 | int pem_register_interrupts(struct pp_eventmgr *eventmgr) | ||
159 | { | ||
160 | int result = 0; | ||
161 | struct pp_interrupt_registration_info info; | ||
162 | |||
163 | info.call_back = thermal_interrupt_callback; | ||
164 | info.context = eventmgr; | ||
165 | |||
166 | result = phm_register_thermal_interrupt(eventmgr->hwmgr, &info); | ||
167 | |||
168 | /* TODO: | ||
169 | * 2. Register CTF event interrupt | ||
170 | * 3. Register for vbios events interrupt | ||
171 | * 4. Register External Throttle Interrupt | ||
172 | * 5. Register Smc To Host Interrupt | ||
173 | * */ | ||
174 | return result; | ||
175 | } | ||
176 | |||
177 | |||
178 | int pem_unregister_interrupts(struct pp_eventmgr *eventmgr) | ||
179 | { | ||
180 | return 0; | ||
181 | } | ||
182 | |||
183 | |||
184 | void pem_uninit_featureInfo(struct pp_eventmgr *eventmgr) | ||
185 | { | ||
186 | eventmgr->features[PP_Feature_MultiUVDState].supported = false; | ||
187 | eventmgr->features[PP_Feature_VariBright].supported = false; | ||
188 | eventmgr->features[PP_Feature_PowerBudgetWaiver].supported = false; | ||
189 | eventmgr->features[PP_Feature_OverDrive].supported = false; | ||
190 | eventmgr->features[PP_Feature_OverdriveTest].supported = false; | ||
191 | eventmgr->features[PP_Feature_User3DPerformance].supported = false; | ||
192 | eventmgr->features[PP_Feature_User2DPerformance].supported = false; | ||
193 | eventmgr->features[PP_Feature_PowerPlay].supported = false; | ||
194 | eventmgr->features[PP_Feature_Force3DClock].supported = false; | ||
195 | } | ||
diff --git a/drivers/gpu/drm/amd/powerplay/eventmgr/eventinit.h b/drivers/gpu/drm/amd/powerplay/eventmgr/eventinit.h deleted file mode 100644 index 9ef96aab3f24..000000000000 --- a/drivers/gpu/drm/amd/powerplay/eventmgr/eventinit.h +++ /dev/null | |||
@@ -1,34 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2015 Advanced Micro Devices, Inc. | ||
3 | * | ||
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: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
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. | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #ifndef _EVENTINIT_H_ | ||
25 | #define _EVENTINIT_H_ | ||
26 | |||
27 | #define PEM_CURRENT_POWERPLAY_FEATURE_VERSION 4 | ||
28 | |||
29 | void pem_init_feature_info(struct pp_eventmgr *eventmgr); | ||
30 | void pem_uninit_featureInfo(struct pp_eventmgr *eventmgr); | ||
31 | int pem_register_interrupts(struct pp_eventmgr *eventmgr); | ||
32 | int pem_unregister_interrupts(struct pp_eventmgr *eventmgr); | ||
33 | |||
34 | #endif /* _EVENTINIT_H_ */ | ||
diff --git a/drivers/gpu/drm/amd/powerplay/eventmgr/eventmanagement.c b/drivers/gpu/drm/amd/powerplay/eventmgr/eventmanagement.c deleted file mode 100644 index cd1ca07ef7f7..000000000000 --- a/drivers/gpu/drm/amd/powerplay/eventmgr/eventmanagement.c +++ /dev/null | |||
@@ -1,215 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2015 Advanced Micro Devices, Inc. | ||
3 | * | ||
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: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
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. | ||
21 | * | ||
22 | */ | ||
23 | #include "eventmanagement.h" | ||
24 | #include "eventmgr.h" | ||
25 | #include "eventactionchains.h" | ||
26 | |||
27 | int pem_init_event_action_chains(struct pp_eventmgr *eventmgr) | ||
28 | { | ||
29 | int i; | ||
30 | |||
31 | for (i = 0; i < AMD_PP_EVENT_MAX; i++) | ||
32 | eventmgr->event_chain[i] = NULL; | ||
33 | |||
34 | eventmgr->event_chain[AMD_PP_EVENT_SUSPEND] = pem_get_suspend_action_chain(eventmgr); | ||
35 | eventmgr->event_chain[AMD_PP_EVENT_INITIALIZE] = pem_get_initialize_action_chain(eventmgr); | ||
36 | eventmgr->event_chain[AMD_PP_EVENT_UNINITIALIZE] = pem_get_uninitialize_action_chain(eventmgr); | ||
37 | eventmgr->event_chain[AMD_PP_EVENT_POWER_SOURCE_CHANGE] = pem_get_power_source_change_action_chain(eventmgr); | ||
38 | eventmgr->event_chain[AMD_PP_EVENT_HIBERNATE] = pem_get_hibernate_action_chain(eventmgr); | ||
39 | eventmgr->event_chain[AMD_PP_EVENT_RESUME] = pem_get_resume_action_chain(eventmgr); | ||
40 | eventmgr->event_chain[AMD_PP_EVENT_THERMAL_NOTIFICATION] = pem_get_thermal_notification_action_chain(eventmgr); | ||
41 | eventmgr->event_chain[AMD_PP_EVENT_VBIOS_NOTIFICATION] = pem_get_vbios_notification_action_chain(eventmgr); | ||
42 | eventmgr->event_chain[AMD_PP_EVENT_ENTER_THERMAL_STATE] = pem_get_enter_thermal_state_action_chain(eventmgr); | ||
43 | eventmgr->event_chain[AMD_PP_EVENT_EXIT_THERMAL_STATE] = pem_get_exit_thermal_state_action_chain(eventmgr); | ||
44 | eventmgr->event_chain[AMD_PP_EVENT_ENABLE_POWER_PLAY] = pem_get_enable_powerplay_action_chain(eventmgr); | ||
45 | eventmgr->event_chain[AMD_PP_EVENT_DISABLE_POWER_PLAY] = pem_get_disable_powerplay_action_chain(eventmgr); | ||
46 | eventmgr->event_chain[AMD_PP_EVENT_ENABLE_OVER_DRIVE_TEST] = pem_get_enable_overdrive_test_action_chain(eventmgr); | ||
47 | eventmgr->event_chain[AMD_PP_EVENT_DISABLE_OVER_DRIVE_TEST] = pem_get_disable_overdrive_test_action_chain(eventmgr); | ||
48 | eventmgr->event_chain[AMD_PP_EVENT_ENABLE_GFX_CLOCK_GATING] = pem_get_enable_gfx_clock_gating_action_chain(eventmgr); | ||
49 | eventmgr->event_chain[AMD_PP_EVENT_DISABLE_GFX_CLOCK_GATING] = pem_get_disable_gfx_clock_gating_action_chain(eventmgr); | ||
50 | eventmgr->event_chain[AMD_PP_EVENT_ENABLE_CGPG] = pem_get_enable_cgpg_action_chain(eventmgr); | ||
51 | eventmgr->event_chain[AMD_PP_EVENT_DISABLE_CGPG] = pem_get_disable_cgpg_action_chain(eventmgr); | ||
52 | eventmgr->event_chain[AMD_PP_EVENT_COMPLETE_INIT] = pem_get_complete_init_action_chain(eventmgr); | ||
53 | eventmgr->event_chain[AMD_PP_EVENT_SCREEN_ON] = pem_get_screen_on_action_chain(eventmgr); | ||
54 | eventmgr->event_chain[AMD_PP_EVENT_SCREEN_OFF] = pem_get_screen_off_action_chain(eventmgr); | ||
55 | eventmgr->event_chain[AMD_PP_EVENT_PRE_SUSPEND] = pem_get_pre_suspend_action_chain(eventmgr); | ||
56 | eventmgr->event_chain[AMD_PP_EVENT_PRE_RESUME] = pem_get_pre_resume_action_chain(eventmgr); | ||
57 | eventmgr->event_chain[AMD_PP_EVENT_ENABLE_USER_STATE] = pem_enable_user_state_action_chain(eventmgr); | ||
58 | eventmgr->event_chain[AMD_PP_EVENT_READJUST_POWER_STATE] = pem_readjust_power_state_action_chain(eventmgr); | ||
59 | eventmgr->event_chain[AMD_PP_EVENT_DISPLAY_CONFIG_CHANGE] = pem_display_config_change_action_chain(eventmgr); | ||
60 | return 0; | ||
61 | } | ||
62 | |||
63 | int pem_excute_event_chain(struct pp_eventmgr *eventmgr, const struct action_chain *event_chain, struct pem_event_data *event_data) | ||
64 | { | ||
65 | const pem_event_action * const *paction_chain; | ||
66 | const pem_event_action *psub_chain; | ||
67 | int tmp_result = 0; | ||
68 | int result = 0; | ||
69 | |||
70 | if (eventmgr == NULL || event_chain == NULL || event_data == NULL) | ||
71 | return -EINVAL; | ||
72 | |||
73 | for (paction_chain = event_chain->action_chain; NULL != *paction_chain; paction_chain++) { | ||
74 | if (0 != result) | ||
75 | return result; | ||
76 | |||
77 | for (psub_chain = *paction_chain; NULL != *psub_chain; psub_chain++) { | ||
78 | tmp_result = (*psub_chain)(eventmgr, event_data); | ||
79 | if (0 == result) | ||
80 | result = tmp_result; | ||
81 | } | ||
82 | } | ||
83 | |||
84 | return result; | ||
85 | } | ||
86 | |||
87 | const struct action_chain *pem_get_suspend_action_chain(struct pp_eventmgr *eventmgr) | ||
88 | { | ||
89 | return &suspend_action_chain; | ||
90 | } | ||
91 | |||
92 | const struct action_chain *pem_get_initialize_action_chain(struct pp_eventmgr *eventmgr) | ||
93 | { | ||
94 | return &initialize_action_chain; | ||
95 | } | ||
96 | |||
97 | const struct action_chain *pem_get_uninitialize_action_chain(struct pp_eventmgr *eventmgr) | ||
98 | { | ||
99 | return &uninitialize_action_chain; | ||
100 | } | ||
101 | |||
102 | const struct action_chain *pem_get_power_source_change_action_chain(struct pp_eventmgr *eventmgr) | ||
103 | { | ||
104 | return &power_source_change_action_chain_pp_enabled; /* other case base on feature info*/ | ||
105 | } | ||
106 | |||
107 | const struct action_chain *pem_get_resume_action_chain(struct pp_eventmgr *eventmgr) | ||
108 | { | ||
109 | return &resume_action_chain; | ||
110 | } | ||
111 | |||
112 | const struct action_chain *pem_get_hibernate_action_chain(struct pp_eventmgr *eventmgr) | ||
113 | { | ||
114 | return NULL; | ||
115 | } | ||
116 | |||
117 | const struct action_chain *pem_get_thermal_notification_action_chain(struct pp_eventmgr *eventmgr) | ||
118 | { | ||
119 | return NULL; | ||
120 | } | ||
121 | |||
122 | const struct action_chain *pem_get_vbios_notification_action_chain(struct pp_eventmgr *eventmgr) | ||
123 | { | ||
124 | return NULL; | ||
125 | } | ||
126 | |||
127 | const struct action_chain *pem_get_enter_thermal_state_action_chain(struct pp_eventmgr *eventmgr) | ||
128 | { | ||
129 | return NULL; | ||
130 | } | ||
131 | |||
132 | const struct action_chain *pem_get_exit_thermal_state_action_chain(struct pp_eventmgr *eventmgr) | ||
133 | { | ||
134 | return NULL; | ||
135 | } | ||
136 | |||
137 | const struct action_chain *pem_get_enable_powerplay_action_chain(struct pp_eventmgr *eventmgr) | ||
138 | { | ||
139 | return NULL; | ||
140 | } | ||
141 | |||
142 | const struct action_chain *pem_get_disable_powerplay_action_chain(struct pp_eventmgr *eventmgr) | ||
143 | { | ||
144 | return NULL; | ||
145 | } | ||
146 | |||
147 | const struct action_chain *pem_get_enable_overdrive_test_action_chain(struct pp_eventmgr *eventmgr) | ||
148 | { | ||
149 | return NULL; | ||
150 | } | ||
151 | |||
152 | const struct action_chain *pem_get_disable_overdrive_test_action_chain(struct pp_eventmgr *eventmgr) | ||
153 | { | ||
154 | return NULL; | ||
155 | } | ||
156 | |||
157 | const struct action_chain *pem_get_enable_gfx_clock_gating_action_chain(struct pp_eventmgr *eventmgr) | ||
158 | { | ||
159 | return &enable_gfx_clock_gating_action_chain; | ||
160 | } | ||
161 | |||
162 | const struct action_chain *pem_get_disable_gfx_clock_gating_action_chain(struct pp_eventmgr *eventmgr) | ||
163 | { | ||
164 | return &disable_gfx_clock_gating_action_chain; | ||
165 | } | ||
166 | |||
167 | const struct action_chain *pem_get_enable_cgpg_action_chain(struct pp_eventmgr *eventmgr) | ||
168 | { | ||
169 | return &enable_cgpg_action_chain; | ||
170 | } | ||
171 | |||
172 | const struct action_chain *pem_get_disable_cgpg_action_chain(struct pp_eventmgr *eventmgr) | ||
173 | { | ||
174 | return &disable_cgpg_action_chain; | ||
175 | } | ||
176 | |||
177 | const struct action_chain *pem_get_complete_init_action_chain(struct pp_eventmgr *eventmgr) | ||
178 | { | ||
179 | return &complete_init_action_chain; | ||
180 | } | ||
181 | |||
182 | const struct action_chain *pem_get_screen_on_action_chain(struct pp_eventmgr *eventmgr) | ||
183 | { | ||
184 | return NULL; | ||
185 | } | ||
186 | |||
187 | const struct action_chain *pem_get_screen_off_action_chain(struct pp_eventmgr *eventmgr) | ||
188 | { | ||
189 | return NULL; | ||
190 | } | ||
191 | |||
192 | const struct action_chain *pem_get_pre_suspend_action_chain(struct pp_eventmgr *eventmgr) | ||
193 | { | ||
194 | return NULL; | ||
195 | } | ||
196 | |||
197 | const struct action_chain *pem_get_pre_resume_action_chain(struct pp_eventmgr *eventmgr) | ||
198 | { | ||
199 | return NULL; | ||
200 | } | ||
201 | |||
202 | const struct action_chain *pem_enable_user_state_action_chain(struct pp_eventmgr *eventmgr) | ||
203 | { | ||
204 | return &enable_user_state_action_chain; | ||
205 | } | ||
206 | |||
207 | const struct action_chain *pem_readjust_power_state_action_chain(struct pp_eventmgr *eventmgr) | ||
208 | { | ||
209 | return &readjust_power_state_action_chain; | ||
210 | } | ||
211 | |||
212 | const struct action_chain *pem_display_config_change_action_chain(struct pp_eventmgr *eventmgr) | ||
213 | { | ||
214 | return &display_config_change_action_chain; | ||
215 | } | ||
diff --git a/drivers/gpu/drm/amd/powerplay/eventmgr/eventmanagement.h b/drivers/gpu/drm/amd/powerplay/eventmgr/eventmanagement.h deleted file mode 100644 index 383d4b295aa9..000000000000 --- a/drivers/gpu/drm/amd/powerplay/eventmgr/eventmanagement.h +++ /dev/null | |||
@@ -1,59 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2015 Advanced Micro Devices, Inc. | ||
3 | * | ||
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: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
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. | ||
21 | * | ||
22 | */ | ||
23 | #ifndef _EVENT_MANAGEMENT_H_ | ||
24 | #define _EVENT_MANAGEMENT_H_ | ||
25 | |||
26 | #include "eventmgr.h" | ||
27 | |||
28 | int pem_init_event_action_chains(struct pp_eventmgr *eventmgr); | ||
29 | int pem_excute_event_chain(struct pp_eventmgr *eventmgr, const struct action_chain *event_chain, struct pem_event_data *event_data); | ||
30 | const struct action_chain *pem_get_suspend_action_chain(struct pp_eventmgr *eventmgr); | ||
31 | const struct action_chain *pem_get_initialize_action_chain(struct pp_eventmgr *eventmgr); | ||
32 | const struct action_chain *pem_get_uninitialize_action_chain(struct pp_eventmgr *eventmgr); | ||
33 | const struct action_chain *pem_get_power_source_change_action_chain(struct pp_eventmgr *eventmgr); | ||
34 | const struct action_chain *pem_get_resume_action_chain(struct pp_eventmgr *eventmgr); | ||
35 | const struct action_chain *pem_get_hibernate_action_chain(struct pp_eventmgr *eventmgr); | ||
36 | const struct action_chain *pem_get_thermal_notification_action_chain(struct pp_eventmgr *eventmgr); | ||
37 | const struct action_chain *pem_get_vbios_notification_action_chain(struct pp_eventmgr *eventmgr); | ||
38 | const struct action_chain *pem_get_enter_thermal_state_action_chain(struct pp_eventmgr *eventmgr); | ||
39 | const struct action_chain *pem_get_exit_thermal_state_action_chain(struct pp_eventmgr *eventmgr); | ||
40 | const struct action_chain *pem_get_enable_powerplay_action_chain(struct pp_eventmgr *eventmgr); | ||
41 | const struct action_chain *pem_get_disable_powerplay_action_chain(struct pp_eventmgr *eventmgr); | ||
42 | const struct action_chain *pem_get_enable_overdrive_test_action_chain(struct pp_eventmgr *eventmgr); | ||
43 | const struct action_chain *pem_get_disable_overdrive_test_action_chain(struct pp_eventmgr *eventmgr); | ||
44 | const struct action_chain *pem_get_enable_gfx_clock_gating_action_chain(struct pp_eventmgr *eventmgr); | ||
45 | const struct action_chain *pem_get_disable_gfx_clock_gating_action_chain(struct pp_eventmgr *eventmgr); | ||
46 | const struct action_chain *pem_get_enable_cgpg_action_chain(struct pp_eventmgr *eventmgr); | ||
47 | const struct action_chain *pem_get_disable_cgpg_action_chain(struct pp_eventmgr *eventmgr); | ||
48 | const struct action_chain *pem_get_complete_init_action_chain(struct pp_eventmgr *eventmgr); | ||
49 | const struct action_chain *pem_get_screen_on_action_chain(struct pp_eventmgr *eventmgr); | ||
50 | const struct action_chain *pem_get_screen_off_action_chain(struct pp_eventmgr *eventmgr); | ||
51 | const struct action_chain *pem_get_pre_suspend_action_chain(struct pp_eventmgr *eventmgr); | ||
52 | const struct action_chain *pem_get_pre_resume_action_chain(struct pp_eventmgr *eventmgr); | ||
53 | |||
54 | extern const struct action_chain *pem_enable_user_state_action_chain(struct pp_eventmgr *eventmgr); | ||
55 | extern const struct action_chain *pem_readjust_power_state_action_chain(struct pp_eventmgr *eventmgr); | ||
56 | const struct action_chain *pem_display_config_change_action_chain(struct pp_eventmgr *eventmgr); | ||
57 | |||
58 | |||
59 | #endif /* _EVENT_MANAGEMENT_H_ */ | ||
diff --git a/drivers/gpu/drm/amd/powerplay/eventmgr/eventmgr.c b/drivers/gpu/drm/amd/powerplay/eventmgr/eventmgr.c deleted file mode 100644 index 3e3ca03bd344..000000000000 --- a/drivers/gpu/drm/amd/powerplay/eventmgr/eventmgr.c +++ /dev/null | |||
@@ -1,104 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2015 Advanced Micro Devices, Inc. | ||
3 | * | ||
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: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
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. | ||
21 | * | ||
22 | */ | ||
23 | #include <linux/types.h> | ||
24 | #include <linux/kernel.h> | ||
25 | #include <linux/slab.h> | ||
26 | #include "eventmgr.h" | ||
27 | #include "hwmgr.h" | ||
28 | #include "eventinit.h" | ||
29 | #include "eventmanagement.h" | ||
30 | |||
31 | static int pem_init(struct pp_eventmgr *eventmgr) | ||
32 | { | ||
33 | int result = 0; | ||
34 | struct pem_event_data event_data = { {0} }; | ||
35 | |||
36 | /* Initialize PowerPlay feature info */ | ||
37 | pem_init_feature_info(eventmgr); | ||
38 | |||
39 | /* Initialize event action chains */ | ||
40 | pem_init_event_action_chains(eventmgr); | ||
41 | |||
42 | /* Call initialization event */ | ||
43 | result = pem_handle_event(eventmgr, AMD_PP_EVENT_INITIALIZE, &event_data); | ||
44 | |||
45 | /* if (0 != result) | ||
46 | return result; */ | ||
47 | |||
48 | /* Register interrupt callback functions */ | ||
49 | result = pem_register_interrupts(eventmgr); | ||
50 | return 0; | ||
51 | } | ||
52 | |||
53 | static void pem_fini(struct pp_eventmgr *eventmgr) | ||
54 | { | ||
55 | struct pem_event_data event_data = { {0} }; | ||
56 | |||
57 | pem_uninit_featureInfo(eventmgr); | ||
58 | pem_unregister_interrupts(eventmgr); | ||
59 | |||
60 | pem_handle_event(eventmgr, AMD_PP_EVENT_UNINITIALIZE, &event_data); | ||
61 | } | ||
62 | |||
63 | int eventmgr_early_init(struct pp_instance *handle) | ||
64 | { | ||
65 | struct pp_eventmgr *eventmgr; | ||
66 | |||
67 | if (handle == NULL) | ||
68 | return -EINVAL; | ||
69 | |||
70 | eventmgr = kzalloc(sizeof(struct pp_eventmgr), GFP_KERNEL); | ||
71 | if (eventmgr == NULL) | ||
72 | return -ENOMEM; | ||
73 | |||
74 | eventmgr->hwmgr = handle->hwmgr; | ||
75 | handle->eventmgr = eventmgr; | ||
76 | |||
77 | eventmgr->platform_descriptor = &(eventmgr->hwmgr->platform_descriptor); | ||
78 | eventmgr->pp_eventmgr_init = pem_init; | ||
79 | eventmgr->pp_eventmgr_fini = pem_fini; | ||
80 | |||
81 | return 0; | ||
82 | } | ||
83 | |||
84 | static int pem_handle_event_unlocked(struct pp_eventmgr *eventmgr, enum amd_pp_event event, struct pem_event_data *data) | ||
85 | { | ||
86 | if (eventmgr == NULL || event >= AMD_PP_EVENT_MAX || data == NULL) | ||
87 | return -EINVAL; | ||
88 | |||
89 | return pem_excute_event_chain(eventmgr, eventmgr->event_chain[event], data); | ||
90 | } | ||
91 | |||
92 | int pem_handle_event(struct pp_eventmgr *eventmgr, enum amd_pp_event event, struct pem_event_data *event_data) | ||
93 | { | ||
94 | int r = 0; | ||
95 | |||
96 | r = pem_handle_event_unlocked(eventmgr, event, event_data); | ||
97 | |||
98 | return r; | ||
99 | } | ||
100 | |||
101 | bool pem_is_hw_access_blocked(struct pp_eventmgr *eventmgr) | ||
102 | { | ||
103 | return (eventmgr->block_adjust_power_state || phm_is_hw_access_blocked(eventmgr->hwmgr)); | ||
104 | } | ||
diff --git a/drivers/gpu/drm/amd/powerplay/eventmgr/eventsubchains.c b/drivers/gpu/drm/amd/powerplay/eventmgr/eventsubchains.c deleted file mode 100644 index b82c43af59ab..000000000000 --- a/drivers/gpu/drm/amd/powerplay/eventmgr/eventsubchains.c +++ /dev/null | |||
@@ -1,410 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2015 Advanced Micro Devices, Inc. | ||
3 | * | ||
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: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
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. | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #include "eventmgr.h" | ||
25 | #include "eventsubchains.h" | ||
26 | #include "eventtasks.h" | ||
27 | #include "hardwaremanager.h" | ||
28 | |||
29 | const pem_event_action reset_display_phy_access_tasks[] = { | ||
30 | pem_task_reset_display_phys_access, | ||
31 | NULL | ||
32 | }; | ||
33 | |||
34 | const pem_event_action broadcast_power_policy_tasks[] = { | ||
35 | /* PEM_Task_BroadcastPowerPolicyChange, */ | ||
36 | NULL | ||
37 | }; | ||
38 | |||
39 | const pem_event_action unregister_interrupt_tasks[] = { | ||
40 | pem_task_unregister_interrupts, | ||
41 | NULL | ||
42 | }; | ||
43 | |||
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, | ||
47 | NULL | ||
48 | }; | ||
49 | |||
50 | const pem_event_action disable_gfx_clockgating_tasks[] = { | ||
51 | pem_task_disable_gfx_clock_gating, | ||
52 | NULL | ||
53 | }; | ||
54 | |||
55 | const pem_event_action block_adjust_power_state_tasks[] = { | ||
56 | pem_task_block_adjust_power_state, | ||
57 | NULL | ||
58 | }; | ||
59 | |||
60 | |||
61 | const pem_event_action unblock_adjust_power_state_tasks[] = { | ||
62 | pem_task_unblock_adjust_power_state, | ||
63 | NULL | ||
64 | }; | ||
65 | |||
66 | const pem_event_action set_performance_state_tasks[] = { | ||
67 | pem_task_set_performance_state, | ||
68 | NULL | ||
69 | }; | ||
70 | |||
71 | const pem_event_action get_2d_performance_state_tasks[] = { | ||
72 | pem_task_get_2D_performance_state_id, | ||
73 | NULL | ||
74 | }; | ||
75 | |||
76 | const pem_event_action conditionally_force3D_performance_state_tasks[] = { | ||
77 | pem_task_conditionally_force_3d_performance_state, | ||
78 | NULL | ||
79 | }; | ||
80 | |||
81 | const pem_event_action process_vbios_eventinfo_tasks[] = { | ||
82 | /* PEM_Task_ProcessVbiosEventInfo,*/ | ||
83 | NULL | ||
84 | }; | ||
85 | |||
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, | ||
91 | NULL | ||
92 | }; | ||
93 | |||
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, | ||
98 | NULL | ||
99 | }; | ||
100 | |||
101 | const pem_event_action setup_asic_tasks[] = { | ||
102 | pem_task_setup_asic, | ||
103 | NULL | ||
104 | }; | ||
105 | |||
106 | const pem_event_action power_budget_tasks[] = { | ||
107 | /* TODO | ||
108 | * PEM_Task_PowerBudgetWaiverAvailable, | ||
109 | * PEM_Task_PowerBudgetWarningMessage, | ||
110 | * PEM_Task_PruneStatesBasedOnPowerBudget, | ||
111 | */ | ||
112 | NULL | ||
113 | }; | ||
114 | |||
115 | const pem_event_action system_config_tasks[] = { | ||
116 | /* PEM_Task_PruneStatesBasedOnSystemConfig,*/ | ||
117 | NULL | ||
118 | }; | ||
119 | |||
120 | |||
121 | const pem_event_action conditionally_force_3d_performance_state_tasks[] = { | ||
122 | pem_task_conditionally_force_3d_performance_state, | ||
123 | NULL | ||
124 | }; | ||
125 | |||
126 | const pem_event_action ungate_all_display_phys_tasks[] = { | ||
127 | /* PEM_Task_GetDisplayPhyAccessInfo */ | ||
128 | NULL | ||
129 | }; | ||
130 | |||
131 | const pem_event_action uninitialize_display_phy_access_tasks[] = { | ||
132 | /* PEM_Task_UninitializeDisplayPhysAccess, */ | ||
133 | NULL | ||
134 | }; | ||
135 | |||
136 | const pem_event_action disable_gfx_voltage_island_power_gating_tasks[] = { | ||
137 | /* PEM_Task_DisableVoltageIslandPowerGating, */ | ||
138 | NULL | ||
139 | }; | ||
140 | |||
141 | const pem_event_action disable_gfx_clock_gating_tasks[] = { | ||
142 | pem_task_disable_gfx_clock_gating, | ||
143 | NULL | ||
144 | }; | ||
145 | |||
146 | const pem_event_action set_boot_state_tasks[] = { | ||
147 | pem_task_get_boot_state_id, | ||
148 | pem_task_set_boot_state, | ||
149 | NULL | ||
150 | }; | ||
151 | |||
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, */ | ||
158 | NULL | ||
159 | }; | ||
160 | |||
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, | ||
165 | NULL | ||
166 | }; | ||
167 | |||
168 | const pem_event_action disable_clock_power_gatings_tasks[] = { | ||
169 | pem_task_disable_clock_power_gatings_tasks, | ||
170 | NULL | ||
171 | }; | ||
172 | |||
173 | const pem_event_action cleanup_asic_tasks[] = { | ||
174 | /* PEM_Task_DisableFPS,*/ | ||
175 | pem_task_cleanup_asic, | ||
176 | NULL | ||
177 | }; | ||
178 | |||
179 | const pem_event_action prepare_for_pnp_stop_tasks[] = { | ||
180 | /* PEM_Task_PrepareForPnpStop,*/ | ||
181 | NULL | ||
182 | }; | ||
183 | |||
184 | const pem_event_action set_power_source_tasks[] = { | ||
185 | pem_task_set_power_source, | ||
186 | pem_task_notify_hw_of_power_source, | ||
187 | NULL | ||
188 | }; | ||
189 | |||
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,*/ | ||
197 | NULL | ||
198 | }; | ||
199 | |||
200 | const pem_event_action enable_disable_fps_tasks[] = { | ||
201 | /* PEM_Task_EnableDisableFPS,*/ | ||
202 | NULL | ||
203 | }; | ||
204 | |||
205 | const pem_event_action set_nbmcu_state_tasks[] = { | ||
206 | /* PEM_Task_NBMCUStateChange,*/ | ||
207 | NULL | ||
208 | }; | ||
209 | |||
210 | const pem_event_action reset_hardware_dc_notification_tasks[] = { | ||
211 | /* PEM_Task_ResetHardwareDCNotification,*/ | ||
212 | NULL | ||
213 | }; | ||
214 | |||
215 | |||
216 | const pem_event_action notify_smu_suspend_tasks[] = { | ||
217 | /* PEM_Task_NotifySMUSuspend,*/ | ||
218 | NULL | ||
219 | }; | ||
220 | |||
221 | const pem_event_action disable_smc_firmware_ctf_tasks[] = { | ||
222 | pem_task_disable_smc_firmware_ctf, | ||
223 | NULL | ||
224 | }; | ||
225 | |||
226 | const pem_event_action disable_fps_tasks[] = { | ||
227 | /* PEM_Task_DisableFPS,*/ | ||
228 | NULL | ||
229 | }; | ||
230 | |||
231 | const pem_event_action vari_bright_suspend_tasks[] = { | ||
232 | /* PEM_Task_VariBright_Suspend,*/ | ||
233 | NULL | ||
234 | }; | ||
235 | |||
236 | const pem_event_action reset_fan_speed_to_default_tasks[] = { | ||
237 | /* PEM_Task_ResetFanSpeedToDefault,*/ | ||
238 | NULL | ||
239 | }; | ||
240 | |||
241 | const pem_event_action power_down_asic_tasks[] = { | ||
242 | /* PEM_Task_DisableFPS,*/ | ||
243 | pem_task_power_down_asic, | ||
244 | NULL | ||
245 | }; | ||
246 | |||
247 | const pem_event_action disable_stutter_mode_tasks[] = { | ||
248 | /* PEM_Task_DisableStutterMode,*/ | ||
249 | NULL | ||
250 | }; | ||
251 | |||
252 | const pem_event_action set_connected_standby_tasks[] = { | ||
253 | /* PEM_Task_SetConnectedStandby,*/ | ||
254 | NULL | ||
255 | }; | ||
256 | |||
257 | const pem_event_action block_hw_access_tasks[] = { | ||
258 | pem_task_block_hw_access, | ||
259 | NULL | ||
260 | }; | ||
261 | |||
262 | const pem_event_action unblock_hw_access_tasks[] = { | ||
263 | pem_task_un_block_hw_access, | ||
264 | NULL | ||
265 | }; | ||
266 | |||
267 | const pem_event_action resume_connected_standby_tasks[] = { | ||
268 | /* PEM_Task_ResumeConnectedStandby,*/ | ||
269 | NULL | ||
270 | }; | ||
271 | |||
272 | const pem_event_action notify_smu_resume_tasks[] = { | ||
273 | /* PEM_Task_NotifySMUResume,*/ | ||
274 | NULL | ||
275 | }; | ||
276 | |||
277 | const pem_event_action reset_display_configCounter_tasks[] = { | ||
278 | pem_task_reset_display_phys_access, | ||
279 | NULL | ||
280 | }; | ||
281 | |||
282 | const pem_event_action update_dal_configuration_tasks[] = { | ||
283 | /* PEM_Task_CheckVBlankTime,*/ | ||
284 | NULL | ||
285 | }; | ||
286 | |||
287 | const pem_event_action vari_bright_resume_tasks[] = { | ||
288 | /* PEM_Task_VariBright_Resume,*/ | ||
289 | NULL | ||
290 | }; | ||
291 | |||
292 | const pem_event_action notify_hw_power_source_tasks[] = { | ||
293 | pem_task_notify_hw_of_power_source, | ||
294 | NULL | ||
295 | }; | ||
296 | |||
297 | const pem_event_action process_vbios_event_info_tasks[] = { | ||
298 | /* PEM_Task_ProcessVbiosEventInfo,*/ | ||
299 | NULL | ||
300 | }; | ||
301 | |||
302 | const pem_event_action enable_gfx_clock_gating_tasks[] = { | ||
303 | pem_task_enable_gfx_clock_gating, | ||
304 | NULL | ||
305 | }; | ||
306 | |||
307 | const pem_event_action enable_gfx_voltage_island_power_gating_tasks[] = { | ||
308 | pem_task_enable_voltage_island_power_gating, | ||
309 | NULL | ||
310 | }; | ||
311 | |||
312 | const pem_event_action reset_clock_gating_tasks[] = { | ||
313 | /* PEM_Task_ResetClockGating*/ | ||
314 | NULL | ||
315 | }; | ||
316 | |||
317 | const pem_event_action notify_smu_vpu_recovery_end_tasks[] = { | ||
318 | /* PEM_Task_NotifySmuVPURecoveryEnd,*/ | ||
319 | NULL | ||
320 | }; | ||
321 | |||
322 | const pem_event_action disable_vpu_cap_tasks[] = { | ||
323 | /* PEM_Task_DisableVPUCap,*/ | ||
324 | NULL | ||
325 | }; | ||
326 | |||
327 | const pem_event_action execute_escape_sequence_tasks[] = { | ||
328 | /* PEM_Task_ExecuteEscapesequence,*/ | ||
329 | NULL | ||
330 | }; | ||
331 | |||
332 | const pem_event_action notify_power_state_change_tasks[] = { | ||
333 | pem_task_notify_power_state_change, | ||
334 | NULL | ||
335 | }; | ||
336 | |||
337 | const pem_event_action enable_cgpg_tasks[] = { | ||
338 | pem_task_enable_cgpg, | ||
339 | NULL | ||
340 | }; | ||
341 | |||
342 | const pem_event_action disable_cgpg_tasks[] = { | ||
343 | pem_task_disable_cgpg, | ||
344 | NULL | ||
345 | }; | ||
346 | |||
347 | const pem_event_action enable_user_2d_performance_tasks[] = { | ||
348 | /* PEM_Task_SetUser2DPerformanceFlag,*/ | ||
349 | /* PEM_Task_UpdateUser2DPerformanceEnableEvents,*/ | ||
350 | NULL | ||
351 | }; | ||
352 | |||
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,*/ | ||
361 | NULL | ||
362 | }; | ||
363 | |||
364 | const pem_event_action delete_user_2d_performance_state_tasks[] = { | ||
365 | /* PEM_Task_GetCurrentUser2DPerformanceStateID,*/ | ||
366 | /* PEM_Task_DeletePowerState,*/ | ||
367 | /* PEM_Task_SetCurrentUser2DPerformanceStateID,*/ | ||
368 | NULL | ||
369 | }; | ||
370 | |||
371 | const pem_event_action disable_user_2d_performance_tasks[] = { | ||
372 | /* PEM_Task_ResetUser2DPerformanceFlag,*/ | ||
373 | /* PEM_Task_UpdateUser2DPerformanceDisableEvents,*/ | ||
374 | NULL | ||
375 | }; | ||
376 | |||
377 | const pem_event_action enable_stutter_mode_tasks[] = { | ||
378 | pem_task_enable_stutter_mode, | ||
379 | NULL | ||
380 | }; | ||
381 | |||
382 | const pem_event_action enable_disable_bapm_tasks[] = { | ||
383 | /*PEM_Task_EnableDisableBAPM,*/ | ||
384 | NULL | ||
385 | }; | ||
386 | |||
387 | const pem_event_action reset_boot_state_tasks[] = { | ||
388 | pem_task_reset_boot_state, | ||
389 | NULL | ||
390 | }; | ||
391 | |||
392 | const pem_event_action create_new_user_performance_state_tasks[] = { | ||
393 | pem_task_create_user_performance_state, | ||
394 | NULL | ||
395 | }; | ||
396 | |||
397 | const pem_event_action initialize_thermal_controller_tasks[] = { | ||
398 | pem_task_initialize_thermal_controller, | ||
399 | NULL | ||
400 | }; | ||
401 | |||
402 | const pem_event_action uninitialize_thermal_controller_tasks[] = { | ||
403 | pem_task_uninitialize_thermal_controller, | ||
404 | NULL | ||
405 | }; | ||
406 | |||
407 | const pem_event_action set_cpu_power_state[] = { | ||
408 | pem_task_set_cpu_power_state, | ||
409 | NULL | ||
410 | }; \ No newline at end of file | ||
diff --git a/drivers/gpu/drm/amd/powerplay/eventmgr/eventsubchains.h b/drivers/gpu/drm/amd/powerplay/eventmgr/eventsubchains.h deleted file mode 100644 index 7714cb927428..000000000000 --- a/drivers/gpu/drm/amd/powerplay/eventmgr/eventsubchains.h +++ /dev/null | |||
@@ -1,100 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2015 Advanced Micro Devices, Inc. | ||
3 | * | ||
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: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
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. | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #ifndef _EVENT_SUB_CHAINS_H_ | ||
25 | #define _EVENT_SUB_CHAINS_H_ | ||
26 | |||
27 | #include "eventmgr.h" | ||
28 | |||
29 | extern const pem_event_action reset_display_phy_access_tasks[]; | ||
30 | extern const pem_event_action broadcast_power_policy_tasks[]; | ||
31 | extern const pem_event_action unregister_interrupt_tasks[]; | ||
32 | extern const pem_event_action disable_GFX_voltage_island_powergating_tasks[]; | ||
33 | extern const pem_event_action disable_GFX_clockgating_tasks[]; | ||
34 | extern const pem_event_action block_adjust_power_state_tasks[]; | ||
35 | extern const pem_event_action unblock_adjust_power_state_tasks[]; | ||
36 | extern const pem_event_action set_performance_state_tasks[]; | ||
37 | extern const pem_event_action get_2D_performance_state_tasks[]; | ||
38 | extern const pem_event_action conditionally_force3D_performance_state_tasks[]; | ||
39 | extern const pem_event_action process_vbios_eventinfo_tasks[]; | ||
40 | extern const pem_event_action enable_dynamic_state_management_tasks[]; | ||
41 | extern const pem_event_action enable_clock_power_gatings_tasks[]; | ||
42 | extern const pem_event_action conditionally_force3D_performance_state_tasks[]; | ||
43 | extern const pem_event_action setup_asic_tasks[]; | ||
44 | extern const pem_event_action power_budget_tasks[]; | ||
45 | extern const pem_event_action system_config_tasks[]; | ||
46 | extern const pem_event_action get_2d_performance_state_tasks[]; | ||
47 | extern const pem_event_action conditionally_force_3d_performance_state_tasks[]; | ||
48 | extern const pem_event_action ungate_all_display_phys_tasks[]; | ||
49 | extern const pem_event_action uninitialize_display_phy_access_tasks[]; | ||
50 | extern const pem_event_action disable_gfx_voltage_island_power_gating_tasks[]; | ||
51 | extern const pem_event_action disable_gfx_clock_gating_tasks[]; | ||
52 | extern const pem_event_action set_boot_state_tasks[]; | ||
53 | extern const pem_event_action adjust_power_state_tasks[]; | ||
54 | extern const pem_event_action disable_dynamic_state_management_tasks[]; | ||
55 | extern const pem_event_action disable_clock_power_gatings_tasks[]; | ||
56 | extern const pem_event_action cleanup_asic_tasks[]; | ||
57 | extern const pem_event_action prepare_for_pnp_stop_tasks[]; | ||
58 | extern const pem_event_action set_power_source_tasks[]; | ||
59 | extern const pem_event_action set_power_saving_state_tasks[]; | ||
60 | extern const pem_event_action enable_disable_fps_tasks[]; | ||
61 | extern const pem_event_action set_nbmcu_state_tasks[]; | ||
62 | extern const pem_event_action reset_hardware_dc_notification_tasks[]; | ||
63 | extern const pem_event_action notify_smu_suspend_tasks[]; | ||
64 | extern const pem_event_action disable_smc_firmware_ctf_tasks[]; | ||
65 | extern const pem_event_action disable_fps_tasks[]; | ||
66 | extern const pem_event_action vari_bright_suspend_tasks[]; | ||
67 | extern const pem_event_action reset_fan_speed_to_default_tasks[]; | ||
68 | extern const pem_event_action power_down_asic_tasks[]; | ||
69 | extern const pem_event_action disable_stutter_mode_tasks[]; | ||
70 | extern const pem_event_action set_connected_standby_tasks[]; | ||
71 | extern const pem_event_action block_hw_access_tasks[]; | ||
72 | extern const pem_event_action unblock_hw_access_tasks[]; | ||
73 | extern const pem_event_action resume_connected_standby_tasks[]; | ||
74 | extern const pem_event_action notify_smu_resume_tasks[]; | ||
75 | extern const pem_event_action reset_display_configCounter_tasks[]; | ||
76 | extern const pem_event_action update_dal_configuration_tasks[]; | ||
77 | extern const pem_event_action vari_bright_resume_tasks[]; | ||
78 | extern const pem_event_action notify_hw_power_source_tasks[]; | ||
79 | extern const pem_event_action process_vbios_event_info_tasks[]; | ||
80 | extern const pem_event_action enable_gfx_clock_gating_tasks[]; | ||
81 | extern const pem_event_action enable_gfx_voltage_island_power_gating_tasks[]; | ||
82 | extern const pem_event_action reset_clock_gating_tasks[]; | ||
83 | extern const pem_event_action notify_smu_vpu_recovery_end_tasks[]; | ||
84 | extern const pem_event_action disable_vpu_cap_tasks[]; | ||
85 | extern const pem_event_action execute_escape_sequence_tasks[]; | ||
86 | extern const pem_event_action notify_power_state_change_tasks[]; | ||
87 | extern const pem_event_action enable_cgpg_tasks[]; | ||
88 | extern const pem_event_action disable_cgpg_tasks[]; | ||
89 | extern const pem_event_action enable_user_2d_performance_tasks[]; | ||
90 | extern const pem_event_action add_user_2d_performance_state_tasks[]; | ||
91 | extern const pem_event_action delete_user_2d_performance_state_tasks[]; | ||
92 | extern const pem_event_action disable_user_2d_performance_tasks[]; | ||
93 | extern const pem_event_action enable_stutter_mode_tasks[]; | ||
94 | extern const pem_event_action enable_disable_bapm_tasks[]; | ||
95 | extern const pem_event_action reset_boot_state_tasks[]; | ||
96 | extern const pem_event_action create_new_user_performance_state_tasks[]; | ||
97 | extern const pem_event_action initialize_thermal_controller_tasks[]; | ||
98 | extern const pem_event_action uninitialize_thermal_controller_tasks[]; | ||
99 | extern const pem_event_action set_cpu_power_state[]; | ||
100 | #endif /* _EVENT_SUB_CHAINS_H_ */ | ||
diff --git a/drivers/gpu/drm/amd/powerplay/eventmgr/eventtasks.c b/drivers/gpu/drm/amd/powerplay/eventmgr/eventtasks.c deleted file mode 100644 index 8c4ebaae1e0c..000000000000 --- a/drivers/gpu/drm/amd/powerplay/eventmgr/eventtasks.c +++ /dev/null | |||
@@ -1,445 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2015 Advanced Micro Devices, Inc. | ||
3 | * | ||
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: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
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. | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #include "eventmgr.h" | ||
25 | #include "eventinit.h" | ||
26 | #include "eventmanagement.h" | ||
27 | #include "eventmanager.h" | ||
28 | #include "hardwaremanager.h" | ||
29 | #include "eventtasks.h" | ||
30 | #include "power_state.h" | ||
31 | #include "hwmgr.h" | ||
32 | #include "amd_powerplay.h" | ||
33 | #include "psm.h" | ||
34 | |||
35 | #define TEMP_RANGE_MIN (90 * 1000) | ||
36 | #define TEMP_RANGE_MAX (120 * 1000) | ||
37 | |||
38 | int pem_task_update_allowed_performance_levels(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
39 | { | ||
40 | |||
41 | if (eventmgr == NULL || eventmgr->hwmgr == NULL) | ||
42 | return -EINVAL; | ||
43 | |||
44 | if (pem_is_hw_access_blocked(eventmgr)) | ||
45 | return 0; | ||
46 | |||
47 | phm_force_dpm_levels(eventmgr->hwmgr, eventmgr->hwmgr->dpm_level); | ||
48 | |||
49 | return 0; | ||
50 | } | ||
51 | |||
52 | /* eventtasks_generic.c */ | ||
53 | int pem_task_adjust_power_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
54 | { | ||
55 | struct pp_hwmgr *hwmgr; | ||
56 | |||
57 | if (pem_is_hw_access_blocked(eventmgr)) | ||
58 | return 0; | ||
59 | |||
60 | hwmgr = eventmgr->hwmgr; | ||
61 | if (event_data->pnew_power_state != NULL) | ||
62 | hwmgr->request_ps = event_data->pnew_power_state; | ||
63 | |||
64 | if (phm_cap_enabled(eventmgr->platform_descriptor->platformCaps, PHM_PlatformCaps_DynamicPatchPowerState)) | ||
65 | psm_adjust_power_state_dynamic(eventmgr, event_data->skip_state_adjust_rules); | ||
66 | else | ||
67 | psm_adjust_power_state_static(eventmgr, event_data->skip_state_adjust_rules); | ||
68 | |||
69 | return 0; | ||
70 | } | ||
71 | |||
72 | int pem_task_power_down_asic(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
73 | { | ||
74 | return phm_power_down_asic(eventmgr->hwmgr); | ||
75 | } | ||
76 | |||
77 | int pem_task_set_boot_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
78 | { | ||
79 | if (pem_is_event_data_valid(event_data->valid_fields, PEM_EventDataValid_RequestedStateID)) | ||
80 | return psm_set_states(eventmgr, &(event_data->requested_state_id)); | ||
81 | |||
82 | return 0; | ||
83 | } | ||
84 | |||
85 | int pem_task_reset_boot_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
86 | { | ||
87 | /* TODO */ | ||
88 | return 0; | ||
89 | } | ||
90 | |||
91 | int pem_task_update_new_power_state_clocks(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
92 | { | ||
93 | /* TODO */ | ||
94 | return 0; | ||
95 | } | ||
96 | |||
97 | int pem_task_system_shutdown(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
98 | { | ||
99 | /* TODO */ | ||
100 | return 0; | ||
101 | } | ||
102 | |||
103 | int pem_task_register_interrupts(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
104 | { | ||
105 | /* TODO */ | ||
106 | return 0; | ||
107 | } | ||
108 | |||
109 | int pem_task_unregister_interrupts(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
110 | { | ||
111 | return pem_unregister_interrupts(eventmgr); | ||
112 | } | ||
113 | |||
114 | int pem_task_get_boot_state_id(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
115 | { | ||
116 | int result; | ||
117 | |||
118 | result = psm_get_state_by_classification(eventmgr, | ||
119 | PP_StateClassificationFlag_Boot, | ||
120 | &(event_data->requested_state_id) | ||
121 | ); | ||
122 | |||
123 | if (0 == result) | ||
124 | pem_set_event_data_valid(event_data->valid_fields, PEM_EventDataValid_RequestedStateID); | ||
125 | else | ||
126 | pem_unset_event_data_valid(event_data->valid_fields, PEM_EventDataValid_RequestedStateID); | ||
127 | |||
128 | return result; | ||
129 | } | ||
130 | |||
131 | int pem_task_enable_dynamic_state_management(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
132 | { | ||
133 | return phm_enable_dynamic_state_management(eventmgr->hwmgr); | ||
134 | } | ||
135 | |||
136 | int pem_task_disable_dynamic_state_management(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
137 | { | ||
138 | return phm_disable_dynamic_state_management(eventmgr->hwmgr); | ||
139 | } | ||
140 | |||
141 | int pem_task_enable_clock_power_gatings_tasks(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
142 | { | ||
143 | return phm_enable_clock_power_gatings(eventmgr->hwmgr); | ||
144 | } | ||
145 | |||
146 | int pem_task_powerdown_uvd_tasks(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
147 | { | ||
148 | return phm_powerdown_uvd(eventmgr->hwmgr); | ||
149 | } | ||
150 | |||
151 | int pem_task_powerdown_vce_tasks(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
152 | { | ||
153 | phm_powergate_uvd(eventmgr->hwmgr, true); | ||
154 | phm_powergate_vce(eventmgr->hwmgr, true); | ||
155 | return 0; | ||
156 | } | ||
157 | |||
158 | int pem_task_disable_clock_power_gatings_tasks(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
159 | { | ||
160 | phm_disable_clock_power_gatings(eventmgr->hwmgr); | ||
161 | return 0; | ||
162 | } | ||
163 | |||
164 | int pem_task_start_asic_block_usage(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
165 | { | ||
166 | /* TODO */ | ||
167 | return 0; | ||
168 | } | ||
169 | |||
170 | int pem_task_stop_asic_block_usage(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
171 | { | ||
172 | /* TODO */ | ||
173 | return 0; | ||
174 | } | ||
175 | |||
176 | int pem_task_disable_smc_firmware_ctf(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
177 | { | ||
178 | return phm_disable_smc_firmware_ctf(eventmgr->hwmgr); | ||
179 | } | ||
180 | |||
181 | int pem_task_setup_asic(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
182 | { | ||
183 | return phm_setup_asic(eventmgr->hwmgr); | ||
184 | } | ||
185 | |||
186 | int pem_task_cleanup_asic(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
187 | { | ||
188 | /* TODO */ | ||
189 | return 0; | ||
190 | } | ||
191 | |||
192 | int pem_task_store_dal_configuration(struct pp_eventmgr *eventmgr, const struct amd_display_configuration *display_config) | ||
193 | { | ||
194 | /* TODO */ | ||
195 | return 0; | ||
196 | /*phm_store_dal_configuration_data(eventmgr->hwmgr, display_config) */ | ||
197 | } | ||
198 | |||
199 | int pem_task_notify_hw_mgr_display_configuration_change(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
200 | { | ||
201 | if (pem_is_hw_access_blocked(eventmgr)) | ||
202 | return 0; | ||
203 | |||
204 | return phm_display_configuration_changed(eventmgr->hwmgr); | ||
205 | } | ||
206 | |||
207 | int pem_task_notify_hw_mgr_pre_display_configuration_change(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
208 | { | ||
209 | return 0; | ||
210 | } | ||
211 | |||
212 | int pem_task_notify_smc_display_config_after_power_state_adjustment(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
213 | { | ||
214 | if (pem_is_hw_access_blocked(eventmgr)) | ||
215 | return 0; | ||
216 | |||
217 | return phm_notify_smc_display_config_after_ps_adjustment(eventmgr->hwmgr); | ||
218 | } | ||
219 | |||
220 | int pem_task_block_adjust_power_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
221 | { | ||
222 | eventmgr->block_adjust_power_state = true; | ||
223 | /* to do PHM_ResetIPSCounter(pEventMgr->pHwMgr);*/ | ||
224 | return 0; | ||
225 | } | ||
226 | |||
227 | int pem_task_unblock_adjust_power_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
228 | { | ||
229 | eventmgr->block_adjust_power_state = false; | ||
230 | return 0; | ||
231 | } | ||
232 | |||
233 | int pem_task_notify_power_state_change(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
234 | { | ||
235 | /* TODO */ | ||
236 | return 0; | ||
237 | } | ||
238 | |||
239 | int pem_task_block_hw_access(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
240 | { | ||
241 | /* TODO */ | ||
242 | return 0; | ||
243 | } | ||
244 | |||
245 | int pem_task_un_block_hw_access(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
246 | { | ||
247 | /* TODO */ | ||
248 | return 0; | ||
249 | } | ||
250 | |||
251 | int pem_task_reset_display_phys_access(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
252 | { | ||
253 | /* TODO */ | ||
254 | return 0; | ||
255 | } | ||
256 | |||
257 | int pem_task_set_cpu_power_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
258 | { | ||
259 | return phm_set_cpu_power_state(eventmgr->hwmgr); | ||
260 | } | ||
261 | |||
262 | /*powersaving*/ | ||
263 | |||
264 | int pem_task_set_power_source(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
265 | { | ||
266 | /* TODO */ | ||
267 | return 0; | ||
268 | } | ||
269 | |||
270 | int pem_task_notify_hw_of_power_source(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
271 | { | ||
272 | /* TODO */ | ||
273 | return 0; | ||
274 | } | ||
275 | |||
276 | int pem_task_get_power_saving_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
277 | { | ||
278 | /* TODO */ | ||
279 | return 0; | ||
280 | } | ||
281 | |||
282 | int pem_task_reset_power_saving_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
283 | { | ||
284 | /* TODO */ | ||
285 | return 0; | ||
286 | } | ||
287 | |||
288 | int pem_task_set_power_saving_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
289 | { | ||
290 | /* TODO */ | ||
291 | return 0; | ||
292 | } | ||
293 | |||
294 | int pem_task_set_screen_state_on(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
295 | { | ||
296 | /* TODO */ | ||
297 | return 0; | ||
298 | } | ||
299 | |||
300 | int pem_task_set_screen_state_off(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
301 | { | ||
302 | /* TODO */ | ||
303 | return 0; | ||
304 | } | ||
305 | |||
306 | int pem_task_enable_voltage_island_power_gating(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
307 | { | ||
308 | /* TODO */ | ||
309 | return 0; | ||
310 | } | ||
311 | |||
312 | int pem_task_disable_voltage_island_power_gating(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
313 | { | ||
314 | /* TODO */ | ||
315 | return 0; | ||
316 | } | ||
317 | |||
318 | int pem_task_enable_cgpg(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
319 | { | ||
320 | /* TODO */ | ||
321 | return 0; | ||
322 | } | ||
323 | |||
324 | int pem_task_disable_cgpg(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
325 | { | ||
326 | /* TODO */ | ||
327 | return 0; | ||
328 | } | ||
329 | |||
330 | int pem_task_enable_clock_power_gating(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
331 | { | ||
332 | /* TODO */ | ||
333 | return 0; | ||
334 | } | ||
335 | |||
336 | |||
337 | int pem_task_enable_gfx_clock_gating(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
338 | { | ||
339 | /* TODO */ | ||
340 | return 0; | ||
341 | } | ||
342 | |||
343 | int pem_task_disable_gfx_clock_gating(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
344 | { | ||
345 | /* TODO */ | ||
346 | return 0; | ||
347 | } | ||
348 | |||
349 | |||
350 | /* performance */ | ||
351 | int pem_task_set_performance_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
352 | { | ||
353 | if (pem_is_event_data_valid(event_data->valid_fields, PEM_EventDataValid_RequestedStateID)) | ||
354 | return psm_set_states(eventmgr, &(event_data->requested_state_id)); | ||
355 | |||
356 | return 0; | ||
357 | } | ||
358 | |||
359 | int pem_task_conditionally_force_3d_performance_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
360 | { | ||
361 | /* TODO */ | ||
362 | return 0; | ||
363 | } | ||
364 | |||
365 | int pem_task_enable_stutter_mode(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
366 | { | ||
367 | /* TODO */ | ||
368 | return 0; | ||
369 | } | ||
370 | |||
371 | int pem_task_get_2D_performance_state_id(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
372 | { | ||
373 | int result; | ||
374 | |||
375 | if (eventmgr->features[PP_Feature_PowerPlay].supported && | ||
376 | !(eventmgr->features[PP_Feature_PowerPlay].enabled)) | ||
377 | result = psm_get_state_by_classification(eventmgr, | ||
378 | PP_StateClassificationFlag_Boot, | ||
379 | &(event_data->requested_state_id)); | ||
380 | else if (eventmgr->features[PP_Feature_User2DPerformance].enabled) | ||
381 | result = psm_get_state_by_classification(eventmgr, | ||
382 | PP_StateClassificationFlag_User2DPerformance, | ||
383 | &(event_data->requested_state_id)); | ||
384 | else | ||
385 | result = psm_get_ui_state(eventmgr, PP_StateUILabel_Performance, | ||
386 | &(event_data->requested_state_id)); | ||
387 | |||
388 | if (0 == result) | ||
389 | pem_set_event_data_valid(event_data->valid_fields, PEM_EventDataValid_RequestedStateID); | ||
390 | else | ||
391 | pem_unset_event_data_valid(event_data->valid_fields, PEM_EventDataValid_RequestedStateID); | ||
392 | |||
393 | return result; | ||
394 | } | ||
395 | |||
396 | int pem_task_create_user_performance_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
397 | { | ||
398 | struct pp_power_state *state; | ||
399 | int table_entries; | ||
400 | struct pp_hwmgr *hwmgr = eventmgr->hwmgr; | ||
401 | int i; | ||
402 | |||
403 | table_entries = hwmgr->num_ps; | ||
404 | state = hwmgr->ps; | ||
405 | |||
406 | restart_search: | ||
407 | for (i = 0; i < table_entries; i++) { | ||
408 | if (state->classification.ui_label & event_data->requested_ui_label) { | ||
409 | event_data->pnew_power_state = state; | ||
410 | return 0; | ||
411 | } | ||
412 | state = (struct pp_power_state *)((unsigned long)state + hwmgr->ps_size); | ||
413 | } | ||
414 | |||
415 | switch (event_data->requested_ui_label) { | ||
416 | case PP_StateUILabel_Battery: | ||
417 | case PP_StateUILabel_Balanced: | ||
418 | event_data->requested_ui_label = PP_StateUILabel_Performance; | ||
419 | goto restart_search; | ||
420 | default: | ||
421 | break; | ||
422 | } | ||
423 | return -1; | ||
424 | } | ||
425 | |||
426 | int pem_task_initialize_thermal_controller(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
427 | { | ||
428 | struct PP_TemperatureRange range; | ||
429 | |||
430 | range.max = TEMP_RANGE_MAX; | ||
431 | range.min = TEMP_RANGE_MIN; | ||
432 | |||
433 | if (eventmgr == NULL || eventmgr->platform_descriptor == NULL) | ||
434 | return -EINVAL; | ||
435 | |||
436 | if (phm_cap_enabled(eventmgr->platform_descriptor->platformCaps, PHM_PlatformCaps_ThermalController)) | ||
437 | return phm_start_thermal_controller(eventmgr->hwmgr, &range); | ||
438 | |||
439 | return 0; | ||
440 | } | ||
441 | |||
442 | int pem_task_uninitialize_thermal_controller(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data) | ||
443 | { | ||
444 | return phm_stop_thermal_controller(eventmgr->hwmgr); | ||
445 | } | ||
diff --git a/drivers/gpu/drm/amd/powerplay/eventmgr/eventtasks.h b/drivers/gpu/drm/amd/powerplay/eventmgr/eventtasks.h deleted file mode 100644 index 37e7ca5a58e0..000000000000 --- a/drivers/gpu/drm/amd/powerplay/eventmgr/eventtasks.h +++ /dev/null | |||
@@ -1,89 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2015 Advanced Micro Devices, Inc. | ||
3 | * | ||
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: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
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. | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #ifndef _EVENT_TASKS_H_ | ||
25 | #define _EVENT_TASKS_H_ | ||
26 | #include "eventmgr.h" | ||
27 | |||
28 | struct amd_display_configuration; | ||
29 | |||
30 | /* eventtasks_generic.c */ | ||
31 | int pem_task_adjust_power_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
32 | int pem_task_power_down_asic(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
33 | int pem_task_get_boot_state_id(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
34 | int pem_task_set_boot_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
35 | int pem_task_reset_boot_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
36 | int pem_task_update_new_power_state_clocks(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
37 | int pem_task_system_shutdown(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
38 | int pem_task_register_interrupts(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
39 | int pem_task_unregister_interrupts(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
40 | int pem_task_enable_dynamic_state_management(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
41 | int pem_task_disable_dynamic_state_management(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
42 | int pem_task_enable_clock_power_gatings_tasks(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
43 | int pem_task_powerdown_uvd_tasks(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
44 | int pem_task_powerdown_vce_tasks(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
45 | int pem_task_disable_clock_power_gatings_tasks(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
46 | int pem_task_start_asic_block_usage(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
47 | int pem_task_stop_asic_block_usage(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
48 | int pem_task_setup_asic(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
49 | int pem_task_cleanup_asic(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
50 | int pem_task_store_dal_configuration (struct pp_eventmgr *eventmgr, const struct amd_display_configuration *display_config); | ||
51 | int pem_task_notify_hw_mgr_display_configuration_change(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
52 | int pem_task_notify_hw_mgr_pre_display_configuration_change(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
53 | int pem_task_block_adjust_power_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
54 | int pem_task_unblock_adjust_power_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
55 | int pem_task_notify_power_state_change(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
56 | int pem_task_block_hw_access(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
57 | int pem_task_un_block_hw_access(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
58 | int pem_task_reset_display_phys_access(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
59 | int pem_task_set_cpu_power_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
60 | int pem_task_notify_smc_display_config_after_power_state_adjustment(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
61 | /*powersaving*/ | ||
62 | |||
63 | int pem_task_set_power_source(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
64 | int pem_task_notify_hw_of_power_source(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
65 | int pem_task_get_power_saving_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
66 | int pem_task_reset_power_saving_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
67 | int pem_task_set_power_saving_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
68 | int pem_task_set_screen_state_on(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
69 | int pem_task_set_screen_state_off(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
70 | int pem_task_enable_voltage_island_power_gating(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
71 | int pem_task_disable_voltage_island_power_gating(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
72 | int pem_task_enable_cgpg(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
73 | int pem_task_disable_cgpg(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
74 | int pem_task_enable_gfx_clock_gating(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
75 | int pem_task_disable_gfx_clock_gating(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
76 | int pem_task_enable_stutter_mode(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
77 | |||
78 | /* performance */ | ||
79 | int pem_task_set_performance_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
80 | int pem_task_conditionally_force_3d_performance_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
81 | int pem_task_get_2D_performance_state_id(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
82 | int pem_task_create_user_performance_state(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
83 | int pem_task_update_allowed_performance_levels(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
84 | /*thermal */ | ||
85 | int pem_task_initialize_thermal_controller(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
86 | int pem_task_uninitialize_thermal_controller(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
87 | int pem_task_disable_smc_firmware_ctf(struct pp_eventmgr *eventmgr, struct pem_event_data *event_data); | ||
88 | |||
89 | #endif /* _EVENT_TASKS_H_ */ | ||
diff --git a/drivers/gpu/drm/amd/powerplay/eventmgr/psm.c b/drivers/gpu/drm/amd/powerplay/eventmgr/psm.c deleted file mode 100644 index 489908887e9c..000000000000 --- a/drivers/gpu/drm/amd/powerplay/eventmgr/psm.c +++ /dev/null | |||
@@ -1,119 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2015 Advanced Micro Devices, Inc. | ||
3 | * | ||
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: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
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. | ||
21 | * | ||
22 | */ | ||
23 | #include "psm.h" | ||
24 | |||
25 | int psm_get_ui_state(struct pp_eventmgr *eventmgr, enum PP_StateUILabel ui_label, unsigned long *state_id) | ||
26 | { | ||
27 | struct pp_power_state *state; | ||
28 | int table_entries; | ||
29 | struct pp_hwmgr *hwmgr = eventmgr->hwmgr; | ||
30 | int i; | ||
31 | |||
32 | table_entries = hwmgr->num_ps; | ||
33 | state = hwmgr->ps; | ||
34 | |||
35 | for (i = 0; i < table_entries; i++) { | ||
36 | if (state->classification.ui_label & ui_label) { | ||
37 | *state_id = state->id; | ||
38 | return 0; | ||
39 | } | ||
40 | state = (struct pp_power_state *)((unsigned long)state + hwmgr->ps_size); | ||
41 | } | ||
42 | return -1; | ||
43 | } | ||
44 | |||
45 | int psm_get_state_by_classification(struct pp_eventmgr *eventmgr, enum PP_StateClassificationFlag flag, unsigned long *state_id) | ||
46 | { | ||
47 | struct pp_power_state *state; | ||
48 | int table_entries; | ||
49 | struct pp_hwmgr *hwmgr = eventmgr->hwmgr; | ||
50 | int i; | ||
51 | |||
52 | table_entries = hwmgr->num_ps; | ||
53 | state = hwmgr->ps; | ||
54 | |||
55 | for (i = 0; i < table_entries; i++) { | ||
56 | if (state->classification.flags & flag) { | ||
57 | *state_id = state->id; | ||
58 | return 0; | ||
59 | } | ||
60 | state = (struct pp_power_state *)((unsigned long)state + hwmgr->ps_size); | ||
61 | } | ||
62 | return -1; | ||
63 | } | ||
64 | |||
65 | int psm_set_states(struct pp_eventmgr *eventmgr, unsigned long *state_id) | ||
66 | { | ||
67 | struct pp_power_state *state; | ||
68 | int table_entries; | ||
69 | struct pp_hwmgr *hwmgr = eventmgr->hwmgr; | ||
70 | int i; | ||
71 | |||
72 | table_entries = hwmgr->num_ps; | ||
73 | |||
74 | state = hwmgr->ps; | ||
75 | |||
76 | for (i = 0; i < table_entries; i++) { | ||
77 | if (state->id == *state_id) { | ||
78 | memcpy(hwmgr->request_ps, state, hwmgr->ps_size); | ||
79 | return 0; | ||
80 | } | ||
81 | state = (struct pp_power_state *)((unsigned long)state + hwmgr->ps_size); | ||
82 | } | ||
83 | return -1; | ||
84 | } | ||
85 | |||
86 | int psm_adjust_power_state_dynamic(struct pp_eventmgr *eventmgr, bool skip) | ||
87 | { | ||
88 | |||
89 | struct pp_power_state *pcurrent; | ||
90 | struct pp_power_state *requested; | ||
91 | struct pp_hwmgr *hwmgr; | ||
92 | bool equal; | ||
93 | |||
94 | if (skip) | ||
95 | return 0; | ||
96 | |||
97 | hwmgr = eventmgr->hwmgr; | ||
98 | pcurrent = hwmgr->current_ps; | ||
99 | requested = hwmgr->request_ps; | ||
100 | |||
101 | if (requested == NULL) | ||
102 | return 0; | ||
103 | |||
104 | phm_apply_state_adjust_rules(hwmgr, requested, pcurrent); | ||
105 | |||
106 | if (pcurrent == NULL || (0 != phm_check_states_equal(hwmgr, &pcurrent->hardware, &requested->hardware, &equal))) | ||
107 | equal = false; | ||
108 | |||
109 | if (!equal || phm_check_smc_update_required_for_display_configuration(hwmgr)) { | ||
110 | phm_set_power_state(hwmgr, &pcurrent->hardware, &requested->hardware); | ||
111 | memcpy(hwmgr->current_ps, hwmgr->request_ps, hwmgr->ps_size); | ||
112 | } | ||
113 | return 0; | ||
114 | } | ||
115 | |||
116 | int psm_adjust_power_state_static(struct pp_eventmgr *eventmgr, bool skip) | ||
117 | { | ||
118 | return 0; | ||
119 | } | ||
diff --git a/drivers/gpu/drm/amd/powerplay/eventmgr/psm.h b/drivers/gpu/drm/amd/powerplay/eventmgr/psm.h deleted file mode 100644 index fbdff3e02aa3..000000000000 --- a/drivers/gpu/drm/amd/powerplay/eventmgr/psm.h +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2015 Advanced Micro Devices, Inc. | ||
3 | * | ||
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: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
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. | ||
21 | * | ||
22 | */ | ||
23 | #include "eventmgr.h" | ||
24 | #include "eventinit.h" | ||
25 | #include "eventmanagement.h" | ||
26 | #include "eventmanager.h" | ||
27 | #include "power_state.h" | ||
28 | #include "hardwaremanager.h" | ||
29 | |||
30 | int psm_get_ui_state(struct pp_eventmgr *eventmgr, enum PP_StateUILabel ui_label, unsigned long *state_id); | ||
31 | |||
32 | int psm_get_state_by_classification(struct pp_eventmgr *eventmgr, enum PP_StateClassificationFlag flag, unsigned long *state_id); | ||
33 | |||
34 | int psm_set_states(struct pp_eventmgr *eventmgr, unsigned long *state_id); | ||
35 | |||
36 | int psm_adjust_power_state_dynamic(struct pp_eventmgr *eventmgr, bool skip); | ||
37 | |||
38 | int psm_adjust_power_state_static(struct pp_eventmgr *eventmgr, bool skip); | ||
diff --git a/drivers/gpu/drm/amd/powerplay/inc/eventmanager.h b/drivers/gpu/drm/amd/powerplay/inc/eventmanager.h deleted file mode 100644 index b9d84de8a44d..000000000000 --- a/drivers/gpu/drm/amd/powerplay/inc/eventmanager.h +++ /dev/null | |||
@@ -1,109 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2015 Advanced Micro Devices, Inc. | ||
3 | * | ||
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: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
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. | ||
21 | * | ||
22 | */ | ||
23 | #ifndef _EVENT_MANAGER_H_ | ||
24 | #define _EVENT_MANAGER_H_ | ||
25 | |||
26 | #include "power_state.h" | ||
27 | #include "pp_power_source.h" | ||
28 | #include "hardwaremanager.h" | ||
29 | #include "pp_asicblocks.h" | ||
30 | |||
31 | struct pp_eventmgr; | ||
32 | enum amd_pp_event; | ||
33 | |||
34 | enum PEM_EventDataValid { | ||
35 | PEM_EventDataValid_RequestedStateID = 0, | ||
36 | PEM_EventDataValid_RequestedUILabel, | ||
37 | PEM_EventDataValid_NewPowerState, | ||
38 | PEM_EventDataValid_RequestedPowerSource, | ||
39 | PEM_EventDataValid_RequestedClocks, | ||
40 | PEM_EventDataValid_CurrentTemperature, | ||
41 | PEM_EventDataValid_AsicBlocks, | ||
42 | PEM_EventDataValid_ODParameters, | ||
43 | PEM_EventDataValid_PXAdapterPrefs, | ||
44 | PEM_EventDataValid_PXUserPrefs, | ||
45 | PEM_EventDataValid_PXSwitchReason, | ||
46 | PEM_EventDataValid_PXSwitchPhase, | ||
47 | PEM_EventDataValid_HdVideo, | ||
48 | PEM_EventDataValid_BacklightLevel, | ||
49 | PEM_EventDatavalid_VariBrightParams, | ||
50 | PEM_EventDataValid_VariBrightLevel, | ||
51 | PEM_EventDataValid_VariBrightImmediateChange, | ||
52 | PEM_EventDataValid_PercentWhite, | ||
53 | PEM_EventDataValid_SdVideo, | ||
54 | PEM_EventDataValid_HTLinkChangeReason, | ||
55 | PEM_EventDataValid_HWBlocks, | ||
56 | PEM_EventDataValid_RequestedThermalState, | ||
57 | PEM_EventDataValid_MvcVideo, | ||
58 | PEM_EventDataValid_Max | ||
59 | }; | ||
60 | |||
61 | typedef enum PEM_EventDataValid PEM_EventDataValid; | ||
62 | |||
63 | /* Number of bits in ULONG variable */ | ||
64 | #define PEM_MAX_NUM_EVENTDATAVALID_BITS_PER_FIELD (sizeof(unsigned long)*8) | ||
65 | |||
66 | /* Number of ULONG entries used by event data valid bits */ | ||
67 | #define PEM_MAX_NUM_EVENTDATAVALID_ULONG_ENTRIES \ | ||
68 | ((PEM_EventDataValid_Max + PEM_MAX_NUM_EVENTDATAVALID_BITS_PER_FIELD - 1) / \ | ||
69 | PEM_MAX_NUM_EVENTDATAVALID_BITS_PER_FIELD) | ||
70 | |||
71 | static inline void pem_set_event_data_valid(unsigned long *fields, PEM_EventDataValid valid_field) | ||
72 | { | ||
73 | fields[valid_field / PEM_MAX_NUM_EVENTDATAVALID_BITS_PER_FIELD] |= | ||
74 | (1UL << (valid_field % PEM_MAX_NUM_EVENTDATAVALID_BITS_PER_FIELD)); | ||
75 | } | ||
76 | |||
77 | static inline void pem_unset_event_data_valid(unsigned long *fields, PEM_EventDataValid valid_field) | ||
78 | { | ||
79 | fields[valid_field / PEM_MAX_NUM_EVENTDATAVALID_BITS_PER_FIELD] &= | ||
80 | ~(1UL << (valid_field % PEM_MAX_NUM_EVENTDATAVALID_BITS_PER_FIELD)); | ||
81 | } | ||
82 | |||
83 | static inline unsigned long pem_is_event_data_valid(const unsigned long *fields, PEM_EventDataValid valid_field) | ||
84 | { | ||
85 | return fields[valid_field / PEM_MAX_NUM_EVENTDATAVALID_BITS_PER_FIELD] & | ||
86 | (1UL << (valid_field % PEM_MAX_NUM_EVENTDATAVALID_BITS_PER_FIELD)); | ||
87 | } | ||
88 | |||
89 | struct pem_event_data { | ||
90 | unsigned long valid_fields[100]; | ||
91 | unsigned long requested_state_id; | ||
92 | enum PP_StateUILabel requested_ui_label; | ||
93 | struct pp_power_state *pnew_power_state; | ||
94 | enum pp_power_source requested_power_source; | ||
95 | struct PP_Clocks requested_clocks; | ||
96 | bool skip_state_adjust_rules; | ||
97 | struct phm_asic_blocks asic_blocks; | ||
98 | /* to doPP_ThermalState requestedThermalState; | ||
99 | enum ThermalStateRequestSrc requestThermalStateSrc; | ||
100 | PP_Temperature currentTemperature;*/ | ||
101 | |||
102 | }; | ||
103 | |||
104 | int pem_handle_event(struct pp_eventmgr *eventmgr, enum amd_pp_event event, | ||
105 | struct pem_event_data *event_data); | ||
106 | |||
107 | bool pem_is_hw_access_blocked(struct pp_eventmgr *eventmgr); | ||
108 | |||
109 | #endif /* _EVENT_MANAGER_H_ */ | ||
diff --git a/drivers/gpu/drm/amd/powerplay/inc/eventmgr.h b/drivers/gpu/drm/amd/powerplay/inc/eventmgr.h deleted file mode 100644 index 7bd8a7e57080..000000000000 --- a/drivers/gpu/drm/amd/powerplay/inc/eventmgr.h +++ /dev/null | |||
@@ -1,124 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2015 Advanced Micro Devices, Inc. | ||
3 | * | ||
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: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
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. | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #ifndef _EVENTMGR_H_ | ||
25 | #define _EVENTMGR_H_ | ||
26 | |||
27 | #include <linux/mutex.h> | ||
28 | #include "pp_instance.h" | ||
29 | #include "hardwaremanager.h" | ||
30 | #include "eventmanager.h" | ||
31 | #include "pp_feature.h" | ||
32 | #include "pp_power_source.h" | ||
33 | #include "power_state.h" | ||
34 | |||
35 | typedef int (*pem_event_action)(struct pp_eventmgr *eventmgr, | ||
36 | struct pem_event_data *event_data); | ||
37 | |||
38 | struct action_chain { | ||
39 | const char *description; /* action chain description for debugging purpose */ | ||
40 | const pem_event_action * const *action_chain; /* pointer to chain of event actions */ | ||
41 | }; | ||
42 | |||
43 | struct pem_power_source_ui_state_info { | ||
44 | enum PP_StateUILabel current_ui_label; | ||
45 | enum PP_StateUILabel default_ui_lable; | ||
46 | unsigned long configurable_ui_mapping; | ||
47 | }; | ||
48 | |||
49 | struct pp_clock_range { | ||
50 | uint32_t min_sclk_khz; | ||
51 | uint32_t max_sclk_khz; | ||
52 | |||
53 | uint32_t min_mclk_khz; | ||
54 | uint32_t max_mclk_khz; | ||
55 | |||
56 | uint32_t min_vclk_khz; | ||
57 | uint32_t max_vclk_khz; | ||
58 | |||
59 | uint32_t min_dclk_khz; | ||
60 | uint32_t max_dclk_khz; | ||
61 | |||
62 | uint32_t min_aclk_khz; | ||
63 | uint32_t max_aclk_khz; | ||
64 | |||
65 | uint32_t min_eclk_khz; | ||
66 | uint32_t max_eclk_khz; | ||
67 | }; | ||
68 | |||
69 | enum pp_state { | ||
70 | UNINITIALIZED, | ||
71 | INACTIVE, | ||
72 | ACTIVE | ||
73 | }; | ||
74 | |||
75 | enum pp_ring_index { | ||
76 | PP_RING_TYPE_GFX_INDEX = 0, | ||
77 | PP_RING_TYPE_DMA_INDEX, | ||
78 | PP_RING_TYPE_DMA1_INDEX, | ||
79 | PP_RING_TYPE_UVD_INDEX, | ||
80 | PP_RING_TYPE_VCE0_INDEX, | ||
81 | PP_RING_TYPE_VCE1_INDEX, | ||
82 | PP_RING_TYPE_CP1_INDEX, | ||
83 | PP_RING_TYPE_CP2_INDEX, | ||
84 | PP_NUM_RINGS, | ||
85 | }; | ||
86 | |||
87 | struct pp_request { | ||
88 | uint32_t flags; | ||
89 | uint32_t sclk; | ||
90 | uint32_t sclk_throttle; | ||
91 | uint32_t mclk; | ||
92 | uint32_t vclk; | ||
93 | uint32_t dclk; | ||
94 | uint32_t eclk; | ||
95 | uint32_t aclk; | ||
96 | uint32_t iclk; | ||
97 | uint32_t vp8clk; | ||
98 | uint32_t rsv[32]; | ||
99 | }; | ||
100 | |||
101 | struct pp_eventmgr { | ||
102 | struct pp_hwmgr *hwmgr; | ||
103 | struct pp_smumgr *smumgr; | ||
104 | |||
105 | struct pp_feature_info features[PP_Feature_Max]; | ||
106 | const struct action_chain *event_chain[AMD_PP_EVENT_MAX]; | ||
107 | struct phm_platform_descriptor *platform_descriptor; | ||
108 | struct pp_clock_range clock_range; | ||
109 | enum pp_power_source current_power_source; | ||
110 | struct pem_power_source_ui_state_info ui_state_info[PP_PowerSource_Max]; | ||
111 | enum pp_state states[PP_NUM_RINGS]; | ||
112 | struct pp_request hi_req; | ||
113 | struct list_head context_list; | ||
114 | struct mutex lock; | ||
115 | bool block_adjust_power_state; | ||
116 | bool enable_cg; | ||
117 | bool enable_gfx_cgpg; | ||
118 | int (*pp_eventmgr_init)(struct pp_eventmgr *eventmgr); | ||
119 | void (*pp_eventmgr_fini)(struct pp_eventmgr *eventmgr); | ||
120 | }; | ||
121 | |||
122 | int eventmgr_early_init(struct pp_instance *handle); | ||
123 | |||
124 | #endif /* _EVENTMGR_H_ */ | ||