History

drm/etnaviv: Expose a few more chipspecs to userspace

These ones will be needed to make use fo the NN and TP units in the NPUs based on Vivante IP. Also fix the number of NN cores in the VIPNano-qi.

Tomeu Vizoso committed 2 years ago

Commit 1dccdba1 parent b0da0854 files · +71 −0Browse files

Unified · Split

4 files
  1. drivers/gpu/drm/etnaviv/etnaviv_gpu.c +20 −0
  2. drivers/gpu/drm/etnaviv/etnaviv_gpu.h +12 −0
  3. drivers/gpu/drm/etnaviv/etnaviv_hwdb.c +34 −0
  4. include/uapi/drm/etnaviv_drm.h +5 −0
drivers/gpu/drm/etnaviv/etnaviv_gpu.c+20−0
@@ -164,6 +164,26 @@ int etnaviv_gpu_get_param(struct etnaviv_gpu *gpu, u32 param, u64 *value) · 163 unmodified lines
164 *value = gpu->identity.eco_id;164 *value = gpu->identity.eco_id;
165 break;165 break;
166 166
167 case ETNAVIV_PARAM_GPU_NN_CORE_COUNT:
168 *value = gpu->identity.nn_core_count;
169 break;
170
171 case ETNAVIV_PARAM_GPU_NN_MAD_PER_CORE:
172 *value = gpu->identity.nn_mad_per_core;
173 break;
174
175 case ETNAVIV_PARAM_GPU_TP_CORE_COUNT:
176 *value = gpu->identity.tp_core_count;
177 break;
178
179 case ETNAVIV_PARAM_GPU_ON_CHIP_SRAM_SIZE:
180 *value = gpu->identity.on_chip_sram_size;
181 break;
182
183 case ETNAVIV_PARAM_GPU_AXI_SRAM_SIZE:
184 *value = gpu->identity.axi_sram_size;
185 break;
186
167 default:187 default:
168 DBG("%s: invalid param: %u", dev_name(gpu->dev), param);188 DBG("%s: invalid param: %u", dev_name(gpu->dev), param);
169 return -EINVAL;189 return -EINVAL;
drivers/gpu/drm/etnaviv/etnaviv_gpu.h+12−0
@@ -54,6 +54,18 @@ struct etnaviv_chip_identity { · 53 unmodified lines
54 /* Number of Neural Network cores. */54 /* Number of Neural Network cores. */
55 u32 nn_core_count;55 u32 nn_core_count;
56 56
57 /* Number of MAD units per Neural Network core. */
58 u32 nn_mad_per_core;
59
60 /* Number of Tensor Processing cores. */
61 u32 tp_core_count;
62
63 /* Size in bytes of the SRAM inside the NPU. */
64 u32 on_chip_sram_size;
65
66 /* Size in bytes of the SRAM across the AXI bus. */
67 u32 axi_sram_size;
68
57 /* Size of the vertex cache. */69 /* Size of the vertex cache. */
58 u32 vertex_cache_size;70 u32 vertex_cache_size;
59 71
drivers/gpu/drm/etnaviv/etnaviv_hwdb.c+34−0
@@ -17,6 +17,10 @@ static const struct etnaviv_chip_identity etnaviv_chip_identities[] = { · 16 unmodified lines
17 .thread_count = 128,17 .thread_count = 128,
18 .shader_core_count = 1,18 .shader_core_count = 1,
19 .nn_core_count = 0,19 .nn_core_count = 0,
20 .nn_mad_per_core = 0,
21 .tp_core_count = 0,
22 .on_chip_sram_size = 0,
23 .axi_sram_size = 0,
20 .vertex_cache_size = 8,24 .vertex_cache_size = 8,
21 .vertex_output_buffer_size = 1024,25 .vertex_output_buffer_size = 1024,
22 .pixel_pipes = 1,26 .pixel_pipes = 1,
@@ -48,6 +52,11 @@ static const struct etnaviv_chip_identity etnaviv_chip_identities[] = { · 25 unmodified lines
48 .register_max = 64,52 .register_max = 64,
49 .thread_count = 256,53 .thread_count = 256,
50 .shader_core_count = 1,54 .shader_core_count = 1,
55 .nn_core_count = 0,
56 .nn_mad_per_core = 0,
57 .tp_core_count = 0,
58 .on_chip_sram_size = 0,
59 .axi_sram_size = 0,
51 .vertex_cache_size = 8,60 .vertex_cache_size = 8,
52 .vertex_output_buffer_size = 512,61 .vertex_output_buffer_size = 512,
53 .pixel_pipes = 1,62 .pixel_pipes = 1,
@@ -80,6 +89,10 @@ static const struct etnaviv_chip_identity etnaviv_chip_identities[] = { · 26 unmodified lines
80 .thread_count = 512,89 .thread_count = 512,
81 .shader_core_count = 2,90 .shader_core_count = 2,
82 .nn_core_count = 0,91 .nn_core_count = 0,
92 .nn_mad_per_core = 0,
93 .tp_core_count = 0,
94 .on_chip_sram_size = 0,
95 .axi_sram_size = 0,
83 .vertex_cache_size = 16,96 .vertex_cache_size = 16,
84 .vertex_output_buffer_size = 1024,97 .vertex_output_buffer_size = 1024,
85 .pixel_pipes = 1,98 .pixel_pipes = 1,
@@ -112,6 +125,10 @@ static const struct etnaviv_chip_identity etnaviv_chip_identities[] = { · 26 unmodified lines
112 .thread_count = 512,125 .thread_count = 512,
113 .shader_core_count = 2,126 .shader_core_count = 2,
114 .nn_core_count = 0,127 .nn_core_count = 0,
128 .nn_mad_per_core = 0,
129 .tp_core_count = 0,
130 .on_chip_sram_size = 0,
131 .axi_sram_size = 0,
115 .vertex_cache_size = 16,132 .vertex_cache_size = 16,
116 .vertex_output_buffer_size = 1024,133 .vertex_output_buffer_size = 1024,
117 .pixel_pipes = 1,134 .pixel_pipes = 1,
@@ -143,6 +160,11 @@ static const struct etnaviv_chip_identity etnaviv_chip_identities[] = { · 25 unmodified lines
143 .register_max = 64,160 .register_max = 64,
144 .thread_count = 512,161 .thread_count = 512,
145 .shader_core_count = 2,162 .shader_core_count = 2,
163 .nn_core_count = 0,
164 .nn_mad_per_core = 0,
165 .tp_core_count = 0,
166 .on_chip_sram_size = 0,
167 .axi_sram_size = 0,
146 .vertex_cache_size = 16,168 .vertex_cache_size = 16,
147 .vertex_output_buffer_size = 1024,169 .vertex_output_buffer_size = 1024,
148 .pixel_pipes = 1,170 .pixel_pipes = 1,
@@ -175,6 +197,10 @@ static const struct etnaviv_chip_identity etnaviv_chip_identities[] = { · 26 unmodified lines
175 .thread_count = 1024,197 .thread_count = 1024,
176 .shader_core_count = 4,198 .shader_core_count = 4,
177 .nn_core_count = 0,199 .nn_core_count = 0,
200 .nn_mad_per_core = 0,
201 .tp_core_count = 0,
202 .on_chip_sram_size = 0,
203 .axi_sram_size = 0,
178 .vertex_cache_size = 16,204 .vertex_cache_size = 16,
179 .vertex_output_buffer_size = 1024,205 .vertex_output_buffer_size = 1024,
180 .pixel_pipes = 2,206 .pixel_pipes = 2,
@@ -207,6 +233,10 @@ static const struct etnaviv_chip_identity etnaviv_chip_identities[] = { · 26 unmodified lines
207 .thread_count = 256,233 .thread_count = 256,
208 .shader_core_count = 1,234 .shader_core_count = 1,
209 .nn_core_count = 8,235 .nn_core_count = 8,
236 .nn_mad_per_core = 64,
237 .tp_core_count = 4,
238 .on_chip_sram_size = 524288,
239 .axi_sram_size = 1048576,
210 .vertex_cache_size = 16,240 .vertex_cache_size = 16,
211 .vertex_output_buffer_size = 1024,241 .vertex_output_buffer_size = 1024,
212 .pixel_pipes = 1,242 .pixel_pipes = 1,
@@ -239,6 +269,10 @@ static const struct etnaviv_chip_identity etnaviv_chip_identities[] = { · 26 unmodified lines
239 .thread_count = 256,269 .thread_count = 256,
240 .shader_core_count = 1,270 .shader_core_count = 1,
241 .nn_core_count = 6,271 .nn_core_count = 6,
272 .nn_mad_per_core = 64,
273 .tp_core_count = 3,
274 .on_chip_sram_size = 262144,
275 .axi_sram_size = 0,
242 .vertex_cache_size = 16,276 .vertex_cache_size = 16,
243 .vertex_output_buffer_size = 1024,277 .vertex_output_buffer_size = 1024,
244 .pixel_pipes = 1,278 .pixel_pipes = 1,
include/uapi/drm/etnaviv_drm.h+5−0
@@ -77,6 +77,11 @@ struct drm_etnaviv_timespec { · 76 unmodified lines
77#define ETNAVIV_PARAM_GPU_PRODUCT_ID 0x1c77#define ETNAVIV_PARAM_GPU_PRODUCT_ID 0x1c
78#define ETNAVIV_PARAM_GPU_CUSTOMER_ID 0x1d78#define ETNAVIV_PARAM_GPU_CUSTOMER_ID 0x1d
79#define ETNAVIV_PARAM_GPU_ECO_ID 0x1e79#define ETNAVIV_PARAM_GPU_ECO_ID 0x1e
80#define ETNAVIV_PARAM_GPU_NN_CORE_COUNT 0x1f
81#define ETNAVIV_PARAM_GPU_NN_MAD_PER_CORE 0x20
82#define ETNAVIV_PARAM_GPU_TP_CORE_COUNT 0x21
83#define ETNAVIV_PARAM_GPU_ON_CHIP_SRAM_SIZE 0x22
84#define ETNAVIV_PARAM_GPU_AXI_SRAM_SIZE 0x23
80 85
81#define ETNA_MAX_PIPES 486#define ETNA_MAX_PIPES 4
82 87

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t