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>
This commit is contained in:

committed by
Alex Deucher

parent
6d16dac85c
commit
a05502e5cf
@@ -1378,6 +1378,18 @@ struct amdgpu_atcs {
|
||||
struct amdgpu_atcs_functions functions;
|
||||
};
|
||||
|
||||
/*
|
||||
* Firmware VRAM reservation
|
||||
*/
|
||||
struct amdgpu_fw_vram_usage {
|
||||
u64 start_offset;
|
||||
u64 size;
|
||||
struct amdgpu_bo *reserved_bo;
|
||||
void *va;
|
||||
};
|
||||
|
||||
int amdgpu_fw_reserve_vram_init(struct amdgpu_device *adev);
|
||||
|
||||
/*
|
||||
* CGS
|
||||
*/
|
||||
@@ -1582,6 +1594,8 @@ struct amdgpu_device {
|
||||
struct delayed_work late_init_work;
|
||||
|
||||
struct amdgpu_virt virt;
|
||||
/* firmware VRAM reservation */
|
||||
struct amdgpu_fw_vram_usage fw_vram_usage;
|
||||
|
||||
/* link all shadow bo */
|
||||
struct list_head shadow_list;
|
||||
|
Reference in New Issue
Block a user