drm/amdgpu: Fill adev->unique_id with data from PF2VF msg
authorJiawei Gu <Jiawei.Gu@amd.com>
Thu, 13 May 2021 06:17:58 +0000 (14:17 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 20 May 2021 02:33:58 +0000 (22:33 -0400)
Initialize unique_id from PF2VF under virtualization.

V2: skip smu_get_unique_id() under virtualization

Signed-off-by: Jiawei Gu <Jiawei.Gu@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c

index c64e583347c6bf27f433f1057396087a2572ef4a..b71dd1deeb2d374c2ebed5e049e01746c33988ff 100644 (file)
@@ -496,6 +496,8 @@ static int amdgpu_virt_read_pf2vf_data(struct amdgpu_device *adev)
                if((adev->virt.decode_max_dimension_pixels > 0) || (adev->virt.encode_max_dimension_pixels > 0))
                        adev->virt.is_mm_bw_enabled = true;
 
+               adev->unique_id =
+                       ((struct amd_sriov_msg_pf2vf_info *)pf2vf_info)->uuid;
                break;
        default:
                DRM_ERROR("invalid pf2vf version\n");
index 32dadeee9514895cd191f7a3e9852de524794e4a..9243e5de5bb722c5523c0b1e28c20ee14d0ede6c 100644 (file)
@@ -686,7 +686,8 @@ static int smu_late_init(void *handle)
                return ret;
        }
 
-       smu_get_unique_id(smu);
+       if (!amdgpu_sriov_vf(adev))
+               smu_get_unique_id(smu);
 
        smu_get_fan_parameters(smu);