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

drm/amdgpu: support for gc_info table v1.3

Add gc_info table v1.3 for IP discovery.

Signed-off-by: Likun Gao <Likun.Gao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Likun Gao and committed by
Alex Deucher
875ff9a7 73dd0ad9

+59
+11
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
··· 1500 1500 struct gc_info_v1_0 v1; 1501 1501 struct gc_info_v1_1 v1_1; 1502 1502 struct gc_info_v1_2 v1_2; 1503 + struct gc_info_v1_3 v1_3; 1503 1504 struct gc_info_v2_0 v2; 1504 1505 struct gc_info_v2_1 v2_1; 1505 1506 }; ··· 1558 1557 adev->gfx.config.gc_gl1c_per_sa = le32_to_cpu(gc_info->v1_2.gc_gl1c_per_sa); 1559 1558 adev->gfx.config.gc_gl1c_size_per_instance = le32_to_cpu(gc_info->v1_2.gc_gl1c_size_per_instance); 1560 1559 adev->gfx.config.gc_gl2c_per_gpu = le32_to_cpu(gc_info->v1_2.gc_gl2c_per_gpu); 1560 + } 1561 + if (le16_to_cpu(gc_info->v1.header.version_minor) >= 3) { 1562 + adev->gfx.config.gc_tcp_size_per_cu = le32_to_cpu(gc_info->v1_3.gc_tcp_size_per_cu); 1563 + adev->gfx.config.gc_tcp_cache_line_size = le32_to_cpu(gc_info->v1_3.gc_tcp_cache_line_size); 1564 + adev->gfx.config.gc_instruction_cache_size_per_sqc = le32_to_cpu(gc_info->v1_3.gc_instruction_cache_size_per_sqc); 1565 + adev->gfx.config.gc_instruction_cache_line_size = le32_to_cpu(gc_info->v1_3.gc_instruction_cache_line_size); 1566 + adev->gfx.config.gc_scalar_data_cache_size_per_sqc = le32_to_cpu(gc_info->v1_3.gc_scalar_data_cache_size_per_sqc); 1567 + adev->gfx.config.gc_scalar_data_cache_line_size = le32_to_cpu(gc_info->v1_3.gc_scalar_data_cache_line_size); 1568 + adev->gfx.config.gc_tcc_size = le32_to_cpu(gc_info->v1_3.gc_tcc_size); 1569 + adev->gfx.config.gc_tcc_cache_line_size = le32_to_cpu(gc_info->v1_3.gc_tcc_cache_line_size); 1561 1570 } 1562 1571 break; 1563 1572 case 2:
+6
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
··· 245 245 uint32_t gc_tcp_size_per_cu; 246 246 uint32_t gc_num_cu_per_sqc; 247 247 uint32_t gc_tcc_size; 248 + uint32_t gc_tcp_cache_line_size; 249 + uint32_t gc_instruction_cache_size_per_sqc; 250 + uint32_t gc_instruction_cache_line_size; 251 + uint32_t gc_scalar_data_cache_size_per_sqc; 252 + uint32_t gc_scalar_data_cache_line_size; 253 + uint32_t gc_tcc_cache_line_size; 248 254 }; 249 255 250 256 struct amdgpu_cu_info {
+42
drivers/gpu/drm/amd/include/discovery.h
··· 258 258 uint32_t gc_gl2c_per_gpu; 259 259 }; 260 260 261 + struct gc_info_v1_3 { 262 + struct gpu_info_header header; 263 + uint32_t gc_num_se; 264 + uint32_t gc_num_wgp0_per_sa; 265 + uint32_t gc_num_wgp1_per_sa; 266 + uint32_t gc_num_rb_per_se; 267 + uint32_t gc_num_gl2c; 268 + uint32_t gc_num_gprs; 269 + uint32_t gc_num_max_gs_thds; 270 + uint32_t gc_gs_table_depth; 271 + uint32_t gc_gsprim_buff_depth; 272 + uint32_t gc_parameter_cache_depth; 273 + uint32_t gc_double_offchip_lds_buffer; 274 + uint32_t gc_wave_size; 275 + uint32_t gc_max_waves_per_simd; 276 + uint32_t gc_max_scratch_slots_per_cu; 277 + uint32_t gc_lds_size; 278 + uint32_t gc_num_sc_per_se; 279 + uint32_t gc_num_sa_per_se; 280 + uint32_t gc_num_packer_per_sc; 281 + uint32_t gc_num_gl2a; 282 + uint32_t gc_num_tcp_per_sa; 283 + uint32_t gc_num_sdp_interface; 284 + uint32_t gc_num_tcps; 285 + uint32_t gc_num_tcp_per_wpg; 286 + uint32_t gc_tcp_l1_size; 287 + uint32_t gc_num_sqc_per_wgp; 288 + uint32_t gc_l1_instruction_cache_size_per_sqc; 289 + uint32_t gc_l1_data_cache_size_per_sqc; 290 + uint32_t gc_gl1c_per_sa; 291 + uint32_t gc_gl1c_size_per_instance; 292 + uint32_t gc_gl2c_per_gpu; 293 + uint32_t gc_tcp_size_per_cu; 294 + uint32_t gc_tcp_cache_line_size; 295 + uint32_t gc_instruction_cache_size_per_sqc; 296 + uint32_t gc_instruction_cache_line_size; 297 + uint32_t gc_scalar_data_cache_size_per_sqc; 298 + uint32_t gc_scalar_data_cache_line_size; 299 + uint32_t gc_tcc_size; 300 + uint32_t gc_tcc_cache_line_size; 301 + }; 302 + 261 303 struct gc_info_v2_0 { 262 304 struct gpu_info_header header; 263 305