]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amdgpu: support for gc_info table v1.3
authorLikun Gao <Likun.Gao@amd.com>
Thu, 22 Aug 2024 03:44:12 +0000 (11:44 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 28 Aug 2024 14:05:54 +0000 (10:05 -0400)
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>
(cherry picked from commit 875ff9a7ee8824200885384effa7743892a34ed6)

drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.h
drivers/gpu/drm/amd/include/discovery.h

index 7b561e8e3cafc004b6ac808e09950494373f8a6b..4bd61c169ca8d4b4319d62f177af252dd7ea0c5e 100644 (file)
@@ -1500,6 +1500,7 @@ union gc_info {
        struct gc_info_v1_0 v1;
        struct gc_info_v1_1 v1_1;
        struct gc_info_v1_2 v1_2;
+       struct gc_info_v1_3 v1_3;
        struct gc_info_v2_0 v2;
        struct gc_info_v2_1 v2_1;
 };
@@ -1558,6 +1559,16 @@ static int amdgpu_discovery_get_gfx_info(struct amdgpu_device *adev)
                        adev->gfx.config.gc_gl1c_size_per_instance = le32_to_cpu(gc_info->v1_2.gc_gl1c_size_per_instance);
                        adev->gfx.config.gc_gl2c_per_gpu = le32_to_cpu(gc_info->v1_2.gc_gl2c_per_gpu);
                }
+               if (le16_to_cpu(gc_info->v1.header.version_minor) >= 3) {
+                       adev->gfx.config.gc_tcp_size_per_cu = le32_to_cpu(gc_info->v1_3.gc_tcp_size_per_cu);
+                       adev->gfx.config.gc_tcp_cache_line_size = le32_to_cpu(gc_info->v1_3.gc_tcp_cache_line_size);
+                       adev->gfx.config.gc_instruction_cache_size_per_sqc = le32_to_cpu(gc_info->v1_3.gc_instruction_cache_size_per_sqc);
+                       adev->gfx.config.gc_instruction_cache_line_size = le32_to_cpu(gc_info->v1_3.gc_instruction_cache_line_size);
+                       adev->gfx.config.gc_scalar_data_cache_size_per_sqc = le32_to_cpu(gc_info->v1_3.gc_scalar_data_cache_size_per_sqc);
+                       adev->gfx.config.gc_scalar_data_cache_line_size = le32_to_cpu(gc_info->v1_3.gc_scalar_data_cache_line_size);
+                       adev->gfx.config.gc_tcc_size = le32_to_cpu(gc_info->v1_3.gc_tcc_size);
+                       adev->gfx.config.gc_tcc_cache_line_size = le32_to_cpu(gc_info->v1_3.gc_tcc_cache_line_size);
+               }
                break;
        case 2:
                adev->gfx.config.max_shader_engines = le32_to_cpu(gc_info->v2.gc_num_se);
index ddda94e49db44a4bb9476a81c505fc63e9749210..56cc58edbb4e9a03910442f3ec05d8ebe8c1ed8d 100644 (file)
@@ -240,6 +240,12 @@ struct amdgpu_gfx_config {
        uint32_t gc_tcp_size_per_cu;
        uint32_t gc_num_cu_per_sqc;
        uint32_t gc_tcc_size;
+       uint32_t gc_tcp_cache_line_size;
+       uint32_t gc_instruction_cache_size_per_sqc;
+       uint32_t gc_instruction_cache_line_size;
+       uint32_t gc_scalar_data_cache_size_per_sqc;
+       uint32_t gc_scalar_data_cache_line_size;
+       uint32_t gc_tcc_cache_line_size;
 };
 
 struct amdgpu_cu_info {
index 46bf19c9c5c40a6a715fb52ba9af51461b1a20bc..710e328fad48f3ca01afe57cdbd992aa9c98e532 100644 (file)
@@ -258,6 +258,48 @@ struct gc_info_v1_2 {
        uint32_t gc_gl2c_per_gpu;
 };
 
+struct gc_info_v1_3 {
+    struct gpu_info_header header;
+    uint32_t gc_num_se;
+    uint32_t gc_num_wgp0_per_sa;
+    uint32_t gc_num_wgp1_per_sa;
+    uint32_t gc_num_rb_per_se;
+    uint32_t gc_num_gl2c;
+    uint32_t gc_num_gprs;
+    uint32_t gc_num_max_gs_thds;
+    uint32_t gc_gs_table_depth;
+    uint32_t gc_gsprim_buff_depth;
+    uint32_t gc_parameter_cache_depth;
+    uint32_t gc_double_offchip_lds_buffer;
+    uint32_t gc_wave_size;
+    uint32_t gc_max_waves_per_simd;
+    uint32_t gc_max_scratch_slots_per_cu;
+    uint32_t gc_lds_size;
+    uint32_t gc_num_sc_per_se;
+    uint32_t gc_num_sa_per_se;
+    uint32_t gc_num_packer_per_sc;
+    uint32_t gc_num_gl2a;
+    uint32_t gc_num_tcp_per_sa;
+    uint32_t gc_num_sdp_interface;
+    uint32_t gc_num_tcps;
+    uint32_t gc_num_tcp_per_wpg;
+    uint32_t gc_tcp_l1_size;
+    uint32_t gc_num_sqc_per_wgp;
+    uint32_t gc_l1_instruction_cache_size_per_sqc;
+    uint32_t gc_l1_data_cache_size_per_sqc;
+    uint32_t gc_gl1c_per_sa;
+    uint32_t gc_gl1c_size_per_instance;
+    uint32_t gc_gl2c_per_gpu;
+    uint32_t gc_tcp_size_per_cu;
+    uint32_t gc_tcp_cache_line_size;
+    uint32_t gc_instruction_cache_size_per_sqc;
+    uint32_t gc_instruction_cache_line_size;
+    uint32_t gc_scalar_data_cache_size_per_sqc;
+    uint32_t gc_scalar_data_cache_line_size;
+    uint32_t gc_tcc_size;
+    uint32_t gc_tcc_cache_line_size;
+};
+
 struct gc_info_v2_0 {
        struct gpu_info_header header;