diff options
author | Siddharth Kapoor <ksiddharth@google.com> | 2022-03-15 20:55:10 +0800 |
---|---|---|
committer | Siddharth Kapoor <ksiddharth@google.com> | 2022-03-23 23:13:16 +0800 |
commit | 0b2458bd7089baefcf19906e32dffec3cf6af500 (patch) | |
tree | 61beb8549e7bb3d2582268e2aa982d79b98e2548 /mali_kbase/jm | |
parent | 3d9f70261b023712c5113fb715f114ad8db9cfae (diff) | |
parent | 88d7d984fed1c2a4358ce2bbc334e82d71e3a391 (diff) | |
download | gpu-0b2458bd7089baefcf19906e32dffec3cf6af500.tar.gz |
Merge r36p0 from upstream into android-gs-pixel-5.10-gs101
Bug: 220942030
Test: boot to Home, Camera, Video, Chrome
Signed-off-by: Siddharth Kapoor <ksiddharth@google.com>
Change-Id: I8cf3a6243b092a05299acf956f5293facd1ed3cc
Diffstat (limited to 'mali_kbase/jm')
-rw-r--r-- | mali_kbase/jm/mali_kbase_jm_defs.h | 45 | ||||
-rw-r--r-- | mali_kbase/jm/mali_kbase_jm_js.h | 25 | ||||
-rw-r--r-- | mali_kbase/jm/mali_kbase_js_defs.h | 78 |
3 files changed, 85 insertions, 63 deletions
diff --git a/mali_kbase/jm/mali_kbase_jm_defs.h b/mali_kbase/jm/mali_kbase_jm_defs.h index e762f49..54dc3c1 100644 --- a/mali_kbase/jm/mali_kbase_jm_defs.h +++ b/mali_kbase/jm/mali_kbase_jm_defs.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* * - * (C) COPYRIGHT 2019-2021 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2019-2022 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software @@ -132,6 +132,18 @@ /* Reset the GPU after each atom completion */ #define KBASE_SERIALIZE_RESET (1 << 2) +/** + * enum kbase_timeout_selector - The choice of which timeout to get scaled + * using the lowest GPU frequency. + * @KBASE_TIMEOUT_SELECTOR_COUNT: Number of timeout selectors. Must be last in + * the enum. + */ +enum kbase_timeout_selector { + + /* Must be the last in the enum */ + KBASE_TIMEOUT_SELECTOR_COUNT +}; + #if IS_ENABLED(CONFIG_DEBUG_FS) /** * struct base_job_fault_event - keeps track of the atom which faulted or which @@ -661,11 +673,12 @@ static inline bool kbase_jd_katom_is_protected( /** * kbase_atom_is_younger - query if one atom is younger by age than another + * * @katom_a: the first atom - * @katom_a: the second atom + * @katom_b: the second atom * - * Return: true if the first atom is strictly younger than the second, false - * otherwise. + * Return: true if the first atom is strictly younger than the second, + * false otherwise. */ static inline bool kbase_jd_atom_is_younger(const struct kbase_jd_atom *katom_a, const struct kbase_jd_atom *katom_b) @@ -674,7 +687,9 @@ static inline bool kbase_jd_atom_is_younger(const struct kbase_jd_atom *katom_a, } /** - * kbase_jd_atom_is_earlier + * kbase_jd_atom_is_earlier - Check whether the first atom has been submitted + * earlier than the second one + * * @katom_a: the first atom * @katom_b: the second atom * @@ -738,17 +753,13 @@ static inline bool kbase_jd_atom_is_earlier(const struct kbase_jd_atom *katom_a, * A state machine is used to control incremental rendering. */ enum kbase_jd_renderpass_state { - KBASE_JD_RP_COMPLETE, /* COMPLETE => START */ - KBASE_JD_RP_START, /* START => PEND_OOM or COMPLETE */ - KBASE_JD_RP_PEND_OOM, /* PEND_OOM => OOM or COMPLETE */ - KBASE_JD_RP_OOM, /* OOM => RETRY */ - KBASE_JD_RP_RETRY, /* RETRY => RETRY_PEND_OOM or - * COMPLETE - */ - KBASE_JD_RP_RETRY_PEND_OOM, /* RETRY_PEND_OOM => RETRY_OOM or - * COMPLETE - */ - KBASE_JD_RP_RETRY_OOM, /* RETRY_OOM => RETRY */ + KBASE_JD_RP_COMPLETE, /* COMPLETE => START */ + KBASE_JD_RP_START, /* START => PEND_OOM or COMPLETE */ + KBASE_JD_RP_PEND_OOM, /* PEND_OOM => OOM or COMPLETE */ + KBASE_JD_RP_OOM, /* OOM => RETRY */ + KBASE_JD_RP_RETRY, /* RETRY => RETRY_PEND_OOM or COMPLETE */ + KBASE_JD_RP_RETRY_PEND_OOM, /* RETRY_PEND_OOM => RETRY_OOM or COMPLETE */ + KBASE_JD_RP_RETRY_OOM /* RETRY_OOM => RETRY */ }; /** @@ -817,7 +828,7 @@ struct kbase_jd_renderpass { * @lock to guarantee that the setter has completed * its work on the kbase_context * @tb_lock: Lock to serialize the write access made to @tb to - * to store the register access trace messages. + * store the register access trace messages. * @tb: Pointer to the Userspace accessible buffer storing * the trace messages for register read/write * accesses made by the Kbase. The buffer is filled diff --git a/mali_kbase/jm/mali_kbase_jm_js.h b/mali_kbase/jm/mali_kbase_jm_js.h index 5a972a5..f01e8bb 100644 --- a/mali_kbase/jm/mali_kbase_jm_js.h +++ b/mali_kbase/jm/mali_kbase_jm_js.h @@ -1,7 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* * - * (C) COPYRIGHT 2020-2021 ARM Limited. All rights reserved. + * (C) COPYRIGHT 2020-2022 ARM Limited. All rights reserved. * * This program is free software and is provided to you under the terms of the * GNU General Public License version 2 as published by the Free Software @@ -36,6 +36,8 @@ * 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. + * + * Return: 0 on success, error code otherwise. */ int kbasep_js_devdata_init(struct kbase_device * const kbdev); @@ -86,6 +88,8 @@ void kbasep_js_devdata_term(struct kbase_device *kbdev); * * The struct kbase_context must be zero initialized before passing to the * kbase_js_init() function. This is to give efficient error path code. + * + * Return: 0 on success, error code otherwise. */ int kbasep_js_kctx_init(struct kbase_context *const kctx); @@ -206,7 +210,7 @@ bool kbasep_js_add_job(struct kbase_context *kctx, struct kbase_jd_atom *atom); * @kbdev: The kbase_device to operate on * @kctx: The kbase_context to operate on * @atom: Atom to remove -* + * * Completely removing a job requires several calls: * * kbasep_js_copy_atom_retained_state(), to capture the 'retained state' of * the atom @@ -356,9 +360,10 @@ void kbasep_js_runpool_release_ctx(struct kbase_device *kbdev, struct kbase_context *kctx); /** - * kbasep_js_runpool_release_ctx_and_katom_retained_state - Variant of + * kbasep_js_runpool_release_ctx_and_katom_retained_state - Variant of * kbasep_js_runpool_release_ctx() that handles additional * actions from completing an atom. + * * @kbdev: KBase device * @kctx: KBase context * @katom_retained_state: Retained state from the atom @@ -381,8 +386,8 @@ void kbasep_js_runpool_release_ctx_and_katom_retained_state( struct kbasep_js_atom_retained_state *katom_retained_state); /** - * kbasep_js_runpool_release_ctx_nolock - - * Variant of kbase_js_runpool_release_ctx() w/out locks + * kbasep_js_runpool_release_ctx_nolock - Variant of kbase_js_runpool_release_ctx() + * without locks * @kbdev: KBase device * @kctx: KBase context * @@ -396,6 +401,7 @@ void kbasep_js_runpool_release_ctx_nolock(struct kbase_device *kbdev, /** * kbasep_js_schedule_privileged_ctx - Schedule in a privileged context + * * @kbdev: KBase device * @kctx: KBase context * @@ -459,7 +465,7 @@ void kbase_js_try_run_jobs(struct kbase_device *kbdev); * 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. + * instead do this 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. @@ -688,6 +694,8 @@ void kbase_js_update_ctx_priority(struct kbase_context *kctx); * As with any bool, never test the return value with true. * * The caller must hold hwaccess_lock. + * + * Return: true if the context is allowed to submit jobs, false otherwise. */ static inline bool kbasep_js_is_submit_allowed( struct kbasep_js_device_data *js_devdata, @@ -768,8 +776,9 @@ static inline void kbasep_js_clear_submit_allowed( } /** - * kbasep_js_atom_retained_state_init_invalid - - * Create an initial 'invalid' atom retained state + * kbasep_js_atom_retained_state_init_invalid - Create an initial 'invalid' + * atom retained state + * * @retained_state: pointer where to create and initialize the state * * Create an initial 'invalid' atom retained state, that requires no diff --git a/mali_kbase/jm/mali_kbase_js_defs.h b/mali_kbase/jm/mali_kbase_js_defs.h index a1d40ba..652f383 100644 --- a/mali_kbase/jm/mali_kbase_js_defs.h +++ b/mali_kbase/jm/mali_kbase_js_defs.h @@ -55,10 +55,11 @@ typedef void kbasep_js_ctx_job_cb(struct kbase_device *kbdev, * @KBASEP_JS_CTX_ATTR_COMPUTE: Attribute indicating a context that contains * Compute jobs. * @KBASEP_JS_CTX_ATTR_NON_COMPUTE: Attribute indicating a context that contains - * Non-Compute jobs. + * Non-Compute jobs. * @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. + * contains compute-job atoms that aren't + * restricted to a coherent group, + * and can run on all cores. * @KBASEP_JS_CTX_ATTR_COUNT: Must be the last in the enum * * Each context attribute can be thought of as a boolean value that caches some @@ -115,7 +116,6 @@ typedef void kbasep_js_ctx_job_cb(struct kbase_device *kbdev, * BASE_JD_REQ_COHERENT_GROUP set. This is an unlikely case, but it's easy * enough to handle anyway. * - * */ enum kbasep_js_ctx_attr { KBASEP_JS_CTX_ATTR_COMPUTE, @@ -217,44 +217,46 @@ typedef u32 kbase_atom_ordering_flag_t; /** * struct kbasep_js_device_data - KBase Device Data Job Scheduler sub-structure * @runpool_irq: Sub-structure to collect together Job Scheduling data used in - * IRQ context. The hwaccess_lock must be held when accessing. + * IRQ context. The hwaccess_lock must be held when accessing. * @runpool_irq.submit_allowed: Bitvector indicating whether a currently - * scheduled context is allowed to submit jobs. When bit 'N' is set in - * this, it indicates whether the context bound to address space 'N' is - * allowed to submit jobs. + * scheduled context is allowed to submit jobs. + * When bit 'N' is set in this, it indicates whether + * the context bound to address space 'N' is + * allowed to submit jobs. * @runpool_irq.ctx_attr_ref_count: Array of Context Attributes Ref_counters: - * Each is large enough to hold a refcount of the number of contexts - * that can fit into the runpool. This is currently BASE_MAX_NR_AS. - * Note that when BASE_MAX_NR_AS==16 we need 5 bits (not 4) to store - * the refcount. Hence, it's not worthwhile reducing this to - * bit-manipulation on u32s to save space (where in contrast, 4 bit - * sub-fields would be easy to do and would save space). - * Whilst this must not become negative, the sign bit is used for: - * - error detection in debug builds - * - Optimization: it is undefined for a signed int to overflow, and so - * the compiler can optimize for that never happening (thus, no masking - * is required on updating the variable) + * Each is large enough to hold a refcount of the number of contexts + * that can fit into the runpool. This is currently BASE_MAX_NR_AS. + * Note that when BASE_MAX_NR_AS==16 we need 5 bits (not 4) to store + * the refcount. Hence, it's not worthwhile reducing this to + * bit-manipulation on u32s to save space (where in contrast, 4 bit + * sub-fields would be easy to do and would save space). + * Whilst this must not become negative, the sign bit is used for: + * - error detection in debug builds + * - Optimization: it is undefined for a signed int to overflow, and so + * the compiler can optimize for that never happening (thus, no masking + * is required on updating the variable) * @runpool_irq.slot_affinities: Affinity management and tracking. Bitvector - * to aid affinity checking. Element 'n' bit 'i' indicates that slot 'n' - * is using core i (i.e. slot_affinity_refcount[n][i] > 0) + * to aid affinity checking. + * Element 'n' bit 'i' indicates that slot 'n' + * is using core i (i.e. slot_affinity_refcount[n][i] > 0) * @runpool_irq.slot_affinity_refcount: Array of fefcount for each core owned - * by each slot. Used to generate the slot_affinities array of bitvectors. - * The value of the refcount will not exceed BASE_JM_SUBMIT_SLOTS, - * because it is refcounted only when a job is definitely about to be - * submitted to a slot, and is de-refcounted immediately after a job - * finishes + * by each slot. Used to generate the slot_affinities array of bitvectors. + * The value of the refcount will not exceed BASE_JM_SUBMIT_SLOTS, + * because it is refcounted only when a job is definitely about to be + * submitted to a slot, and is de-refcounted immediately after a job + * finishes * @schedule_sem: Scheduling semaphore. This must be held when calling - * kbase_jm_kick() + * kbase_jm_kick() * @ctx_list_pullable: List of contexts that can currently be pulled from * @ctx_list_unpullable: List of contexts that can not currently be pulled - * from, but have jobs currently running. + * from, but have jobs currently running. * @nr_user_contexts_running: Number of currently scheduled user contexts - * (excluding ones that are not submitting jobs) + * (excluding ones that are not submitting jobs) * @nr_all_contexts_running: Number of currently scheduled contexts (including - * ones that are not submitting jobs) + * ones that are not submitting jobs) * @js_reqs: Core Requirements to match up with base_js_atom's core_req memeber - * @note This is a write-once member, and so no locking is required to - * read + * @note This is a write-once member, and so no locking is required to + * read * @scheduling_period_ns: Value for JS_SCHEDULING_PERIOD_NS * @soft_stop_ticks: Value for JS_SOFT_STOP_TICKS * @soft_stop_ticks_cl: Value for JS_SOFT_STOP_TICKS_CL @@ -268,16 +270,16 @@ typedef u32 kbase_atom_ordering_flag_t; * @suspended_soft_jobs_list: List of suspended soft jobs * @softstop_always: Support soft-stop on a single context * @init_status:The initialized-flag is placed at the end, to avoid - * cache-pollution (we should only be using this during init/term paths). - * @note This is a write-once member, and so no locking is required to - * read + * cache-pollution (we should only be using this during init/term paths). + * @note This is a write-once member, and so no locking is required to + * read * @nr_contexts_pullable:Number of contexts that can currently be pulled from * @nr_contexts_runnable:Number of contexts that can either be pulled from or - * arecurrently running + * arecurrently running * @soft_job_timeout_ms:Value for JS_SOFT_JOB_TIMEOUT * @queue_mutex: Queue Lock, used to access the Policy's queue of contexts - * independently of the Run Pool. - * Of course, you don't need the Run Pool lock to access this. + * independently of the Run Pool. + * Of course, you don't need the Run Pool lock to access this. * @runpool_mutex: Run Pool mutex, for managing contexts within the runpool. * * This encapsulates the current context of the Job Scheduler on a particular |