drm/amdgpu: update amdgpu_discovery to handle revision
authorTianci.Yin <tianci.yin@amd.com>
Mon, 30 Sep 2019 05:10:03 +0000 (13:10 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 17 Oct 2019 20:31:06 +0000 (16:31 -0400)
update amdgpu_discovery to get IP revision.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Luben Tuikov <luben.tuikov@amd.com>
Signed-off-by: Tianci.Yin <tianci.yin@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.h

index 71198c5..ddd8364 100644 (file)
@@ -333,7 +333,7 @@ int amdgpu_discovery_reg_base_init(struct amdgpu_device *adev)
 }
 
 int amdgpu_discovery_get_ip_version(struct amdgpu_device *adev, int hw_id,
-                                   int *major, int *minor)
+                                   int *major, int *minor, int *revision)
 {
        struct binary_header *bhdr;
        struct ip_discovery_header *ihdr;
@@ -369,6 +369,8 @@ int amdgpu_discovery_get_ip_version(struct amdgpu_device *adev, int hw_id,
                                        *major = ip->major;
                                if (minor)
                                        *minor = ip->minor;
+                               if (revision)
+                                       *revision = ip->revision;
                                return 0;
                        }
                        ip_offset += sizeof(*ip) + 4 * (ip->num_base_address - 1);
index 5a6693d..ba78e15 100644 (file)
@@ -30,7 +30,7 @@ int amdgpu_discovery_init(struct amdgpu_device *adev);
 void amdgpu_discovery_fini(struct amdgpu_device *adev);
 int amdgpu_discovery_reg_base_init(struct amdgpu_device *adev);
 int amdgpu_discovery_get_ip_version(struct amdgpu_device *adev, int hw_id,
-                                    int *major, int *minor);
+                                    int *major, int *minor, int *revision);
 int amdgpu_discovery_get_gfx_info(struct amdgpu_device *adev);
 
 #endif /* __AMDGPU_DISCOVERY__ */