hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/gpu/arm/bifrost/mali_kbase_hwaccess_pm.h
....@@ -1,7 +1,7 @@
11 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
22 /*
33 *
4
- * (C) COPYRIGHT 2014-2015, 2018-2021 ARM Limited. All rights reserved.
4
+ * (C) COPYRIGHT 2014-2015, 2018-2022 ARM Limited. All rights reserved.
55 *
66 * This program is free software and is provided to you under the terms of the
77 * GNU General Public License version 2 as published by the Free Software
....@@ -37,22 +37,22 @@
3737 /* Functions common to all HW access backends */
3838
3939 /**
40
- * Initialize the power management framework.
41
- *
42
- * Must be called before any other power management function
40
+ * kbase_hwaccess_pm_init - Initialize the power management framework.
4341 *
4442 * @kbdev: The kbase device structure for the device (must be a valid pointer)
43
+ *
44
+ * Must be called before any other power management function
4545 *
4646 * Return: 0 if the power management framework was successfully initialized.
4747 */
4848 int kbase_hwaccess_pm_init(struct kbase_device *kbdev);
4949
5050 /**
51
- * Terminate the power management framework.
52
- *
53
- * No power management functions may be called after this
51
+ * kbase_hwaccess_pm_term - Terminate the power management framework.
5452 *
5553 * @kbdev: The kbase device structure for the device (must be a valid pointer)
54
+ *
55
+ * No power management functions may be called after this
5656 */
5757 void kbase_hwaccess_pm_term(struct kbase_device *kbdev);
5858
....@@ -70,42 +70,45 @@
7070 unsigned int flags);
7171
7272 /**
73
- * Halt the power management framework.
73
+ * kbase_hwaccess_pm_halt - Halt the power management framework.
74
+ *
75
+ * @kbdev: The kbase device structure for the device (must be a valid pointer)
7476 *
7577 * Should ensure that no new interrupts are generated, but allow any currently
7678 * running interrupt handlers to complete successfully. The GPU is forced off by
7779 * the time this function returns, regardless of whether or not the active power
7880 * policy asks for the GPU to be powered off.
79
- *
80
- * @kbdev: The kbase device structure for the device (must be a valid pointer)
8181 */
8282 void kbase_hwaccess_pm_halt(struct kbase_device *kbdev);
8383
8484 /**
85
- * Perform any backend-specific actions to suspend the GPU
85
+ * kbase_hwaccess_pm_suspend - Perform any backend-specific actions to suspend the GPU
8686 *
8787 * @kbdev: The kbase device structure for the device (must be a valid pointer)
88
+ *
89
+ * Return: 0 if suspend was successful.
8890 */
89
-void kbase_hwaccess_pm_suspend(struct kbase_device *kbdev);
91
+int kbase_hwaccess_pm_suspend(struct kbase_device *kbdev);
9092
9193 /**
92
- * Perform any backend-specific actions to resume the GPU from a suspend
94
+ * kbase_hwaccess_pm_resume - Perform any backend-specific actions to resume the GPU
95
+ * from a suspend
9396 *
9497 * @kbdev: The kbase device structure for the device (must be a valid pointer)
9598 */
9699 void kbase_hwaccess_pm_resume(struct kbase_device *kbdev);
97100
98101 /**
99
- * Perform any required actions for activating the GPU. Called when the first
100
- * context goes active.
102
+ * kbase_hwaccess_pm_gpu_active - Perform any required actions for activating the GPU.
103
+ * Called when the first context goes active.
101104 *
102105 * @kbdev: The kbase device structure for the device (must be a valid pointer)
103106 */
104107 void kbase_hwaccess_pm_gpu_active(struct kbase_device *kbdev);
105108
106109 /**
107
- * Perform any required actions for idling the GPU. Called when the last
108
- * context goes idle.
110
+ * kbase_hwaccess_pm_gpu_idle - Perform any required actions for idling the GPU.
111
+ * Called when the last context goes idle.
109112 *
110113 * @kbdev: The kbase device structure for the device (must be a valid pointer)
111114 */
....@@ -113,25 +116,25 @@
113116
114117 #if MALI_USE_CSF
115118 /**
116
- * Set the debug core mask.
117
- *
118
- * This determines which cores the power manager is allowed to use.
119
+ * kbase_pm_set_debug_core_mask - Set the debug core mask.
119120 *
120121 * @kbdev: The kbase device structure for the device (must be a valid pointer)
121122 * @new_core_mask: The core mask to use
123
+ *
124
+ * This determines which cores the power manager is allowed to use.
122125 */
123126 void kbase_pm_set_debug_core_mask(struct kbase_device *kbdev,
124127 u64 new_core_mask);
125128 #else
126129 /**
127
- * Set the debug core mask.
128
- *
129
- * This determines which cores the power manager is allowed to use.
130
+ * kbase_pm_set_debug_core_mask - Set the debug core mask.
130131 *
131132 * @kbdev: The kbase device structure for the device (must be a valid pointer)
132133 * @new_core_mask_js0: The core mask to use for job slot 0
133134 * @new_core_mask_js1: The core mask to use for job slot 1
134135 * @new_core_mask_js2: The core mask to use for job slot 2
136
+ *
137
+ * This determines which cores the power manager is allowed to use.
135138 */
136139 void kbase_pm_set_debug_core_mask(struct kbase_device *kbdev,
137140 u64 new_core_mask_js0, u64 new_core_mask_js1,
....@@ -139,19 +142,19 @@
139142 #endif /* MALI_USE_CSF */
140143
141144 /**
142
- * Get the current policy.
143
- *
144
- * Returns the policy that is currently active.
145
+ * kbase_pm_ca_get_policy - Get the current policy.
145146 *
146147 * @kbdev: The kbase device structure for the device (must be a valid pointer)
147148 *
148
- * @return The current policy
149
+ * Returns the policy that is currently active.
150
+ *
151
+ * Return: The current policy
149152 */
150153 const struct kbase_pm_ca_policy
151154 *kbase_pm_ca_get_policy(struct kbase_device *kbdev);
152155
153156 /**
154
- * Change the policy to the one specified.
157
+ * kbase_pm_ca_set_policy - Change the policy to the one specified.
155158 *
156159 * @kbdev: The kbase device structure for the device (must be a valid pointer)
157160 * @policy: The policy to change to (valid pointer returned from
....@@ -161,29 +164,29 @@
161164 const struct kbase_pm_ca_policy *policy);
162165
163166 /**
164
- * Retrieve a static list of the available policies.
167
+ * kbase_pm_ca_list_policies - Retrieve a static list of the available policies.
165168 *
166169 * @policies: An array pointer to take the list of policies. This may be NULL.
167170 * The contents of this array must not be modified.
168171 *
169
- * @return The number of policies
172
+ * Return: The number of policies
170173 */
171174 int
172175 kbase_pm_ca_list_policies(const struct kbase_pm_ca_policy * const **policies);
173176
174177 /**
175
- * Get the current policy.
176
- *
177
- * Returns the policy that is currently active.
178
+ * kbase_pm_get_policy - Get the current policy.
178179 *
179180 * @kbdev: The kbase device structure for the device (must be a valid pointer)
180181 *
181
- * @return The current policy
182
+ * Returns the policy that is currently active.
183
+ *
184
+ * Return: The current policy
182185 */
183186 const struct kbase_pm_policy *kbase_pm_get_policy(struct kbase_device *kbdev);
184187
185188 /**
186
- * Change the policy to the one specified.
189
+ * kbase_pm_set_policy - Change the policy to the one specified.
187190 *
188191 * @kbdev: The kbase device structure for the device (must be a valid
189192 * pointer)
....@@ -206,7 +209,7 @@
206209 const struct kbase_pm_policy * const **list);
207210
208211 /**
209
- * kbase_protected_most_enable - Enable protected mode
212
+ * kbase_pm_protected_mode_enable() - Enable protected mode
210213 *
211214 * @kbdev: Address of the instance of a GPU platform device.
212215 *
....@@ -215,7 +218,7 @@
215218 int kbase_pm_protected_mode_enable(struct kbase_device *kbdev);
216219
217220 /**
218
- * kbase_protected_mode_disable - Disable protected mode
221
+ * kbase_pm_protected_mode_disable() - Disable protected mode
219222 *
220223 * @kbdev: Address of the instance of a GPU platform device.
221224 *