summaryrefslogtreecommitdiff
path: root/mali_kbase/jm
diff options
context:
space:
mode:
authorJörg Wagner <jorwag@google.com>2022-12-15 14:01:25 +0000
committerJörg Wagner <jorwag@google.com>2022-12-15 16:27:59 +0000
commit9ff5b6f2510d94765def3cf7c1fda01e387cabab (patch)
treed455bcd53cca74df918b3dd0092e806fb29e1461 /mali_kbase/jm
parentc30533582604fe0365bc3ce4e9e8e19dec3109da (diff)
downloadgpu-9ff5b6f2510d94765def3cf7c1fda01e387cabab.tar.gz
Mali Valhall Android DDK r40p0-01eac0 KMD
Provenance: 056ded72d351d1bf6319f7b2b925496dd6ad304f (ipdelivery/EAC/v_r40p0) VX504X08X-BU-00000-r40p0-01eac0 - Valhall Android DDK VX504X08X-BU-60000-r40p0-01eac0 - Valhall Android Document Bundle VX504X08X-DC-11001-r40p0-01eac0 - Valhall Android DDK Software Errata VX504X08X-SW-99006-r40p0-01eac0 - Valhall Android Renderscript AOSP parts Change-Id: I6db6b45c73c5447dd246533246e65b5ef2c8872f
Diffstat (limited to 'mali_kbase/jm')
-rw-r--r--mali_kbase/jm/mali_kbase_jm_defs.h62
1 files changed, 23 insertions, 39 deletions
diff --git a/mali_kbase/jm/mali_kbase_jm_defs.h b/mali_kbase/jm/mali_kbase_jm_defs.h
index da81981..e431698 100644
--- a/mali_kbase/jm/mali_kbase_jm_defs.h
+++ b/mali_kbase/jm/mali_kbase_jm_defs.h
@@ -396,16 +396,21 @@ enum kbase_atom_exit_protected_state {
* sync through soft jobs and for the implicit
* synchronization required on access to external
* resources.
- * @dma_fence.fence_in: Input fence
+ * @dma_fence.fence_in: Points to the dma-buf input fence for this atom.
+ * The atom would complete only after the fence is
+ * signaled.
* @dma_fence.fence: Points to the dma-buf output fence for this atom.
+ * @dma_fence.fence_cb: The object that is passed at the time of adding the
+ * callback that gets invoked when @dma_fence.fence_in
+ * is signaled.
+ * @dma_fence.fence_cb_added: Flag to keep a track if the callback was successfully
+ * added for @dma_fence.fence_in, which is supposed to be
+ * invoked on the signaling of fence.
* @dma_fence.context: The dma-buf fence context number for this atom. A
* unique context number is allocated to each katom in
* the context on context creation.
* @dma_fence.seqno: The dma-buf fence sequence number for this atom. This
* is increased every time this katom uses dma-buf fence
- * @dma_fence.callbacks: List of all callbacks set up to wait on other fences
- * @dma_fence.dep_count: Atomic counter of number of outstandind dma-buf fence
- * dependencies for this atom.
* @event_code: Event code for the job chain represented by the atom,
* both HW and low-level SW events are represented by
* event codes.
@@ -512,16 +517,12 @@ struct kbase_jd_atom {
u32 device_nr;
u64 jc;
void *softjob_data;
-#if defined(CONFIG_SYNC)
- struct sync_fence *fence;
- struct sync_fence_waiter sync_waiter;
-#endif /* CONFIG_SYNC */
-#if defined(CONFIG_MALI_DMA_FENCE) || defined(CONFIG_SYNC_FILE)
+#if IS_ENABLED(CONFIG_SYNC_FILE)
struct {
/* Use the functions/API defined in mali_kbase_fence.h to
* when working with this sub struct
*/
-#if defined(CONFIG_SYNC_FILE)
+#if IS_ENABLED(CONFIG_SYNC_FILE)
#if (KERNEL_VERSION(4, 10, 0) > LINUX_VERSION_CODE)
struct fence *fence_in;
#else
@@ -544,38 +545,21 @@ struct kbase_jd_atom {
#else
struct dma_fence *fence;
#endif
+
+ /* This is the callback object that is registered for the fence_in.
+ * The callback is invoked when the fence_in is signaled.
+ */
+#if (KERNEL_VERSION(4, 10, 0) > LINUX_VERSION_CODE)
+ struct fence_cb fence_cb;
+#else
+ struct dma_fence_cb fence_cb;
+#endif
+ bool fence_cb_added;
+
unsigned int context;
atomic_t seqno;
- /* This contains a list of all callbacks set up to wait on
- * other fences. This atom must be held back from JS until all
- * these callbacks have been called and dep_count have reached
- * 0. The initial value of dep_count must be equal to the
- * number of callbacks on this list.
- *
- * This list is protected by jctx.lock. Callbacks are added to
- * this list when the atom is built and the wait are set up.
- * All the callbacks then stay on the list until all callbacks
- * have been called and the atom is queued, or cancelled, and
- * then all callbacks are taken off the list and freed.
- */
- struct list_head callbacks;
- /* Atomic counter of number of outstandind dma-buf fence
- * dependencies for this atom. When dep_count reaches 0 the
- * atom may be queued.
- *
- * The special value "-1" may only be set after the count
- * reaches 0, while holding jctx.lock. This indicates that the
- * atom has been handled, either queued in JS or cancelled.
- *
- * If anyone but the dma-fence worker sets this to -1 they must
- * ensure that any potentially queued worker must have
- * completed before allowing the atom to be marked as unused.
- * This can be done by flushing the fence work queue:
- * kctx->dma_fence.wq.
- */
- atomic_t dep_count;
} dma_fence;
-#endif /* CONFIG_MALI_DMA_FENCE || CONFIG_SYNC_FILE */
+#endif /* CONFIG_SYNC_FILE */
/* Note: refer to kbasep_js_atom_retained_state, which will take a copy
* of some of the following members