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

Alex Deucher alexander.deucher at amd.com
Tue Sep 21 18:06:23 UTC 2021


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;
+}
+
 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



More information about the amd-gfx mailing list