summaryrefslogtreecommitdiff
path: root/mali_kbase/jm
diff options
context:
space:
mode:
authorSidath Senanayake <sidaths@google.com>2021-01-29 15:03:53 +0000
committerSidath Senanayake <sidaths@google.com>2021-01-29 15:03:53 +0000
commit9748305a584b9f1f7705303ce6e33a5e8b923e60 (patch)
treea73788e1d912a3202db3a99018002e0858e9a948 /mali_kbase/jm
parent201c8bfb4637601363b6e9283f3bdc510711a226 (diff)
downloadgpu-9748305a584b9f1f7705303ce6e33a5e8b923e60.tar.gz
Mali Valhall DDK r29p0 KMD
Provenance: afaca8da1 (collaborate/EAC/v_r29p0) VX504X08X-BU-00000-r29p0-01eac0 - Valhall Android DDK VX504X08X-BU-60000-r29p0-01eac0 - Valhall Android Document Bundle VX504X08X-DC-11001-r29p0-01eac0 - Valhall Android DDK Software Errata VX504X08X-SW-99006-r29p0-01eac0 - Valhall Android Renderscript AOSP parts Signed-off-by: Sidath Senanayake <sidaths@google.com> Change-Id: Ie0904c9223b7ec9311b848a52d3159ac2b07530e
Diffstat (limited to 'mali_kbase/jm')
-rw-r--r--mali_kbase/jm/mali_base_jm_kernel.h28
-rw-r--r--mali_kbase/jm/mali_kbase_jm_defs.h25
-rw-r--r--mali_kbase/jm/mali_kbase_jm_ioctl.h32
-rw-r--r--mali_kbase/jm/mali_kbase_jm_js.h35
-rw-r--r--mali_kbase/jm/mali_kbase_js_defs.h71
5 files changed, 161 insertions, 30 deletions
diff --git a/mali_kbase/jm/mali_base_jm_kernel.h b/mali_kbase/jm/mali_base_jm_kernel.h
index ddac90a..de317eb 100644
--- a/mali_kbase/jm/mali_base_jm_kernel.h
+++ b/mali_kbase/jm/mali_base_jm_kernel.h
@@ -1,6 +1,6 @@
/*
*
- * (C) COPYRIGHT 2020 ARM Limited. All rights reserved.
+ * (C) COPYRIGHT 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
@@ -18,7 +18,27 @@
*
* SPDX-License-Identifier: GPL-2.0
*
+ *//* SPDX-License-Identifier: GPL-2.0 */
+/*
+ *
+ * (C) COPYRIGHT 2020 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
+ * Foundation, and any use by you of this program is subject to the terms
+ * of such GNU license.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you can access it online at
+ * http://www.gnu.org/licenses/gpl-2.0.html.
+ *
*/
+
#ifndef _BASE_JM_KERNEL_H_
#define _BASE_JM_KERNEL_H_
@@ -752,11 +772,15 @@ typedef u8 base_jd_prio;
#define BASE_JD_PRIO_HIGH ((base_jd_prio)1)
/* Low atom priority. */
#define BASE_JD_PRIO_LOW ((base_jd_prio)2)
+/* Real-Time atom priority. This is a priority higher than BASE_JD_PRIO_HIGH,
+ * BASE_JD_PRIO_MEDIUM, and BASE_JD_PRIO_LOW
+ */
+#define BASE_JD_PRIO_REALTIME ((base_jd_prio)3)
/* Count of the number of priority levels. This itself is not a valid
* base_jd_prio setting
*/
-#define BASE_JD_NR_PRIO_LEVELS 3
+#define BASE_JD_NR_PRIO_LEVELS 4
/**
* struct base_jd_atom_v2 - Node of a dependency graph used to submit a
diff --git a/mali_kbase/jm/mali_kbase_jm_defs.h b/mali_kbase/jm/mali_kbase_jm_defs.h
index 22e3fb3..2aeedad 100644
--- a/mali_kbase/jm/mali_kbase_jm_defs.h
+++ b/mali_kbase/jm/mali_kbase_jm_defs.h
@@ -1,6 +1,6 @@
/*
*
- * (C) COPYRIGHT 2020 ARM Limited. All rights reserved.
+ * (C) COPYRIGHT 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
@@ -18,10 +18,27 @@
*
* SPDX-License-Identifier: GPL-2.0
*
+ *//* SPDX-License-Identifier: GPL-2.0 */
+/*
+ *
+ * (C) COPYRIGHT 2020 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
+ * Foundation, and any use by you of this program is subject to the terms
+ * of such GNU license.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you can access it online at
+ * http://www.gnu.org/licenses/gpl-2.0.html.
+ *
*/
-
-
/*
* Definitions (types, defines, etcs) specific to Job Manager Kbase.
* They are placed here to allow the hierarchy of header files to work.
@@ -781,6 +798,7 @@ struct kbase_jd_renderpass {
* @jit_pending_alloc: A list of just-in-time memory allocation
* soft-jobs which will be reattempted after the
* impending free of other active allocations.
+ * @max_priority: Max priority level allowed for this context.
*/
struct kbase_jd_context {
struct mutex lock;
@@ -801,6 +819,7 @@ struct kbase_jd_context {
struct list_head jit_atoms_head;
struct list_head jit_pending_alloc;
+ int max_priority;
};
/**
diff --git a/mali_kbase/jm/mali_kbase_jm_ioctl.h b/mali_kbase/jm/mali_kbase_jm_ioctl.h
index 76ac278..7e2515b 100644
--- a/mali_kbase/jm/mali_kbase_jm_ioctl.h
+++ b/mali_kbase/jm/mali_kbase_jm_ioctl.h
@@ -1,6 +1,6 @@
/*
*
- * (C) COPYRIGHT 2020 ARM Limited. All rights reserved.
+ * (C) COPYRIGHT 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
@@ -18,6 +18,25 @@
*
* SPDX-License-Identifier: GPL-2.0
*
+ *//* SPDX-License-Identifier: GPL-2.0 */
+/*
+ *
+ * (C) COPYRIGHT 2020 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
+ * Foundation, and any use by you of this program is subject to the terms
+ * of such GNU license.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you can access it online at
+ * http://www.gnu.org/licenses/gpl-2.0.html.
+ *
*/
#ifndef _KBASE_JM_IOCTL_H_
@@ -114,9 +133,12 @@
* - Added kernel side cache ops needed hint
* 11.29:
* - Reserve ioctl 52
+ * 11.30:
+ * - Add a new priority level BASE_JD_PRIO_REALTIME
+ * - Add ioctl 54: This controls the priority setting.
*/
#define BASE_UK_VERSION_MAJOR 11
-#define BASE_UK_VERSION_MINOR 29
+#define BASE_UK_VERSION_MINOR 30
/**
* struct kbase_ioctl_version_check - Check version compatibility between
@@ -133,8 +155,6 @@ struct kbase_ioctl_version_check {
#define KBASE_IOCTL_VERSION_CHECK \
_IOWR(KBASE_IOCTL_TYPE, 0, struct kbase_ioctl_version_check)
-#define KBASE_IOCTL_VERSION_CHECK_RESERVED \
- _IOWR(KBASE_IOCTL_TYPE, 52, struct kbase_ioctl_version_check)
/**
* struct kbase_ioctl_job_submit - Submit jobs/atoms to the kernel
@@ -213,4 +233,8 @@ union kbase_kinstr_jm_fd {
#define KBASE_IOCTL_KINSTR_JM_FD \
_IOWR(KBASE_IOCTL_TYPE, 51, union kbase_kinstr_jm_fd)
+
+#define KBASE_IOCTL_VERSION_CHECK_RESERVED \
+ _IOWR(KBASE_IOCTL_TYPE, 52, struct kbase_ioctl_version_check)
+
#endif /* _KBASE_JM_IOCTL_H_ */
diff --git a/mali_kbase/jm/mali_kbase_jm_js.h b/mali_kbase/jm/mali_kbase_jm_js.h
index 6c222ce..6978b56 100644
--- a/mali_kbase/jm/mali_kbase_jm_js.h
+++ b/mali_kbase/jm/mali_kbase_jm_js.h
@@ -1,6 +1,6 @@
/*
*
- * (C) COPYRIGHT 2020 ARM Limited. All rights reserved.
+ * (C) COPYRIGHT 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
@@ -18,6 +18,25 @@
*
* SPDX-License-Identifier: GPL-2.0
*
+ *//* SPDX-License-Identifier: GPL-2.0 */
+/*
+ *
+ * (C) COPYRIGHT 2020-2021 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
+ * Foundation, and any use by you of this program is subject to the terms
+ * of such GNU license.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you can access it online at
+ * http://www.gnu.org/licenses/gpl-2.0.html.
+ *
*/
/*
@@ -584,7 +603,6 @@ void kbase_js_set_timeouts(struct kbase_device *kbdev);
*/
void kbase_js_set_ctx_priority(struct kbase_context *kctx, int new_priority);
-
/**
* kbase_js_update_ctx_priority - update the context priority
*
@@ -889,4 +907,17 @@ static inline base_jd_prio kbasep_js_sched_prio_to_atom_prio(int sched_prio)
return kbasep_js_relative_priority_to_atom[prio_idx];
}
+/**
+ * kbase_js_priority_check - Check the priority requested
+ *
+ * @kbdev: Device pointer
+ * @priority: Requested priority
+ *
+ * This will determine whether the requested priority can be satisfied.
+ *
+ * Return: The same or lower priority than requested.
+ */
+
+base_jd_prio kbase_js_priority_check(struct kbase_device *kbdev, base_jd_prio priority);
+
#endif /* _KBASE_JM_JS_H_ */
diff --git a/mali_kbase/jm/mali_kbase_js_defs.h b/mali_kbase/jm/mali_kbase_js_defs.h
index 0b48615..7a68f7a 100644
--- a/mali_kbase/jm/mali_kbase_js_defs.h
+++ b/mali_kbase/jm/mali_kbase_js_defs.h
@@ -1,6 +1,6 @@
/*
*
- * (C) COPYRIGHT 2011-2018, 2020 ARM Limited. All rights reserved.
+ * (C) COPYRIGHT 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
@@ -18,9 +18,27 @@
*
* SPDX-License-Identifier: GPL-2.0
*
+ *//* SPDX-License-Identifier: GPL-2.0 */
+/*
+ *
+ * (C) COPYRIGHT 2011-2018, 2020 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
+ * Foundation, and any use by you of this program is subject to the terms
+ * of such GNU license.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, you can access it online at
+ * http://www.gnu.org/licenses/gpl-2.0.html.
+ *
*/
-
/**
* @file mali_kbase_js.h
* Job Scheduler Type Definitions
@@ -51,7 +69,8 @@ struct kbase_jd_atom;
typedef u32 kbase_context_flags;
/** Callback function run on all of a context's jobs registered with the Job
- * Scheduler */
+ * Scheduler
+ */
typedef void (*kbasep_js_ctx_job_cb)(struct kbase_device *kbdev, struct kbase_jd_atom *katom);
/**
@@ -168,7 +187,8 @@ enum {
* Internal atom priority defines for kbase_jd_atom::sched_prio
*/
enum {
- KBASE_JS_ATOM_SCHED_PRIO_HIGH = 0,
+ KBASE_JS_ATOM_SCHED_PRIO_REALTIME = 0,
+ KBASE_JS_ATOM_SCHED_PRIO_HIGH,
KBASE_JS_ATOM_SCHED_PRIO_MED,
KBASE_JS_ATOM_SCHED_PRIO_LOW,
KBASE_JS_ATOM_SCHED_PRIO_COUNT,
@@ -198,7 +218,8 @@ enum {
*/
struct kbasep_js_device_data {
/* Sub-structure to collect together Job Scheduling data used in IRQ
- * context. The hwaccess_lock must be held when accessing. */
+ * context. The hwaccess_lock must be held when accessing.
+ */
struct runpool_irq {
/** 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
@@ -219,14 +240,17 @@ struct kbasep_js_device_data {
* - 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) */
+ * is required on updating the variable)
+ */
s8 ctx_attr_ref_count[KBASEP_JS_CTX_ATTR_COUNT];
/*
* 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) */
+ * that slot 'n' is using core i (i.e.
+ * slot_affinity_refcount[n][i] > 0)
+ */
u64 slot_affinities[BASE_JM_MAX_NR_SLOTS];
/** Refcount for each core owned by each slot. Used to generate the
* slot_affinities array of bitvectors
@@ -234,7 +258,8 @@ struct kbasep_js_device_data {
* 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 */
+ * finishes
+ */
s8 slot_affinity_refcount[BASE_JM_MAX_NR_SLOTS][64];
} runpool_irq;
@@ -260,7 +285,9 @@ struct kbasep_js_device_data {
s8 nr_all_contexts_running;
/** 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
+ */
base_jd_core_req js_reqs[BASE_JM_MAX_NR_SLOTS];
u32 scheduling_period_ns; /*< Value for JS_SCHEDULING_PERIOD_NS */
@@ -282,16 +309,19 @@ struct kbasep_js_device_data {
bool softstop_always;
#endif /* CONFIG_MALI_DEBUG */
- /** The initalized-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 */
+ /** 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
+ */
int init_status;
/* Number of contexts that can currently be pulled from */
u32 nr_contexts_pullable;
/* Number of contexts that can either be pulled from or are currently
- * running */
+ * running
+ */
atomic_t nr_contexts_runnable;
/** Value for JS_SOFT_JOB_TIMEOUT */
@@ -339,9 +369,10 @@ struct kbasep_js_kctx_info {
struct kbase_jsctx {
struct mutex jsctx_mutex; /**< Job Scheduler Context lock */
- /** Number of jobs <b>ready to run</b> - does \em not include the jobs waiting in
- * the dispatcher, and dependency-only jobs. See kbase_jd_context::job_nr
- * for such jobs*/
+ /** Number of jobs <b>ready to run</b> - does \em not include
+ * the jobs waiting in the dispatcher, and dependency-only
+ * jobs. See kbase_jd_context::job_nr for such jobs
+ */
u32 nr_jobs;
/** Context Attributes:
@@ -351,7 +382,7 @@ struct kbasep_js_kctx_info {
/**
* Wait queue to wait for KCTX_SHEDULED flag state changes.
- * */
+ */
wait_queue_head_t is_scheduled_wait;
/** Link implementing JS queues. Context can be present on one
@@ -361,13 +392,15 @@ struct kbasep_js_kctx_info {
} ctx;
/* The initalized-flag is placed at the end, to avoid cache-pollution (we should
- * only be using this during init/term paths) */
+ * only be using this during init/term paths)
+ */
int init_status;
};
/** Subset of atom state that can be available after jd_done_nolock() is called
* on that atom. A copy must be taken via kbasep_js_atom_retained_state_copy(),
- * because the original atom could disappear. */
+ * because the original atom could disappear.
+ */
struct kbasep_js_atom_retained_state {
/** Event code - to determine whether the atom has finished */
enum base_jd_event_code event_code;