3 * (C) COPYRIGHT 2014 ARM Limited. All rights reserved.
5 * This program is free software and is provided to you under the terms of the
6 * GNU General Public License version 2 as published by the Free Software
7 * Foundation, and any use by you of this program is subject to the terms
10 * A copy of the licence is included with the program, and can also be obtained
11 * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
12 * Boston, MA 02110-1301, USA.
20 * Job manager common APIs
27 * kbase_jm_kick() - Indicate that there are jobs ready to run.
28 * @kbdev: Device pointer
29 * @js_mask: Mask of the job slots that can be pulled from.
31 * Caller must hold the runpool_irq lock and schedule_sem semaphore
33 * Return: Mask of the job slots that can still be submitted to.
35 u32 kbase_jm_kick(struct kbase_device *kbdev, u32 js_mask);
38 * kbase_jm_kick_all() - Indicate that there are jobs ready to run on all job
40 * @kbdev: Device pointer
42 * Caller must hold the runpool_irq lock and schedule_sem semaphore
44 * Return: Mask of the job slots that can still be submitted to.
46 static inline u32 kbase_jm_kick_all(struct kbase_device *kbdev)
48 return kbase_jm_kick(kbdev, (1 << kbdev->gpu_props.num_job_slots) - 1);
52 * kbase_jm_try_kick - Attempt to call kbase_jm_kick
53 * @kbdev: Device pointer
54 * @js_mask: Mask of the job slots that can be pulled from
55 * Context: Caller must hold runpool_irq lock
57 * If schedule_sem can be immediately obtained then this function will call
58 * kbase_jm_kick() otherwise it will do nothing.
60 void kbase_jm_try_kick(struct kbase_device *kbdev, u32 js_mask);
63 * kbase_jm_try_kick_all() - Attempt to call kbase_jm_kick_all
64 * @kbdev: Device pointer
65 * Context: Caller must hold runpool_irq lock
67 * If schedule_sem can be immediately obtained then this function will call
68 * kbase_jm_kick_all() otherwise it will do nothing.
70 void kbase_jm_try_kick_all(struct kbase_device *kbdev);
73 * kbase_jm_idle_ctx() - Mark a context as idle.
74 * @kbdev: Device pointer
75 * @kctx: Context to mark as idle
77 * No more atoms will be pulled from this context until it is marked as active
78 * by kbase_js_use_ctx().
80 * The context should have no atoms currently pulled from it
81 * (kctx->atoms_pulled == 0).
83 * Caller must hold the runpool_irq lock
85 void kbase_jm_idle_ctx(struct kbase_device *kbdev, struct kbase_context *kctx);
88 * kbase_jm_return_atom_to_js() - Return an atom to the job scheduler that has
89 * been soft-stopped or will fail due to a
91 * @kbdev: Device pointer
92 * @katom: Atom that has been stopped or will be failed
94 void kbase_jm_return_atom_to_js(struct kbase_device *kbdev,
95 struct kbase_jd_atom *katom);
98 * kbase_jm_complete() - Complete an atom
99 * @kbdev: Device pointer
100 * @katom: Atom that has completed
101 * @end_timestamp: Timestamp of atom completion
103 void kbase_jm_complete(struct kbase_device *kbdev, struct kbase_jd_atom *katom,
104 ktime_t *end_timestamp);
106 #endif /* _KBASE_JM_H_ */