aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
diff options
context:
space:
mode:
authorHorace Chen <horace.chen@amd.com>2017-09-29 02:41:57 -0400
committerAlex Deucher <alexander.deucher@amd.com>2017-10-09 16:30:16 -0400
commita05502e5cfa9abe17a16592be82c2f5692c91f35 (patch)
tree4469aaafa3b34b2f81768ee775c08ee9e218ee45 /drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
parent6d16dac85c081825af58111023428c43d1da7e1a (diff)
drm/amdgpu: Reserve shared memory on VRAM for SR-IOV
SR-IOV need to reserve a piece of shared VRAM at the exact place to exchange data betweem PF and VF. The start address and size of the shared mem are passed to guest through VBIOS structure VRAM_UsageByFirmware. VRAM_UsageByFirmware is a general feature in VBIOS, it indicates that VBIOS need to reserve a piece of memory on the VRAM. Because the mem address is specified. Reserve it early in amdgpu_ttm_init to make sure that it can monoplize the space. Signed-off-by: Horace Chen <horace.chen@amd.com> Reviewed-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/amdgpu_ttm.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index 15a28578d458..1f68a146e26c 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -1255,6 +1255,15 @@ int amdgpu_ttm_init(struct amdgpu_device *adev)
1255 /* Change the size here instead of the init above so only lpfn is affected */ 1255 /* Change the size here instead of the init above so only lpfn is affected */
1256 amdgpu_ttm_set_active_vram_size(adev, adev->mc.visible_vram_size); 1256 amdgpu_ttm_set_active_vram_size(adev, adev->mc.visible_vram_size);
1257 1257
1258 /*
1259 *The reserved vram for firmware must be pinned to the specified
1260 *place on the VRAM, so reserve it early.
1261 */
1262 r = amdgpu_fw_reserve_vram_init(adev);
1263 if (r) {
1264 return r;
1265 }
1266
1258 r = amdgpu_bo_create_kernel(adev, adev->mc.stolen_size, PAGE_SIZE, 1267 r = amdgpu_bo_create_kernel(adev, adev->mc.stolen_size, PAGE_SIZE,
1259 AMDGPU_GEM_DOMAIN_VRAM, 1268 AMDGPU_GEM_DOMAIN_VRAM,
1260 &adev->stolen_vga_memory, 1269 &adev->stolen_vga_memory,