1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright © 2021 Intel Corporation
4  */
5 
6 #ifndef _INTEL_GUC_SLPC_H_
7 #define _INTEL_GUC_SLPC_H_
8 
9 #include "intel_guc_submission.h"
10 #include "intel_guc_slpc_types.h"
11 
12 struct intel_gt;
13 struct drm_printer;
14 
intel_guc_slpc_is_supported(struct intel_guc * guc)15 static inline bool intel_guc_slpc_is_supported(struct intel_guc *guc)
16 {
17 	return guc->slpc.supported;
18 }
19 
intel_guc_slpc_is_wanted(struct intel_guc * guc)20 static inline bool intel_guc_slpc_is_wanted(struct intel_guc *guc)
21 {
22 	return guc->slpc.selected;
23 }
24 
intel_guc_slpc_is_used(struct intel_guc * guc)25 static inline bool intel_guc_slpc_is_used(struct intel_guc *guc)
26 {
27 	return intel_guc_submission_is_used(guc) && intel_guc_slpc_is_wanted(guc);
28 }
29 
30 void intel_guc_slpc_init_early(struct intel_guc_slpc *slpc);
31 
32 int intel_guc_slpc_init(struct intel_guc_slpc *slpc);
33 int intel_guc_slpc_enable(struct intel_guc_slpc *slpc);
34 void intel_guc_slpc_fini(struct intel_guc_slpc *slpc);
35 int intel_guc_slpc_set_max_freq(struct intel_guc_slpc *slpc, u32 val);
36 int intel_guc_slpc_set_min_freq(struct intel_guc_slpc *slpc, u32 val);
37 int intel_guc_slpc_set_boost_freq(struct intel_guc_slpc *slpc, u32 val);
38 int intel_guc_slpc_get_max_freq(struct intel_guc_slpc *slpc, u32 *val);
39 int intel_guc_slpc_get_min_freq(struct intel_guc_slpc *slpc, u32 *val);
40 int intel_guc_slpc_print_info(struct intel_guc_slpc *slpc, struct drm_printer *p);
41 int intel_guc_slpc_set_media_ratio_mode(struct intel_guc_slpc *slpc, u32 val);
42 void intel_guc_pm_intrmsk_enable(struct intel_gt *gt);
43 void intel_guc_slpc_boost(struct intel_guc_slpc *slpc);
44 void intel_guc_slpc_dec_waiters(struct intel_guc_slpc *slpc);
45 
46 #endif
47