.. | .. |
---|
1 | 1 | /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ |
---|
2 | 2 | /* |
---|
3 | 3 | * |
---|
4 | | - * (C) COPYRIGHT 2014-2021 ARM Limited. All rights reserved. |
---|
| 4 | + * (C) COPYRIGHT 2014-2022 ARM Limited. All rights reserved. |
---|
5 | 5 | * |
---|
6 | 6 | * This program is free software and is provided to you under the terms of the |
---|
7 | 7 | * GNU General Public License version 2 as published by the Free Software |
---|
.. | .. |
---|
38 | 38 | struct kbase_jd_atom *katom; |
---|
39 | 39 | }; |
---|
40 | 40 | |
---|
| 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)) |
---|
41 | 54 | /** |
---|
42 | 55 | * struct slot_rb - Slot ringbuffer |
---|
43 | 56 | * @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. |
---|
45 | 67 | * @read_idx: Current read index of buffer |
---|
46 | 68 | * @write_idx: Current write index of buffer |
---|
47 | 69 | * @job_chain_flag: Flag used to implement jobchain disambiguation |
---|
.. | .. |
---|
49 | 71 | struct slot_rb { |
---|
50 | 72 | struct rb_entry entries[SLOT_RB_SIZE]; |
---|
51 | 73 | |
---|
52 | | - struct kbase_context *last_context; |
---|
| 74 | + u64 last_kctx_tagged; |
---|
53 | 75 | |
---|
54 | 76 | u8 read_idx; |
---|
55 | 77 | u8 write_idx; |
---|