hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/gpu/arm/bifrost/backend/gpu/mali_kbase_jm_defs.h
....@@ -1,7 +1,7 @@
11 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
22 /*
33 *
4
- * (C) COPYRIGHT 2014-2021 ARM Limited. All rights reserved.
4
+ * (C) COPYRIGHT 2014-2022 ARM Limited. All rights reserved.
55 *
66 * This program is free software and is provided to you under the terms of the
77 * GNU General Public License version 2 as published by the Free Software
....@@ -38,10 +38,32 @@
3838 struct kbase_jd_atom *katom;
3939 };
4040
41
+/* SLOT_RB_TAG_PURGED assumes a value that is different from
42
+ * NULL (SLOT_RB_NULL_TAG_VAL) and will not be the result of
43
+ * any valid pointer via macro translation: SLOT_RB_TAG_KCTX(x).
44
+ */
45
+#define SLOT_RB_TAG_PURGED ((u64)(1 << 1))
46
+#define SLOT_RB_NULL_TAG_VAL ((u64)0)
47
+
48
+/**
49
+ * SLOT_RB_TAG_KCTX() - a function-like macro for converting a pointer to a
50
+ * u64 for serving as tagged value.
51
+ * @kctx: Pointer to kbase context.
52
+ */
53
+#define SLOT_RB_TAG_KCTX(kctx) (u64)((uintptr_t)(kctx))
4154 /**
4255 * struct slot_rb - Slot ringbuffer
4356 * @entries: Ringbuffer entries
44
- * @last_context: The last context to submit a job on this slot
57
+ * @last_kctx_tagged: The last context that submitted a job to the slot's
58
+ * HEAD_NEXT register. The value is a tagged variant so
59
+ * must not be dereferenced. It is used in operation to
60
+ * track when shader core L1 caches might contain a
61
+ * previous context's data, and so must only be set to
62
+ * SLOT_RB_NULL_TAG_VAL after reset/powerdown of the
63
+ * cores. In slot job submission, if there is a kctx
64
+ * change, and the relevant katom is configured with
65
+ * BASE_JD_REQ_SKIP_CACHE_START, a L1 read only cache
66
+ * maintenace operation is enforced.
4567 * @read_idx: Current read index of buffer
4668 * @write_idx: Current write index of buffer
4769 * @job_chain_flag: Flag used to implement jobchain disambiguation
....@@ -49,7 +71,7 @@
4971 struct slot_rb {
5072 struct rb_entry entries[SLOT_RB_SIZE];
5173
52
- struct kbase_context *last_context;
74
+ u64 last_kctx_tagged;
5375
5476 u8 read_idx;
5577 u8 write_idx;