drm/amdgpu: Add CU info print log
Subsystems (2)
PATCH 1/1 drm/amdgpu: Add CU info print log
The log will be useful for easily getting the CU info on various emulation models or ASICs.
Change-Id Ic1c914938aa3445d8dbfdf6a237bc1d58b0d5267
Signed-off-by Yong Zhao <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 6 ++++++ drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 ++ drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 2 ++ drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 2 ++ drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 2 ++ drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 ++ 7 files changed, 22 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6 -0
@@ -1529,6 +1529,12 @@ static int amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev) adev->gfx.config.max_shader_engines =le32_to_cpu (gpu_info_fw->gc_num_se); adev->gfx.config.max_cu_per_sh =le32_to_cpu (gpu_info_fw->gc_num_cu_per_sh); adev->gfx.config.max_sh_per_se =le32_to_cpu (gpu_info_fw->gc_num_sh_per_se); + +DRM_INFO ("gpu_info: SE %d, SH per SE %d, CU per SH %d\n" , + adev->gfx.config.max_shader_engines, + adev->gfx.config.max_sh_per_se, + adev->gfx.config.max_cu_per_sh); + adev->gfx.config.max_backends_per_se =le32_to_cpu (gpu_info_fw->gc_num_rb_per_se); adev->gfx.config.max_texture_channel_caches =le32_to_cpu (gpu_info_fw->gc_num_tccs);
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +6 -0
@@ -388,6 +388,12 @@ int amdgpu_discovery_get_gfx_info(struct amdgpu_device *adev) adev->gfx.config.max_cu_per_sh =2 * (le32_to_cpu (gc_info->gc_num_wgp0_per_sa) +le32_to_cpu (gc_info->gc_num_wgp1_per_sa)); adev->gfx.config.max_sh_per_se =le32_to_cpu (gc_info->gc_num_sa_per_se); + +DRM_INFO ("discovery: SE %d, SH per SE %d, CU per SH %d\n" , + adev->gfx.config.max_shader_engines, + adev->gfx.config.max_sh_per_se, + adev->gfx.config.max_cu_per_sh); + adev->gfx.config.max_backends_per_se =le32_to_cpu (gc_info->gc_num_rb_per_se); adev->gfx.config.max_texture_channel_caches =le32_to_cpu (gc_info->gc_num_gl2c); adev->gfx.config.max_gprs =le32_to_cpu (gc_info->gc_num_gprs);
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +2 -0
@@ -5432,6 +5432,8 @@ static int gfx_v10_0_get_cu_info(struct amdgpu_device *adev, cu_info->ao_cu_mask = ao_cu_mask; cu_info->simd_per_cu =NUM_SIMD_PER_CU ; +DRM_INFO ("active_cu_number: %d\n" , cu_info->number); +return 0 ; }
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c +2 -0
@@ -3620,6 +3620,8 @@ static void gfx_v6_0_get_cu_info(struct amdgpu_device *adev) cu_info->number = active_cu_number; cu_info->ao_cu_mask = ao_cu_mask; + +DRM_INFO ("active_cu_number: %d\n" , cu_info->number); } const struct amdgpu_ip_block_version gfx_v6_0_ip_block =
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c +2 -0
@@ -5159,6 +5159,8 @@ static void gfx_v7_0_get_cu_info(struct amdgpu_device *adev) cu_info->max_scratch_slots_per_cu =32 ; cu_info->wave_front_size =64 ; cu_info->lds_size =64 ; + +DRM_INFO ("active_cu_number: %d\n" , cu_info->number); } const struct amdgpu_ip_block_version gfx_v7_0_ip_block =
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +2 -0
@@ -7141,6 +7141,8 @@ static void gfx_v8_0_get_cu_info(struct amdgpu_device *adev) cu_info->max_scratch_slots_per_cu =32 ; cu_info->wave_front_size =64 ; cu_info->lds_size =64 ; + +DRM_INFO ("active_cu_number: %d\n" , cu_info->number); } const struct amdgpu_ip_block_version gfx_v8_0_ip_block =
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2 -0
@@ -6562,6 +6562,8 @@ static int gfx_v9_0_get_cu_info(struct amdgpu_device *adev, cu_info->ao_cu_mask = ao_cu_mask; cu_info->simd_per_cu =NUM_SIMD_PER_CU ; +DRM_INFO ("active_cu_number: %d\n" , cu_info->number); +return 0 ; }
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 4 lines · Yong Zhao
The log will be useful for easily getting the CU info on various emulation models or ASICs.
You can probably just put this all in once place at the end of init rather than sprinkling the print statements across all the IP modules. Also, can we make it debug only? Our driver is already pretty chatty.
Alex
Quoted 114 lines
Change-Id Ic1c914938aa3445d8dbfdf6a237bc1d58b0d5267Signed-off-by Yong Zhao <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 6 ++++++ drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 ++ drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c | 2 ++ drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 2 ++ drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 2 ++ drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 2 ++ 7 files changed, 22 insertions(+)drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +6
-0@@ -1529,6 +1529,12 @@ static int amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev) adev->gfx.config.max_shader_engines =le32_to_cpu (gpu_info_fw->gc_num_se); adev->gfx.config.max_cu_per_sh =le32_to_cpu (gpu_info_fw->gc_num_cu_per_sh); adev->gfx.config.max_sh_per_se =le32_to_cpu (gpu_info_fw->gc_num_sh_per_se); + +DRM_INFO ("gpu_info: SE %d, SH per SE %d, CU per SH %d\n" , + adev->gfx.config.max_shader_engines, + adev->gfx.config.max_sh_per_se, + adev->gfx.config.max_cu_per_sh); + adev->gfx.config.max_backends_per_se =le32_to_cpu (gpu_info_fw->gc_num_rb_per_se); adev->gfx.config.max_texture_channel_caches =le32_to_cpu (gpu_info_fw->gc_num_tccs);drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +6
-0@@ -388,6 +388,12 @@ int amdgpu_discovery_get_gfx_info(struct amdgpu_device *adev) adev->gfx.config.max_cu_per_sh =2 * (le32_to_cpu (gc_info->gc_num_wgp0_per_sa) +le32_to_cpu (gc_info->gc_num_wgp1_per_sa)); adev->gfx.config.max_sh_per_se =le32_to_cpu (gc_info->gc_num_sa_per_se); + +DRM_INFO ("discovery: SE %d, SH per SE %d, CU per SH %d\n" , + adev->gfx.config.max_shader_engines, + adev->gfx.config.max_sh_per_se, + adev->gfx.config.max_cu_per_sh); + adev->gfx.config.max_backends_per_se =le32_to_cpu (gc_info->gc_num_rb_per_se); adev->gfx.config.max_texture_channel_caches =le32_to_cpu (gc_info->gc_num_gl2c); adev->gfx.config.max_gprs =le32_to_cpu (gc_info->gc_num_gprs);drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +2
-0@@ -5432,6 +5432,8 @@ static int gfx_v10_0_get_cu_info(struct amdgpu_device *adev, cu_info->ao_cu_mask = ao_cu_mask; cu_info->simd_per_cu =NUM_SIMD_PER_CU ; +DRM_INFO ("active_cu_number: %d\n" , cu_info->number); +return 0 ; }drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c +2
-0@@ -3620,6 +3620,8 @@ static void gfx_v6_0_get_cu_info(struct amdgpu_device *adev) cu_info->number = active_cu_number; cu_info->ao_cu_mask = ao_cu_mask; + +DRM_INFO ("active_cu_number: %d\n" , cu_info->number); } const struct amdgpu_ip_block_version gfx_v6_0_ip_block =drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c +2
-0@@ -5159,6 +5159,8 @@ static void gfx_v7_0_get_cu_info(struct amdgpu_device *adev) cu_info->max_scratch_slots_per_cu =32 ; cu_info->wave_front_size =64 ; cu_info->lds_size =64 ; + +DRM_INFO ("active_cu_number: %d\n" , cu_info->number); } const struct amdgpu_ip_block_version gfx_v7_0_ip_block =drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +2
-0@@ -7141,6 +7141,8 @@ static void gfx_v8_0_get_cu_info(struct amdgpu_device *adev) cu_info->max_scratch_slots_per_cu =32 ; cu_info->wave_front_size =64 ; cu_info->lds_size =64 ; + +DRM_INFO ("active_cu_number: %d\n" , cu_info->number); } const struct amdgpu_ip_block_version gfx_v8_0_ip_block =drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2
-1@@ -6562,6 +6562,8 @@ static int gfx_v9_0_get_cu_info(struct amdgpu_device *adev, cu_info->ao_cu_mask = ao_cu_mask; cu_info->simd_per_cu =NUM_SIMD_PER_CU ; +DRM_INFO ("active_cu_number: %d\n" , cu_info->number); +return 0 ; } --2.17.1
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx