• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /*
3  *
4  * (C) COPYRIGHT 2021 ARM Limited. All rights reserved.
5  *
6  * This program is free software and is provided to you under the terms of the
7  * GNU General Public License version 2 as published by the Free Software
8  * Foundation, and any use by you of this program is subject to the terms
9  * of such GNU license.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, you can access it online at
18  * http://www.gnu.org/licenses/gpl-2.0.html.
19  *
20  */
21 
22 /*
23  * Dummy Model interface
24  */
25 
26 #ifndef _UAPI_KBASE_MODEL_DUMMY_H_
27 #define _UAPI_KBASE_MODEL_DUMMY_H_
28 
29 #include <linux/types.h>
30 
31 #define KBASE_DUMMY_MODEL_COUNTER_HEADER_DWORDS (4)
32 #define KBASE_DUMMY_MODEL_COUNTER_PER_CORE      (60)
33 #define KBASE_DUMMY_MODEL_COUNTERS_PER_BIT      (4)
34 #define KBASE_DUMMY_MODEL_COUNTER_ENABLED(enable_mask, ctr_idx) \
35 	(enable_mask & (1 << (ctr_idx / KBASE_DUMMY_MODEL_COUNTERS_PER_BIT)))
36 
37 #define KBASE_DUMMY_MODEL_HEADERS_PER_BLOCK 4
38 #define KBASE_DUMMY_MODEL_COUNTERS_PER_BLOCK 60
39 #define KBASE_DUMMY_MODEL_VALUES_PER_BLOCK                                     \
40 	(KBASE_DUMMY_MODEL_COUNTERS_PER_BLOCK +                                \
41 	 KBASE_DUMMY_MODEL_HEADERS_PER_BLOCK)
42 #define KBASE_DUMMY_MODEL_BLOCK_SIZE                                           \
43 	(KBASE_DUMMY_MODEL_VALUES_PER_BLOCK * sizeof(__u32))
44 #define KBASE_DUMMY_MODEL_MAX_MEMSYS_BLOCKS      8
45 #define KBASE_DUMMY_MODEL_MAX_SHADER_CORES       32
46 #define KBASE_DUMMY_MODEL_MAX_NUM_PERF_BLOCKS    \
47 	(1 + 1 + KBASE_DUMMY_MODEL_MAX_MEMSYS_BLOCKS + KBASE_DUMMY_MODEL_MAX_SHADER_CORES)
48 #define KBASE_DUMMY_MODEL_COUNTER_TOTAL                                        \
49 	(KBASE_DUMMY_MODEL_MAX_NUM_PERF_BLOCKS *                               \
50 	 KBASE_DUMMY_MODEL_COUNTER_PER_CORE)
51 
52 #define DUMMY_IMPLEMENTATION_SHADER_PRESENT (0xFull)
53 #define DUMMY_IMPLEMENTATION_TILER_PRESENT (0x1ull)
54 #define DUMMY_IMPLEMENTATION_L2_PRESENT (0x1ull)
55 #define DUMMY_IMPLEMENTATION_STACK_PRESENT (0xFull)
56 
57 #endif /* _UAPI_KBASE_MODEL_DUMMY_H_ */
58