Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Signed-off-by: Tomeu Vizoso <tomeu@tomeuvizoso.net>
Acked-by: Christian Gmeiner <cgmeiner@igalia.com>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>

authored by

Tomeu Vizoso and committed by
Lucas Stach
1dccdba0 b0da0855

+71
+20
drivers/gpu/drm/etnaviv/etnaviv_gpu.c
··· 164 164 *value = gpu->identity.eco_id; 165 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 187 default: 168 188 DBG("%s: invalid param: %u", dev_name(gpu->dev), param); 169 189 return -EINVAL;
+12
drivers/gpu/drm/etnaviv/etnaviv_gpu.h
··· 54 54 /* Number of Neural Network cores. */ 55 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 69 /* Size of the vertex cache. */ 58 70 u32 vertex_cache_size; 59 71
+34
drivers/gpu/drm/etnaviv/etnaviv_hwdb.c
··· 17 17 .thread_count = 128, 18 18 .shader_core_count = 1, 19 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 24 .vertex_cache_size = 8, 21 25 .vertex_output_buffer_size = 1024, 22 26 .pixel_pipes = 1, ··· 52 48 .register_max = 64, 53 49 .thread_count = 256, 54 50 .shader_core_count = 1, 51 + .nn_core_count = 0, 52 + .nn_mad_per_core = 0, 53 + .tp_core_count = 0, 54 + .on_chip_sram_size = 0, 55 + .axi_sram_size = 0, 55 56 .vertex_cache_size = 8, 56 57 .vertex_output_buffer_size = 512, 57 58 .pixel_pipes = 1, ··· 89 80 .thread_count = 512, 90 81 .shader_core_count = 2, 91 82 .nn_core_count = 0, 83 + .nn_mad_per_core = 0, 84 + .tp_core_count = 0, 85 + .on_chip_sram_size = 0, 86 + .axi_sram_size = 0, 92 87 .vertex_cache_size = 16, 93 88 .vertex_output_buffer_size = 1024, 94 89 .pixel_pipes = 1, ··· 125 112 .thread_count = 512, 126 113 .shader_core_count = 2, 127 114 .nn_core_count = 0, 115 + .nn_mad_per_core = 0, 116 + .tp_core_count = 0, 117 + .on_chip_sram_size = 0, 118 + .axi_sram_size = 0, 128 119 .vertex_cache_size = 16, 129 120 .vertex_output_buffer_size = 1024, 130 121 .pixel_pipes = 1, ··· 160 143 .register_max = 64, 161 144 .thread_count = 512, 162 145 .shader_core_count = 2, 146 + .nn_core_count = 0, 147 + .nn_mad_per_core = 0, 148 + .tp_core_count = 0, 149 + .on_chip_sram_size = 0, 150 + .axi_sram_size = 0, 163 151 .vertex_cache_size = 16, 164 152 .vertex_output_buffer_size = 1024, 165 153 .pixel_pipes = 1, ··· 197 175 .thread_count = 1024, 198 176 .shader_core_count = 4, 199 177 .nn_core_count = 0, 178 + .nn_mad_per_core = 0, 179 + .tp_core_count = 0, 180 + .on_chip_sram_size = 0, 181 + .axi_sram_size = 0, 200 182 .vertex_cache_size = 16, 201 183 .vertex_output_buffer_size = 1024, 202 184 .pixel_pipes = 2, ··· 233 207 .thread_count = 256, 234 208 .shader_core_count = 1, 235 209 .nn_core_count = 8, 210 + .nn_mad_per_core = 64, 211 + .tp_core_count = 4, 212 + .on_chip_sram_size = 524288, 213 + .axi_sram_size = 1048576, 236 214 .vertex_cache_size = 16, 237 215 .vertex_output_buffer_size = 1024, 238 216 .pixel_pipes = 1, ··· 269 239 .thread_count = 256, 270 240 .shader_core_count = 1, 271 241 .nn_core_count = 6, 242 + .nn_mad_per_core = 64, 243 + .tp_core_count = 3, 244 + .on_chip_sram_size = 262144, 245 + .axi_sram_size = 0, 272 246 .vertex_cache_size = 16, 273 247 .vertex_output_buffer_size = 1024, 274 248 .pixel_pipes = 1,
+5
include/uapi/drm/etnaviv_drm.h
··· 77 77 #define ETNAVIV_PARAM_GPU_PRODUCT_ID 0x1c 78 78 #define ETNAVIV_PARAM_GPU_CUSTOMER_ID 0x1d 79 79 #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 86 #define ETNA_MAX_PIPES 4 82 87