aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu
diff options
context:
space:
mode:
authorYintian Tao <yttao@amd.com>2019-05-16 01:07:26 -0400
committerAlex Deucher <alexander.deucher@amd.com>2019-05-20 13:59:45 -0400
commit057f91645cef412fe460b17fa50726c8a1c5921c (patch)
tree9af0b7342047f119494ef773570e16c1f2286d28 /drivers/gpu/drm/amd/amdgpu
parent029f41535ac5e07e1fa17ca963a9f9fd05fb665f (diff)
drm/amdgpu: skip fw pri bo alloc for SRIOV
PSP fw primary buffer is not used under SRIOV. Under SRIOV, VBIOS or hypervisor driver will load psp sos and psp sysdrv. Therefore, we don't need to allocate memory for it. v2: remove superfluous check for amdgpu_bo_free_kernel(). Signed-off-by: Yintian Tao <yttao@amd.com> Signed-off-by: Monk Liu <Monk.Liu@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
index 05897b05766b..86cc24b2e0aa 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
@@ -877,13 +877,16 @@ static int psp_load_fw(struct amdgpu_device *adev)
877 if (!psp->cmd) 877 if (!psp->cmd)
878 return -ENOMEM; 878 return -ENOMEM;
879 879
880 ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG, 880 /* this fw pri bo is not used under SRIOV */
881 AMDGPU_GEM_DOMAIN_GTT, 881 if (!amdgpu_sriov_vf(psp->adev)) {
882 &psp->fw_pri_bo, 882 ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
883 &psp->fw_pri_mc_addr, 883 AMDGPU_GEM_DOMAIN_GTT,
884 &psp->fw_pri_buf); 884 &psp->fw_pri_bo,
885 if (ret) 885 &psp->fw_pri_mc_addr,
886 goto failed; 886 &psp->fw_pri_buf);
887 if (ret)
888 goto failed;
889 }
887 890
888 ret = amdgpu_bo_create_kernel(adev, PSP_FENCE_BUFFER_SIZE, PAGE_SIZE, 891 ret = amdgpu_bo_create_kernel(adev, PSP_FENCE_BUFFER_SIZE, PAGE_SIZE,
889 AMDGPU_GEM_DOMAIN_VRAM, 892 AMDGPU_GEM_DOMAIN_VRAM,