|
My Project
|
Classes | |
| struct | kbasep_atom_req |
| struct | kbasep_js_per_as_data |
| struct | kbasep_js_device_data |
| KBase Device Data Job Scheduler sub-structure. More... | |
| struct | kbasep_js_kctx_info |
| KBase Context Job Scheduling information structure. More... | |
| struct | kbasep_js_atom_retained_state |
Macros | |
| #define | KBASE_JS_MAX_JOB_SUBMIT_PER_SLOT_PER_IRQ 2 |
| Maximum number of jobs that can be submitted to a job slot whilst inside the IRQ handler. More... | |
| #define | KBASE_JS_IRQ_THROTTLE_TIME_US 20 |
| the IRQ_THROTTLE time in microseconds More... | |
| #define | KBASEP_JS_RETRY_SUBMIT_SLOT_INVALID (-1) |
| #define | KBASEP_JS_ATOM_RETAINED_STATE_CORE_REQ_INVALID BASE_JD_REQ_DEP |
| #define | KBASEP_JS_TICK_RESOLUTION_US 1 |
| The JS timer resolution, in microseconds. More... | |
| #define | KBASE_JS_ATOM_SCHED_PRIO_INVALID -1 |
| #define | KBASE_JS_ATOM_SCHED_PRIO_DEFAULT KBASE_JS_ATOM_SCHED_PRIO_MED |
Typedefs | |
| typedef u32 | kbase_context_flags |
| typedef void(* | kbasep_js_ctx_job_cb) (struct kbase_device *kbdev, struct kbase_jd_atom *katom) |
| typedef u32 | kbasep_js_atom_done_code |
Enumerations | |
| enum | kbasep_js_ctx_attr { KBASEP_JS_CTX_ATTR_COMPUTE, KBASEP_JS_CTX_ATTR_NON_COMPUTE, KBASEP_JS_CTX_ATTR_COMPUTE_ALL_CORES, KBASEP_JS_CTX_ATTR_COUNT } |
| Context attributes. More... | |
| enum | { KBASE_JS_ATOM_DONE_START_NEW_ATOMS = (1u << 0), KBASE_JS_ATOM_DONE_EVICTED_FROM_NEXT = (1u << 1) } |
| enum | { KBASE_JS_ATOM_SCHED_PRIO_HIGH = 0, KBASE_JS_ATOM_SCHED_PRIO_MED, KBASE_JS_ATOM_SCHED_PRIO_LOW, KBASE_JS_ATOM_SCHED_PRIO_COUNT } |
Functions | |
| int | kbasep_js_devdata_init (struct kbase_device *const kbdev) |
| Initialize the Job Scheduler. More... | |
| void | kbasep_js_devdata_halt (struct kbase_device *kbdev) |
| Halt the Job Scheduler. More... | |
| void | kbasep_js_devdata_term (struct kbase_device *kbdev) |
| Terminate the Job Scheduler. More... | |
| int | kbasep_js_kctx_init (struct kbase_context *const kctx) |
| Initialize the Scheduling Component of a struct kbase_context on the Job Scheduler. More... | |
| void | kbasep_js_kctx_term (struct kbase_context *kctx) |
| Terminate the Scheduling Component of a struct kbase_context on the Job Scheduler. More... | |
| bool | kbasep_js_add_job (struct kbase_context *kctx, struct kbase_jd_atom *atom) |
| Add a job chain to the Job Scheduler, and take necessary actions to schedule the context/run the job. More... | |
| void | kbasep_js_remove_job (struct kbase_device *kbdev, struct kbase_context *kctx, struct kbase_jd_atom *atom) |
| Remove a job chain from the Job Scheduler, except for its 'retained state'. More... | |
| bool | kbasep_js_remove_cancelled_job (struct kbase_device *kbdev, struct kbase_context *kctx, struct kbase_jd_atom *katom) |
| Completely remove a job chain from the Job Scheduler, in the case where the job chain was cancelled. More... | |
| bool | kbasep_js_runpool_retain_ctx (struct kbase_device *kbdev, struct kbase_context *kctx) |
| Refcount a context as being busy, preventing it from being scheduled out. More... | |
| bool | kbasep_js_runpool_retain_ctx_nolock (struct kbase_device *kbdev, struct kbase_context *kctx) |
| Refcount a context as being busy, preventing it from being scheduled out. More... | |
| struct kbase_context * | kbasep_js_runpool_lookup_ctx (struct kbase_device *kbdev, int as_nr) |
| Lookup a context in the Run Pool based upon its current address space and ensure that is stays scheduled in. More... | |
| struct kbase_context * | kbasep_js_runpool_lookup_ctx_nolock (struct kbase_device *kbdev, int as_nr) |
| void | kbasep_js_runpool_requeue_or_kill_ctx (struct kbase_device *kbdev, struct kbase_context *kctx, bool has_pm_ref) |
| Handling the requeuing/killing of a context that was evicted from the policy queue or runpool. More... | |
| void | kbasep_js_runpool_release_ctx (struct kbase_device *kbdev, struct kbase_context *kctx) |
| Release a refcount of a context being busy, allowing it to be scheduled out. More... | |
| void | kbasep_js_runpool_release_ctx_and_katom_retained_state (struct kbase_device *kbdev, struct kbase_context *kctx, struct kbasep_js_atom_retained_state *katom_retained_state) |
| Variant of kbasep_js_runpool_release_ctx() that handles additional actions from completing an atom. More... | |
| void | kbasep_js_runpool_release_ctx_nolock (struct kbase_device *kbdev, struct kbase_context *kctx) |
| Variant of kbase_js_runpool_release_ctx() that assumes that kbasep_js_device_data::runpool_mutex and kbasep_js_kctx_info::ctx::jsctx_mutex are held by the caller, and does not attempt to schedule new contexts. | |
| void | kbasep_js_schedule_privileged_ctx (struct kbase_device *kbdev, struct kbase_context *kctx) |
| Schedule in a privileged context. More... | |
| void | kbasep_js_release_privileged_ctx (struct kbase_device *kbdev, struct kbase_context *kctx) |
| Release a privileged context, allowing it to be scheduled out. More... | |
| void | kbase_js_try_run_jobs (struct kbase_device *kbdev) |
| Try to submit the next job on each slot. More... | |
| void | kbasep_js_suspend (struct kbase_device *kbdev) |
| Suspend the job scheduler during a Power Management Suspend event. More... | |
| void | kbasep_js_resume (struct kbase_device *kbdev) |
| Resume the Job Scheduler after a Power Management Resume event. More... | |
| bool | kbase_js_dep_resolved_submit (struct kbase_context *kctx, struct kbase_jd_atom *katom) |
| Submit an atom to the job scheduler. More... | |
| void | jsctx_ll_flush_to_rb (struct kbase_context *kctx, int prio, int js) |
| struct kbase_jd_atom * | kbase_js_pull (struct kbase_context *kctx, int js) |
| Pull an atom from a context in the job scheduler for execution. More... | |
| void | kbase_js_unpull (struct kbase_context *kctx, struct kbase_jd_atom *katom) |
| Return an atom to the job scheduler ringbuffer. More... | |
| bool | kbase_js_complete_atom_wq (struct kbase_context *kctx, struct kbase_jd_atom *katom) |
| Complete an atom from jd_done_worker(), removing it from the job scheduler ringbuffer. More... | |
| struct kbase_jd_atom * | kbase_js_complete_atom (struct kbase_jd_atom *katom, ktime_t *end_timestamp) |
| Complete an atom. More... | |
| void | kbase_js_sched (struct kbase_device *kbdev, int js_mask) |
| Submit atoms from all available contexts. More... | |
| void | kbase_js_zap_context (struct kbase_context *kctx) |
| bool | kbase_js_is_atom_valid (struct kbase_device *kbdev, struct kbase_jd_atom *katom) |
| Validate an atom. More... | |
| void | kbase_js_set_timeouts (struct kbase_device *kbdev) |
| void | kbasep_js_ctx_attr_set_initial_attrs (struct kbase_device *kbdev, struct kbase_context *kctx) |
| void | kbasep_js_ctx_attr_runpool_retain_ctx (struct kbase_device *kbdev, struct kbase_context *kctx) |
| bool | kbasep_js_ctx_attr_runpool_release_ctx (struct kbase_device *kbdev, struct kbase_context *kctx) |
| void | kbasep_js_ctx_attr_ctx_retain_atom (struct kbase_device *kbdev, struct kbase_context *kctx, struct kbase_jd_atom *katom) |
| bool | kbasep_js_ctx_attr_ctx_release_atom (struct kbase_device *kbdev, struct kbase_context *kctx, struct kbasep_js_atom_retained_state *katom_retained_state) |
Variables | |
| const int | kbasep_js_atom_priority_to_relative [BASE_JD_NR_PRIO_LEVELS] |
| const base_jd_prio | kbasep_js_relative_priority_to_atom [KBASE_JS_ATOM_SCHED_PRIO_COUNT] |
These APIs are Internal to KBase.
| #define KBASE_JS_IRQ_THROTTLE_TIME_US 20 |
the IRQ_THROTTLE time in microseconds
This will be converted via the GPU's clock frequency into a cycle-count.
| #define KBASE_JS_MAX_JOB_SUBMIT_PER_SLOT_PER_IRQ 2 |
Maximum number of jobs that can be submitted to a job slot whilst inside the IRQ handler.
This is important because GPU NULL jobs can complete whilst the IRQ handler is running. Otherwise, it potentially allows an unlimited number of GPU NULL jobs to be submitted inside the IRQ handler, which increases IRQ latency.
| #define KBASEP_JS_ATOM_RETAINED_STATE_CORE_REQ_INVALID BASE_JD_REQ_DEP |
base_jd_core_req value signifying 'invalid' for a kbase_jd_atom_retained_state.
| #define KBASEP_JS_RETRY_SUBMIT_SLOT_INVALID (-1) |
Value signifying 'no retry on a slot required' for:
| #define KBASEP_JS_TICK_RESOLUTION_US 1 |
The JS timer resolution, in microseconds.
Any non-zero difference in time will be at least this size.
| typedef u32 kbasep_js_atom_done_code |
Combination of KBASE_JS_ATOM_DONE_<...> bits
| typedef void(* kbasep_js_ctx_job_cb) (struct kbase_device *kbdev, struct kbase_jd_atom *katom) |
Callback function run on all of a context's jobs registered with the Job Scheduler
| anonymous enum |
| enum kbasep_js_ctx_attr |
Context attributes.
Each context attribute can be thought of as a boolean value that caches some state information about either the runpool, or the context:
The boolean value of the context attributes often affect scheduling decisions, such as affinities to use and job slots to use.
To accomodate changes of state in the context, each attribute is refcounted in the context, and in the runpool for all running contexts. Specifically:
| Enumerator | |
|---|---|
| KBASEP_JS_CTX_ATTR_COMPUTE | Attribute indicating a context that contains Compute jobs. That is, the context has jobs of type BASE_JD_REQ_ONLY_COMPUTE
|
| KBASEP_JS_CTX_ATTR_NON_COMPUTE | Attribute indicating a context that contains Non-Compute jobs. That is, the context has some jobs that are not of type BASE_JD_REQ_ONLY_COMPUTE.
|
| KBASEP_JS_CTX_ATTR_COMPUTE_ALL_CORES | Attribute indicating that a context contains compute-job atoms that aren't restricted to a coherent group, and can run on all cores. Specifically, this is when the atom's core_req satisfy:
Such atoms could be blocked from running if one of the coherent groups is being used by another job slot, so tracking this context attribute allows us to prevent such situations.
|
| KBASEP_JS_CTX_ATTR_COUNT | Must be the last in the enum |
| void jsctx_ll_flush_to_rb | ( | struct kbase_context * | kctx, |
| int | prio, | ||
| int | js | ||
| ) |
jsctx_ll_flush_to_rb() - Pushes atoms from the linked list to ringbuffer. : Context Pointer : Priority (specifies the queue together with js). : Job slot (specifies the queue together with prio).
Pushes all possible atoms from the linked list to the ringbuffer. Number of atoms are limited to free space in the ringbuffer and number of available atoms in the linked list.
| struct kbase_jd_atom* kbase_js_complete_atom | ( | struct kbase_jd_atom * | katom, |
| ktime_t * | end_timestamp | ||
| ) |
Complete an atom.
Most of the work required to complete an atom will be performed by jd_done_worker().
The HW access lock must be held when calling this function.
| [in] | katom | Pointer to the atom to complete |
| [in] | end_timestamp | The time that the atom completed (may be NULL) |
Return: Atom that has now been unblocked and can now be run, or NULL if none
| bool kbase_js_complete_atom_wq | ( | struct kbase_context * | kctx, |
| struct kbase_jd_atom * | katom | ||
| ) |
Complete an atom from jd_done_worker(), removing it from the job scheduler ringbuffer.
If the atom failed then all dependee atoms marked for failure propagation will also fail.
| [in] | kctx | Context pointer |
| [in] | katom | Pointer to the atom to complete |
| bool kbase_js_dep_resolved_submit | ( | struct kbase_context * | kctx, |
| struct kbase_jd_atom * | katom | ||
| ) |
Submit an atom to the job scheduler.
The atom is enqueued on the context's ringbuffer. The caller must have ensured that all dependencies can be represented in the ringbuffer.
Caller must hold jctx->lock
| [in] | kctx | Context pointer |
| [in] | atom | Pointer to the atom to submit |
| bool kbase_js_is_atom_valid | ( | struct kbase_device * | kbdev, |
| struct kbase_jd_atom * | katom | ||
| ) |
Validate an atom.
This will determine whether the atom can be scheduled onto the GPU. Atoms with invalid combinations of core requirements will be rejected.
| [in] | kbdev | Device pointer |
| [in] | katom | Atom to validate |
| struct kbase_jd_atom* kbase_js_pull | ( | struct kbase_context * | kctx, |
| int | js | ||
| ) |
Pull an atom from a context in the job scheduler for execution.
The atom will not be removed from the ringbuffer at this stage.
The HW access lock must be held when calling this function.
| [in] | kctx | Context to pull from |
| [in] | js | Job slot to pull from |
| void kbase_js_sched | ( | struct kbase_device * | kbdev, |
| int | js_mask | ||
| ) |
Submit atoms from all available contexts.
This will attempt to submit as many jobs as possible to the provided job slots. It will exit when either all job slots are full, or all contexts have been used.
| [in] | kbdev | Device pointer |
| [in] | js_mask | Mask of job slots to submit to |
| void kbase_js_set_timeouts | ( | struct kbase_device * | kbdev | ) |
kbase_js_set_timeouts - update all JS timeouts with user specified data : Device pointer
Timeouts are specified through the 'js_timeouts' sysfs file. If a timeout is set to a positive number then that becomes the new value used, if a timeout is negative then the default is set.
| void kbase_js_try_run_jobs | ( | struct kbase_device * | kbdev | ) |
Try to submit the next job on each slot.
The following locks may be used:
| void kbase_js_unpull | ( | struct kbase_context * | kctx, |
| struct kbase_jd_atom * | katom | ||
| ) |
Return an atom to the job scheduler ringbuffer.
An atom is 'unpulled' if execution is stopped but intended to be returned to later. The most common reason for this is that the atom has been soft-stopped.
Note that if multiple atoms are to be 'unpulled', they must be returned in the reverse order to which they were originally pulled. It is a programming error to return atoms in any other order.
The HW access lock must be held when calling this function.
| [in] | kctx | Context pointer |
| [in] | atom | Pointer to the atom to unpull |
| void kbase_js_zap_context | ( | struct kbase_context * | kctx | ) |
kbase_jd_zap_context - Attempt to deschedule a context that is being destroyed : Context pointer
This will attempt to remove a context from any internal job scheduler queues and perform any other actions to ensure a context will not be submitted from.
If the context is currently scheduled, then the caller must wait for all pending jobs to complete before taking any further action.
| bool kbasep_js_add_job | ( | struct kbase_context * | kctx, |
| struct kbase_jd_atom * | atom | ||
| ) |
Add a job chain to the Job Scheduler, and take necessary actions to schedule the context/run the job.
This atomically does the following:
Once this is done, then an appropriate action is taken:
The Policy's Queue can be updated by this in the following ways:
If the context is already scheduled on the RunPool, then adding a job to it is guarenteed not to update the Policy Queue. And so, the caller is guarenteed to not need to try scheduling a context from the Run Pool - it can safely assert that the result is false.
It is a programming error to have more than U32_MAX jobs in flight at a time.
The following locking conditions are made on the caller:
| bool kbasep_js_ctx_attr_ctx_release_atom | ( | struct kbase_device * | kbdev, |
| struct kbase_context * | kctx, | ||
| struct kbasep_js_atom_retained_state * | katom_retained_state | ||
| ) |
Release all attributes of an atom, given its retained state.
This occurs after (permanently) removing an atom from a context
Requires:
This is a no-op when katom_retained_state is invalid.
| void kbasep_js_ctx_attr_ctx_retain_atom | ( | struct kbase_device * | kbdev, |
| struct kbase_context * | kctx, | ||
| struct kbase_jd_atom * | katom | ||
| ) |
Retain all attributes of an atom
This occurs on adding an atom to a context
Requires:
| bool kbasep_js_ctx_attr_runpool_release_ctx | ( | struct kbase_device * | kbdev, |
| struct kbase_context * | kctx | ||
| ) |
Release all attributes of a context
This occurs on scheduling out the context from the runpool (but before is_scheduled is cleared)
Requires:
| void kbasep_js_ctx_attr_runpool_retain_ctx | ( | struct kbase_device * | kbdev, |
| struct kbase_context * | kctx | ||
| ) |
Retain all attributes of a context
This occurs on scheduling in the context on the runpool (but after is_scheduled is set)
Requires:
| void kbasep_js_ctx_attr_set_initial_attrs | ( | struct kbase_device * | kbdev, |
| struct kbase_context * | kctx | ||
| ) |
Set the initial attributes of a context (when context create flags are set)
Requires:
| void kbasep_js_devdata_halt | ( | struct kbase_device * | kbdev | ) |
Halt the Job Scheduler.
It is safe to call this on kbdev even if it the kbasep_js_device_data sub-structure was never initialized/failed initialization, to give efficient error-path code.
For this to work, the struct kbasep_js_device_data sub-structure of kbdev must be zero initialized before passing to the kbasep_js_devdata_init() function. This is to give efficient error path code.
It is a Programming Error to call this whilst there are still kbase_context structures registered with this scheduler.
| int kbasep_js_devdata_init | ( | struct kbase_device *const | kbdev | ) |
Initialize the Job Scheduler.
The struct kbasep_js_device_data sub-structure of kbdev must be zero initialized before passing to the kbasep_js_devdata_init() function. This is to give efficient error path code.
| void kbasep_js_devdata_term | ( | struct kbase_device * | kbdev | ) |
Terminate the Job Scheduler.
It is safe to call this on kbdev even if it the kbasep_js_device_data sub-structure was never initialized/failed initialization, to give efficient error-path code.
For this to work, the struct kbasep_js_device_data sub-structure of kbdev must be zero initialized before passing to the kbasep_js_devdata_init() function. This is to give efficient error path code.
It is a Programming Error to call this whilst there are still kbase_context structures registered with this scheduler.
| int kbasep_js_kctx_init | ( | struct kbase_context *const | kctx | ) |
Initialize the Scheduling Component of a struct kbase_context on the Job Scheduler.
This effectively registers a struct kbase_context with a Job Scheduler.
It does not register any jobs owned by the struct kbase_context with the scheduler. Those must be separately registered by kbasep_js_add_job().
The struct kbase_context must be zero intitialized before passing to the kbase_js_init() function. This is to give efficient error path code.
| void kbasep_js_kctx_term | ( | struct kbase_context * | kctx | ) |
Terminate the Scheduling Component of a struct kbase_context on the Job Scheduler.
This effectively de-registers a struct kbase_context from its Job Scheduler
It is safe to call this on a struct kbase_context that has never had or failed initialization of its jctx.sched_info member, to give efficient error-path code.
For this to work, the struct kbase_context must be zero intitialized before passing to the kbase_js_init() function.
It is a Programming Error to call this whilst there are still jobs registered with this context.
| void kbasep_js_release_privileged_ctx | ( | struct kbase_device * | kbdev, |
| struct kbase_context * | kctx | ||
| ) |
Release a privileged context, allowing it to be scheduled out.
See kbasep_js_runpool_release_ctx for potential side effects.
The following locking conditions are made on the caller:
| bool kbasep_js_remove_cancelled_job | ( | struct kbase_device * | kbdev, |
| struct kbase_context * | kctx, | ||
| struct kbase_jd_atom * | katom | ||
| ) |
Completely remove a job chain from the Job Scheduler, in the case where the job chain was cancelled.
This is a variant of kbasep_js_remove_job() that takes care of removing all of the retained state too. This is generally useful for cancelled atoms, which need not be handled in an optimal way.
It is a programming error to call this when:
The following locking conditions are made on the caller:
| void kbasep_js_remove_job | ( | struct kbase_device * | kbdev, |
| struct kbase_context * | kctx, | ||
| struct kbase_jd_atom * | atom | ||
| ) |
Remove a job chain from the Job Scheduler, except for its 'retained state'.
Completely removing a job requires several calls:
In the common case of atoms completing normally, this set of actions is more optimal for spinlock purposes than having kbasep_js_remove_job() handle all of the actions.
In the case of cancelling atoms, it is easier to call kbasep_js_remove_cancelled_job(), which handles all the necessary actions.
It is a programming error to call this when:
Do not use this for removing jobs being killed by kbase_jd_cancel() - use kbasep_js_remove_cancelled_job() instead.
The following locking conditions are made on the caller:
| void kbasep_js_resume | ( | struct kbase_device * | kbdev | ) |
Resume the Job Scheduler after a Power Management Resume event.
This restores the actions from kbasep_js_suspend():
| struct kbase_context* kbasep_js_runpool_lookup_ctx | ( | struct kbase_device * | kbdev, |
| int | as_nr | ||
| ) |
Lookup a context in the Run Pool based upon its current address space and ensure that is stays scheduled in.
The context is refcounted as being busy to prevent it from scheduling out. It must be released with kbasep_js_runpool_release_ctx() when it is no longer required to stay scheduled in.
The following locking conditions are made on the caller:
| struct kbase_context* kbasep_js_runpool_lookup_ctx_nolock | ( | struct kbase_device * | kbdev, |
| int | as_nr | ||
| ) |
kbasep_js_runpool_lookup_ctx_nolock - Lookup a context in the Run Pool based upon its current address space and ensure that is stays scheduled in. : Device pointer : Address space to lookup
The context is refcounted as being busy to prevent it from scheduling out. It must be released with kbasep_js_runpool_release_ctx() when it is no longer required to stay scheduled in.
Note: This function can safely be called from IRQ context.
The following locking conditions are made on the caller:
Return: a valid struct kbase_context on success, which has been refcounted as being busy. NULL on failure, indicating that no context was found in as_nr
| void kbasep_js_runpool_release_ctx | ( | struct kbase_device * | kbdev, |
| struct kbase_context * | kctx | ||
| ) |
Release a refcount of a context being busy, allowing it to be scheduled out.
When the refcount reaches zero and the context might be scheduled out (depending on whether the Scheudling Policy has deemed it so, or if it has run out of jobs).
If the context does get scheduled out, then The following actions will be taken as part of deschduling a context:
Whilst the context is being descheduled, this also handles actions that cause more atoms to be run:
Unlike retaining a context in the runpool, this function cannot be called from IRQ context.
It is a programming error to call this on a kctx that is not currently scheduled, or that already has a zero refcount.
The following locking conditions are made on the caller:
| void kbasep_js_runpool_release_ctx_and_katom_retained_state | ( | struct kbase_device * | kbdev, |
| struct kbase_context * | kctx, | ||
| struct kbasep_js_atom_retained_state * | katom_retained_state | ||
| ) |
Variant of kbasep_js_runpool_release_ctx() that handles additional actions from completing an atom.
This is usually called as part of completing an atom and releasing the refcount on the context held by the atom.
Therefore, the extra actions carried out are part of handling actions queued on a completed atom, namely:
The locking conditions of this function are the same as those for kbasep_js_runpool_release_ctx()
| void kbasep_js_runpool_requeue_or_kill_ctx | ( | struct kbase_device * | kbdev, |
| struct kbase_context * | kctx, | ||
| bool | has_pm_ref | ||
| ) |
Handling the requeuing/killing of a context that was evicted from the policy queue or runpool.
This should be used whenever handing off a context that has been evicted from the policy queue or the runpool:
In addition, if the context is dying the jobs are killed asynchronously.
In all cases, the Power Manager active reference is released (kbase_pm_context_idle()) whenever the has_pm_ref parameter is true. has_pm_ref must be set to false whenever the context was not previously in the runpool and does not hold a Power Manager active refcount. Note that contexts in a rollback of kbasep_js_try_schedule_head_ctx() might have an active refcount even though they weren't in the runpool.
The following locking conditions are made on the caller:
| bool kbasep_js_runpool_retain_ctx | ( | struct kbase_device * | kbdev, |
| struct kbase_context * | kctx | ||
| ) |
Refcount a context as being busy, preventing it from being scheduled out.
The following locking conditions are made on the caller:
| bool kbasep_js_runpool_retain_ctx_nolock | ( | struct kbase_device * | kbdev, |
| struct kbase_context * | kctx | ||
| ) |
Refcount a context as being busy, preventing it from being scheduled out.
The following locks must be held by the caller:
| void kbasep_js_schedule_privileged_ctx | ( | struct kbase_device * | kbdev, |
| struct kbase_context * | kctx | ||
| ) |
Schedule in a privileged context.
This schedules a context in regardless of the context priority. If the runpool is full, a context will be forced out of the runpool and the function will wait for the new context to be scheduled in. The context will be kept scheduled in (and the corresponding address space reserved) until kbasep_js_release_privileged_ctx is called).
The following locking conditions are made on the caller:
| void kbasep_js_suspend | ( | struct kbase_device * | kbdev | ) |
Suspend the job scheduler during a Power Management Suspend event.
Causes all contexts to be removed from the runpool, and prevents any contexts from (re)entering the runpool.
This does not handle suspending the one privileged context: the caller must instead do this by by suspending the GPU HW Counter Instrumentation.
This will eventually cause all Power Management active references held by contexts on the runpool to be released, without running any more atoms.
The caller must then wait for all Power Mangement active refcount to become zero before completing the suspend.
The emptying mechanism may take some time to complete, since it can wait for jobs to complete naturally instead of forcing them to end quickly. However, this is bounded by the Job Scheduler's Job Timeouts. Hence, this function is guaranteed to complete in a finite time.
1.8.13