drm/amdgpu: get gpu info from ip discovery table

Submitted by Yuan, Xiaojie on Sept. 11, 2019, 9:56 a.m.

Details

Message ID 20190911095615.12055-1-xiaojie.yuan@amd.com
State New
Headers show
Series "drm/amdgpu: get gpu info from ip discovery table" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Yuan, Xiaojie Sept. 11, 2019, 9:56 a.m.
except soc_bounding_box which is not integrated in discovery table yet

Signed-off-by: Xiaojie Yuan <xiaojie.yuan@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Patch hide | download patch | download mbox

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 13bd6a6bd8aa..70e0f24d37a8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1474,6 +1474,9 @@  static int amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev)
 			(const struct gpu_info_firmware_v1_0 *)(adev->firmware.gpu_info_fw->data +
 								le32_to_cpu(hdr->header.ucode_array_offset_bytes));
 
+		if (amdgpu_discovery && adev->asic_type >= CHIP_NAVI10)
+			goto parse_soc_bounding_box;
+
 		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);
@@ -1501,7 +1504,13 @@  static int amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev)
 			adev->gfx.config.num_packer_per_sc =
 				le32_to_cpu(gpu_info_fw->num_packer_per_sc);
 		}
+
+parse_soc_bounding_box:
 #ifdef CONFIG_DRM_AMD_DC_DCN2_0
+		/*
+		 * soc bounding box info is not integrated in disocovery table,
+		 * we always need to parse it from gpu info firmware.
+		 */
 		if (hdr->version_minor == 2) {
 			const struct gpu_info_firmware_v1_2 *gpu_info_fw =
 				(const struct gpu_info_firmware_v1_2 *)(adev->firmware.gpu_info_fw->data +
@@ -1618,6 +1627,9 @@  static int amdgpu_device_ip_early_init(struct amdgpu_device *adev)
 	if (r)
 		return r;
 
+	if (amdgpu_discovery && adev->asic_type >= CHIP_NAVI10)
+		amdgpu_discovery_get_gfx_info(adev);
+
 	amdgpu_amdkfd_device_probe(adev);
 
 	if (amdgpu_sriov_vf(adev)) {

Comments

On Wed, Sep 11, 2019 at 5:56 AM Yuan, Xiaojie <Xiaojie.Yuan@amd.com> wrote:
>
> except soc_bounding_box which is not integrated in discovery table yet
>
> Signed-off-by: Xiaojie Yuan <xiaojie.yuan@amd.com>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 13bd6a6bd8aa..70e0f24d37a8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -1474,6 +1474,9 @@ static int amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev)
>                         (const struct gpu_info_firmware_v1_0 *)(adev->firmware.gpu_info_fw->data +
>                                                                 le32_to_cpu(hdr->header.ucode_array_offset_bytes));
>
> +               if (amdgpu_discovery && adev->asic_type >= CHIP_NAVI10)
> +                       goto parse_soc_bounding_box;
> +
>                 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);
> @@ -1501,7 +1504,13 @@ static int amdgpu_device_parse_gpu_info_fw(struct amdgpu_device *adev)
>                         adev->gfx.config.num_packer_per_sc =
>                                 le32_to_cpu(gpu_info_fw->num_packer_per_sc);
>                 }
> +
> +parse_soc_bounding_box:
>  #ifdef CONFIG_DRM_AMD_DC_DCN2_0
> +               /*
> +                * soc bounding box info is not integrated in disocovery table,
> +                * we always need to parse it from gpu info firmware.
> +                */
>                 if (hdr->version_minor == 2) {
>                         const struct gpu_info_firmware_v1_2 *gpu_info_fw =
>                                 (const struct gpu_info_firmware_v1_2 *)(adev->firmware.gpu_info_fw->data +
> @@ -1618,6 +1627,9 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev)
>         if (r)
>                 return r;
>
> +       if (amdgpu_discovery && adev->asic_type >= CHIP_NAVI10)
> +               amdgpu_discovery_get_gfx_info(adev);
> +
>         amdgpu_amdkfd_device_probe(adev);
>
>         if (amdgpu_sriov_vf(adev)) {
> --
> 2.20.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx