Re: [PATCH 04/66] drm/amdgpu: fill in IP versions from IP discovery table
[AMD Official Use Only] Fixed locally. Thanks! Alex From: Kuehling, Felix Sent: Wednesday, September 22, 2021 12:58 PM To: Deucher, Alexander ; amd-gfx@lists.freedesktop.org Subject: Re: [PATCH 04/66] drm/amdgpu: fill in IP versions from IP discovery table 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 > --- > 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);
Re: [PATCH 04/66] drm/amdgpu: fill in IP versions from IP discovery table
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 > --- > 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);
[PATCH 04/66] drm/amdgpu: fill in IP versions from IP discovery table
Prerequisite for using IP versions in the driver rather than asic type. Signed-off-by: Alex Deucher --- 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; +} + 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); -- 2.31.1