[PATCH 04/66] drm/amdgpu: fill in IP versions from IP discovery table

Felix Kuehling felix.kuehling at amd.com
Wed Sep 22 16:58:16 UTC 2021


Am 2021-09-21 um 2:06 p.m. schrieb Alex Deucher:
> Prerequisite for using IP versions in the driver rather
> than asic type.
>
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> index 67e7a46f5020..ff52fcce1f93 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
> @@ -244,6 +244,11 @@ void amdgpu_discovery_fini(struct amdgpu_device *adev)
>  	adev->mman.discovery_bin = NULL;
>  }
>  
> +static u32 amdgpu_discovery_convert_version(u32 major, u32 minor, u32 revision)
> +{
> +	return (major << 16) | (minor << 8) | revision;

This does the same as the IP_VERSION macro defined in the previous
patch. Do you need this function at all?

Regards,
  Felix


> +}
> +
>  int amdgpu_discovery_reg_base_init(struct amdgpu_device *adev)
>  {
>  	struct binary_header *bhdr;
> @@ -316,8 +321,9 @@ int amdgpu_discovery_reg_base_init(struct amdgpu_device *adev)
>  							hw_id_names[le16_to_cpu(ip->hw_id)]);
>  					adev->reg_offset[hw_ip][ip->number_instance] =
>  						ip->base_address;
> +					adev->ip_versions[hw_ip] =
> +						amdgpu_discovery_convert_version(ip->major, ip->minor, ip->revision);
>  				}
> -
>  			}
>  
>  			ip_offset += sizeof(*ip) + 4 * (ip->num_base_address - 1);


More information about the amd-gfx mailing list