mirror of
https://github.com/torvalds/linux.git
synced 2026-04-21 08:13:56 -04:00
drm/amdgpu:changes of virtualization cases probe (v3)
1,Changes on virtualization detections 2,Don't load smu & mc firmware if using sr-iov bios 3,skip vPost for sriov & force vPost if dev pass-through v2: agd: squash in Rays's fix for the missed SI case v3: agd: squash in additional fixes for CIK, SI, cleanup Signed-off-by: Monk Liu <Monk.Liu@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -110,7 +110,7 @@ void amdgpu_mm_wreg(struct amdgpu_device *adev, uint32_t reg, uint32_t v,
|
||||
bool always_indirect)
|
||||
{
|
||||
trace_amdgpu_mm_wreg(adev->pdev->device, reg, v);
|
||||
|
||||
|
||||
if ((reg * 4) < adev->rmmio_size && !always_indirect)
|
||||
writel(v, ((void __iomem *)adev->rmmio) + (reg * 4));
|
||||
else {
|
||||
@@ -1485,13 +1485,10 @@ static int amdgpu_resume(struct amdgpu_device *adev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static bool amdgpu_device_is_virtual(void)
|
||||
static void amdgpu_device_detect_sriov_bios(struct amdgpu_device *adev)
|
||||
{
|
||||
#ifdef CONFIG_X86
|
||||
return boot_cpu_has(X86_FEATURE_HYPERVISOR);
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
if (amdgpu_atombios_has_gpu_virtualization_table(adev))
|
||||
adev->virtualization.virtual_caps |= AMDGPU_SRIOV_CAPS_SRIOV_VBIOS;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1648,25 +1645,25 @@ int amdgpu_device_init(struct amdgpu_device *adev,
|
||||
goto failed;
|
||||
}
|
||||
|
||||
/* See if the asic supports SR-IOV */
|
||||
adev->virtualization.supports_sr_iov =
|
||||
amdgpu_atombios_has_gpu_virtualization_table(adev);
|
||||
|
||||
/* Check if we are executing in a virtualized environment */
|
||||
adev->virtualization.is_virtual = amdgpu_device_is_virtual();
|
||||
adev->virtualization.caps = amdgpu_asic_get_virtual_caps(adev);
|
||||
/* detect if we are with an SRIOV vbios */
|
||||
amdgpu_device_detect_sriov_bios(adev);
|
||||
|
||||
/* Post card if necessary */
|
||||
if (!amdgpu_card_posted(adev) ||
|
||||
(adev->virtualization.is_virtual &&
|
||||
!(adev->virtualization.caps & AMDGPU_VIRT_CAPS_SRIOV_EN))) {
|
||||
if (!amdgpu_sriov_vf(adev) &&
|
||||
(!amdgpu_card_posted(adev) || amdgpu_passthrough(adev))) {
|
||||
if (!adev->bios) {
|
||||
dev_err(adev->dev, "Card not posted and no BIOS - ignoring\n");
|
||||
r = -EINVAL;
|
||||
goto failed;
|
||||
}
|
||||
DRM_INFO("GPU not posted. posting now...\n");
|
||||
amdgpu_atom_asic_init(adev->mode_info.atom_context);
|
||||
r = amdgpu_atom_asic_init(adev->mode_info.atom_context);
|
||||
if (r) {
|
||||
dev_err(adev->dev, "gpu post error!\n");
|
||||
goto failed;
|
||||
}
|
||||
} else {
|
||||
DRM_INFO("GPU post is not needed\n");
|
||||
}
|
||||
|
||||
/* Initialize clocks */
|
||||
|
||||
Reference in New Issue
Block a user