Commit 057f9164 authored by Yintian Tao's avatar Yintian Tao Committed by Alex Deucher
Browse files

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: default avatarYintian Tao <yttao@amd.com>
Signed-off-by: default avatarMonk Liu <Monk.Liu@amd.com>
Acked-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 029f4153
Loading
Loading
Loading
Loading
+10 −7
Original line number Diff line number Diff line
@@ -877,6 +877,8 @@ static int psp_load_fw(struct amdgpu_device *adev)
	if (!psp->cmd)
		return -ENOMEM;

	/* this fw pri bo is not used under SRIOV */
	if (!amdgpu_sriov_vf(psp->adev)) {
		ret = amdgpu_bo_create_kernel(adev, PSP_1_MEG, PSP_1_MEG,
					      AMDGPU_GEM_DOMAIN_GTT,
					      &psp->fw_pri_bo,
@@ -884,6 +886,7 @@ static int psp_load_fw(struct amdgpu_device *adev)
					      &psp->fw_pri_buf);
		if (ret)
			goto failed;
	}

	ret = amdgpu_bo_create_kernel(adev, PSP_FENCE_BUFFER_SIZE, PAGE_SIZE,
					AMDGPU_GEM_DOMAIN_VRAM,