hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/gpu/arm/bifrost/mali_kbase_hwaccess_jm.h
....@@ -1,7 +1,7 @@
11 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
22 /*
33 *
4
- * (C) COPYRIGHT 2014-2021 ARM Limited. All rights reserved.
4
+ * (C) COPYRIGHT 2014-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
....@@ -97,8 +97,8 @@
9797 * Return: true if context is now active, false otherwise (ie if context does
9898 * not have an address space assigned)
9999 */
100
-bool kbase_backend_use_ctx_sched(struct kbase_device *kbdev,
101
- struct kbase_context *kctx, int js);
100
+bool kbase_backend_use_ctx_sched(struct kbase_device *kbdev, struct kbase_context *kctx,
101
+ unsigned int js);
102102
103103 /**
104104 * kbase_backend_release_ctx_irq - Release a context from the GPU. This will
....@@ -181,10 +181,9 @@
181181 * @kbdev: Device pointer
182182 * @js: Job slot to inspect
183183 *
184
- * Return : Atom currently at the head of slot @js, or NULL
184
+ * Return: Atom currently at the head of slot @js, or NULL
185185 */
186
-struct kbase_jd_atom *kbase_backend_inspect_tail(struct kbase_device *kbdev,
187
- int js);
186
+struct kbase_jd_atom *kbase_backend_inspect_tail(struct kbase_device *kbdev, unsigned int js);
188187
189188 /**
190189 * kbase_backend_nr_atoms_on_slot() - Return the number of atoms currently on a
....@@ -192,9 +191,9 @@
192191 * @kbdev: Device pointer
193192 * @js: Job slot to inspect
194193 *
195
- * Return : Number of atoms currently on slot
194
+ * Return: Number of atoms currently on slot
196195 */
197
-int kbase_backend_nr_atoms_on_slot(struct kbase_device *kbdev, int js);
196
+int kbase_backend_nr_atoms_on_slot(struct kbase_device *kbdev, unsigned int js);
198197
199198 /**
200199 * kbase_backend_nr_atoms_submitted() - Return the number of atoms on a slot
....@@ -202,9 +201,9 @@
202201 * @kbdev: Device pointer
203202 * @js: Job slot to inspect
204203 *
205
- * Return : Number of atoms currently on slot @js that are currently on the GPU.
204
+ * Return: Number of atoms currently on slot @js that are currently on the GPU.
206205 */
207
-int kbase_backend_nr_atoms_submitted(struct kbase_device *kbdev, int js);
206
+int kbase_backend_nr_atoms_submitted(struct kbase_device *kbdev, unsigned int js);
208207
209208 /**
210209 * kbase_backend_ctx_count_changed() - Number of contexts ready to submit jobs
....@@ -231,12 +230,12 @@
231230 * @kbdev: Device pointer
232231 * @js: Job slot to inspect
233232 *
234
- * Return : Number of jobs that can be submitted.
233
+ * Return: Number of jobs that can be submitted.
235234 */
236
-int kbase_backend_slot_free(struct kbase_device *kbdev, int js);
235
+int kbase_backend_slot_free(struct kbase_device *kbdev, unsigned int js);
237236
238237 /**
239
- * kbase_job_check_enter_disjoint - potentially leave disjoint state
238
+ * kbase_job_check_leave_disjoint - potentially leave disjoint state
240239 * @kbdev: kbase device
241240 * @target_katom: atom which is finishing
242241 *
....@@ -287,8 +286,8 @@
287286 * Context:
288287 * The job slot lock must be held when calling this function.
289288 */
290
-void kbase_job_slot_hardstop(struct kbase_context *kctx, int js,
291
- struct kbase_jd_atom *target_katom);
289
+void kbase_job_slot_hardstop(struct kbase_context *kctx, unsigned int js,
290
+ struct kbase_jd_atom *target_katom);
292291
293292 /**
294293 * kbase_gpu_atoms_submitted_any() - Inspect whether there are any atoms
....@@ -299,4 +298,21 @@
299298 */
300299 bool kbase_gpu_atoms_submitted_any(struct kbase_device *kbdev);
301300
301
+/**
302
+ * kbase_backend_slot_kctx_purge_locked - Perform a purge on the slot_rb tracked
303
+ * kctx
304
+ *
305
+ * @kbdev: Device pointer
306
+ * @kctx: The kbase context that needs to be purged from slot_rb[]
307
+ *
308
+ * For JM GPUs, the L1 read only caches may need a start_flush invalidation,
309
+ * potentially on all slots (even if the kctx was only using a single slot),
310
+ * following a context termination or address-space ID recycle. This function
311
+ * performs a clean-up purge on the given kctx which if it has been tracked by
312
+ * slot_rb[] objects.
313
+ *
314
+ * Caller must hold kbase_device->hwaccess_lock.
315
+ */
316
+void kbase_backend_slot_kctx_purge_locked(struct kbase_device *kbdev, struct kbase_context *kctx);
317
+
302318 #endif /* _KBASE_HWACCESS_JM_H_ */