]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amdgpu: allocate psp fw private buffer from VRAM for sriov vf
authorZhigang Luo <zhigang.luo@amd.com>
Wed, 2 Jun 2021 14:04:59 +0000 (10:04 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 8 Jun 2021 16:15:13 +0000 (12:15 -0400)
psp added new feature to check fw buffer address for sriov vf. the
address range must be in vf fb.

Signed-off-by: Zhigang Luo <zhigang.luo@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-By : Shaoyun.liu <shaoyunl@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

index e9f5010d732d2864ab90fd5c7237b0c693622555..1ecfe9008f4936bdd57da61a5ac566c95df8d889 100644 (file)
@@ -2329,11 +2329,20 @@ static int psp_load_fw(struct amdgpu_device *adev)
        if (!psp->cmd)
                return -ENOMEM;
 
-       ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
-                                       AMDGPU_GEM_DOMAIN_GTT,
-                                       &psp->fw_pri_bo,
-                                       &psp->fw_pri_mc_addr,
-                                       &psp->fw_pri_buf);
+       if (amdgpu_sriov_vf(adev)) {
+               ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
+                                               AMDGPU_GEM_DOMAIN_VRAM,
+                                               &psp->fw_pri_bo,
+                                               &psp->fw_pri_mc_addr,
+                                               &psp->fw_pri_buf);
+       } else {
+               ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
+                                               AMDGPU_GEM_DOMAIN_GTT,
+                                               &psp->fw_pri_bo,
+                                               &psp->fw_pri_mc_addr,
+                                               &psp->fw_pri_buf);
+       }
+
        if (ret)
                goto failed;