Re: [PATCH] drm/amdgpu: Add CU info print log
[AMD Official Use Only - Internal Distribution Only] Reviewed-by: Alex Deucher From: amd-gfx on behalf of Yong Zhao Sent: Wednesday, December 11, 2019 6:09 PM To: amd-gfx@lists.freedesktop.org Cc: Zhao, Yong Subject: [PATCH] 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 --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 8992506541d8..c778b6db5e42 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -3032,6 +3032,12 @@ int amdgpu_device_init(struct amdgpu_device *adev, goto failed; } + DRM_DEBUG("SE %d, SH per SE %d, CU per SH %d, active_cu_number %d\n", + adev->gfx.config.max_shader_engines, + adev->gfx.config.max_sh_per_se, + adev->gfx.config.max_cu_per_sh, + adev->gfx.cu_info.number); + adev->accel_working = true; amdgpu_vm_check_compute_bug(adev); -- 2.17.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7Ca823e1d397ec41ec64f208d77e8f47bb%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637117026245492516&sdata=rqL98htPP6x%2BufHyGCzVo65Zib7x3%2BdEPz83uNHzMx0%3D&reserved=0 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
[PATCH] 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 --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 8992506541d8..c778b6db5e42 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -3032,6 +3032,12 @@ int amdgpu_device_init(struct amdgpu_device *adev, goto failed; } + DRM_DEBUG("SE %d, SH per SE %d, CU per SH %d, active_cu_number %d\n", + adev->gfx.config.max_shader_engines, + adev->gfx.config.max_sh_per_se, + adev->gfx.config.max_cu_per_sh, + adev->gfx.cu_info.number); + adev->accel_working = true; amdgpu_vm_check_compute_bug(adev); -- 2.17.1 ___ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Re: [PATCH] drm/amdgpu: Add CU info print log
On Wed, Dec 11, 2019 at 3:26 PM Yong Zhao wrote: > > 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 > Change-Id: Ic1c914938aa3445d8dbfdf6a237bc1d58b0d5267 > Signed-off-by: Yong Zhao > --- > 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(+) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > index 8992506541d8..df9732510012 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c > @@ -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); > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c > b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c > index f95092741c38..8001a067700c 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c > @@ -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); > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c > b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c > index 8cdef79de9d4..a26892e71680 100644 > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c > @@ -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; > } > > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c > b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c > index 95bb2422b27c..bb05a94690d2 100644 > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c > @@ -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 = > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c > b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c > index 648d767d14e7..6d16216d5c7c 100644 > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c > @@ -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 = > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c > b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c > index 8b9f440688ed..1073eb5c3cec 100644 > --- a/drivers/gpu/drm/amd/am
[PATCH] 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 --- 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(+) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 8992506541d8..df9732510012 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -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); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c index f95092741c38..8001a067700c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c @@ -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); diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c index 8cdef79de9d4..a26892e71680 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c @@ -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; } diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c index 95bb2422b27c..bb05a94690d2 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c @@ -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 = diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c index 648d767d14e7..6d16216d5c7c 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c @@ -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 = diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c index 8b9f440688ed..1073eb5c3cec 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c @@ -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 = diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c