aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/include/amd_shared.h
diff options
context:
space:
mode:
authorRex Zhu <Rex.Zhu@amd.com>2017-09-06 03:27:59 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-09-18 23:30:34 -0400
commitcfa289fd4986c504b0396cce167802dfcf4943d0 (patch)
tree8c616086e99e4a5b777a22d8f6e95b22bd4d1a9d /drivers/gpu/drm/amd/include/amd_shared.h
parent698f88e697cc8852558d120fdecfdb38c18c2ff7 (diff)
drm/amdgpu: rename amdgpu_dpm_funcs to amd_pm_funcs
renamed amdgpu_dpm_funcs and moved to amd_shared.h so can shared with powerplay. Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/include/amd_shared.h')
-rw-r--r--drivers/gpu/drm/amd/include/amd_shared.h51
1 files changed, 51 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/include/amd_shared.h b/drivers/gpu/drm/amd/include/amd_shared.h
index 70e8c20acb2f..140ff6438390 100644
--- a/drivers/gpu/drm/amd/include/amd_shared.h
+++ b/drivers/gpu/drm/amd/include/amd_shared.h
@@ -25,6 +25,8 @@
25 25
26#define AMD_MAX_USEC_TIMEOUT 200000 /* 200 ms */ 26#define AMD_MAX_USEC_TIMEOUT 200000 /* 200 ms */
27 27
28struct seq_file;
29
28/* 30/*
29 * Supported ASIC types 31 * Supported ASIC types
30 */ 32 */
@@ -144,6 +146,12 @@ enum amd_fan_ctrl_mode {
144 AMD_FAN_CTRL_AUTO = 2, 146 AMD_FAN_CTRL_AUTO = 2,
145}; 147};
146 148
149enum pp_clock_type {
150 PP_SCLK,
151 PP_MCLK,
152 PP_PCIE,
153};
154
147/* CG flags */ 155/* CG flags */
148#define AMD_CG_SUPPORT_GFX_MGCG (1 << 0) 156#define AMD_CG_SUPPORT_GFX_MGCG (1 << 0)
149#define AMD_CG_SUPPORT_GFX_MGLS (1 << 1) 157#define AMD_CG_SUPPORT_GFX_MGLS (1 << 1)
@@ -249,4 +257,47 @@ struct amd_ip_funcs {
249 void (*get_clockgating_state)(void *handle, u32 *flags); 257 void (*get_clockgating_state)(void *handle, u32 *flags);
250}; 258};
251 259
260struct amd_pm_funcs {
261 int (*get_temperature)(void *handle);
262 int (*pre_set_power_state)(void *handle);
263 int (*set_power_state)(void *handle);
264 void (*post_set_power_state)(void *handle);
265 void (*display_configuration_changed)(void *handle);
266 u32 (*get_sclk)(void *handle, bool low);
267 u32 (*get_mclk)(void *handle, bool low);
268 void (*print_power_state)(void *handle, void *ps);
269 void (*debugfs_print_current_performance_level)(void *handle, struct seq_file *m);
270 int (*force_performance_level)(void *handle, enum amd_dpm_forced_level level);
271 bool (*vblank_too_short)(void *handle);
272 void (*powergate_uvd)(void *handle, bool gate);
273 void (*powergate_vce)(void *handle, bool gate);
274 void (*enable_bapm)(void *handle, bool enable);
275 void (*set_fan_control_mode)(void *handle, u32 mode);
276 u32 (*get_fan_control_mode)(void *handle);
277 int (*set_fan_speed_percent)(void *handle, u32 speed);
278 int (*get_fan_speed_percent)(void *handle, u32 *speed);
279 int (*force_clock_level)(void *handle, enum pp_clock_type type, uint32_t mask);
280 int (*print_clock_levels)(void *handle, enum pp_clock_type type, char *buf);
281 int (*get_sclk_od)(void *handle);
282 int (*set_sclk_od)(void *handle, uint32_t value);
283 int (*get_mclk_od)(void *handle);
284 int (*set_mclk_od)(void *handle, uint32_t value);
285 int (*check_state_equal)(void *handle,
286 void *cps,
287 void *rps,
288 bool *equal);
289 int (*read_sensor)(void *handle, int idx, void *value,
290 int *size);
291
292 struct amd_vce_state* (*get_vce_clock_state)(void *handle, u32 idx);
293 int (*reset_power_profile_state)(void *handle,
294 struct amd_pp_profile *request);
295 int (*get_power_profile_state)(void *handle,
296 struct amd_pp_profile *query);
297 int (*set_power_profile_state)(void *handle,
298 struct amd_pp_profile *request);
299 int (*switch_power_profile)(void *handle,
300 enum amd_pp_profile_type type);
301};
302
252#endif /* __AMD_SHARED_H__ */ 303#endif /* __AMD_SHARED_H__ */