hc
2024-05-16 8d2a02b24d66aa359e83eebc1ed3c0f85367a1cb
kernel/drivers/gpu/arm/bifrost/mali_kbase_ctx_sched.h
....@@ -1,7 +1,7 @@
11 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
22 /*
33 *
4
- * (C) COPYRIGHT 2017-2018, 2020-2021 ARM Limited. All rights reserved.
4
+ * (C) COPYRIGHT 2017-2018, 2020-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
....@@ -60,6 +60,15 @@
6060 void kbase_ctx_sched_term(struct kbase_device *kbdev);
6161
6262 /**
63
+ * kbase_ctx_sched_ctx_init - Initialize per-context data fields for scheduling
64
+ * @kctx: The context to initialize
65
+ *
66
+ * This must be called during context initialization before any other context
67
+ * scheduling functions are called on @kctx
68
+ */
69
+void kbase_ctx_sched_init_ctx(struct kbase_context *kctx);
70
+
71
+/**
6372 * kbase_ctx_sched_retain_ctx - Retain a reference to the @ref kbase_context
6473 * @kctx: The context to which to retain a reference
6574 *
....@@ -79,7 +88,7 @@
7988 int kbase_ctx_sched_retain_ctx(struct kbase_context *kctx);
8089
8190 /**
82
- * kbase_ctx_sched_retain_ctx_refcount
91
+ * kbase_ctx_sched_retain_ctx_refcount - Retain a reference to the @ref kbase_context
8392 * @kctx: The context to which to retain a reference
8493 *
8594 * This function only retains a reference to the context. It must be called
....@@ -113,9 +122,6 @@
113122 * This function should be called when a context is being destroyed. The
114123 * context must no longer have any reference. If it has been assigned an
115124 * address space before then the AS will be unprogrammed.
116
- *
117
- * The kbase_device::mmu_hw_mutex and kbase_device::hwaccess_lock locks must be
118
- * held whilst calling this function.
119125 */
120126 void kbase_ctx_sched_remove_ctx(struct kbase_context *kctx);
121127
....@@ -187,8 +193,8 @@
187193 * @kctx: Context to be refcounted
188194 *
189195 * The following locks must be held by the caller:
190
- * * kbase_device::mmu_hw_mutex
191
- * * kbase_device::hwaccess_lock
196
+ * &kbase_device.mmu_hw_mutex
197
+ * &kbase_device.hwaccess_lock
192198 *
193199 * Return: true if refcount succeeded, and the context will not be scheduled
194200 * out, false if the refcount failed (because the context is being/has been