diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2016-02-01 11:00:49 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-02-10 14:17:10 -0500 |
commit | e74adf2039f98a30865ea7ef98689007c241c995 (patch) | |
tree | 64b7c1c6027cd13fedcf620f2385e7b35db681a7 /drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | |
parent | 383b6f608b88315f81ffd09cfed2ab7c633b1ec9 (diff) |
drm/amdgpu: add check for atombios GPU virtualization table
This table is found on boards that support SR-IOV. This will
be used to determine if the board supports SR-IOV and allow
the driver to take specific action in certain cases.
Reviewed-by: Monk Liu <monk.liu@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_atombios.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c index 9416e0f5c1db..84b0ce39ee14 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | |||
@@ -1514,6 +1514,19 @@ int amdgpu_atombios_init_mc_reg_table(struct amdgpu_device *adev, | |||
1514 | return -EINVAL; | 1514 | return -EINVAL; |
1515 | } | 1515 | } |
1516 | 1516 | ||
1517 | bool amdgpu_atombios_has_gpu_virtualization_table(struct amdgpu_device *adev) | ||
1518 | { | ||
1519 | int index = GetIndexIntoMasterTable(DATA, GPUVirtualizationInfo); | ||
1520 | u8 frev, crev; | ||
1521 | u16 data_offset, size; | ||
1522 | |||
1523 | if (amdgpu_atom_parse_data_header(adev->mode_info.atom_context, index, &size, | ||
1524 | &frev, &crev, &data_offset)) | ||
1525 | return true; | ||
1526 | |||
1527 | return false; | ||
1528 | } | ||
1529 | |||
1517 | void amdgpu_atombios_scratch_regs_lock(struct amdgpu_device *adev, bool lock) | 1530 | void amdgpu_atombios_scratch_regs_lock(struct amdgpu_device *adev, bool lock) |
1518 | { | 1531 | { |
1519 | uint32_t bios_6_scratch; | 1532 | uint32_t bios_6_scratch; |