aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c b/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c
index 2e65447637c6..f8cee95d61cc 100644
--- a/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c
+++ b/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c
@@ -205,8 +205,19 @@ static const struct nbio_hdp_flush_reg nbio_v7_4_hdp_flush_reg = {
205 205
206static void nbio_v7_4_detect_hw_virt(struct amdgpu_device *adev) 206static void nbio_v7_4_detect_hw_virt(struct amdgpu_device *adev)
207{ 207{
208 if (is_virtual_machine()) /* passthrough mode exclus sriov mod */ 208 uint32_t reg;
209 adev->virt.caps |= AMDGPU_PASSTHROUGH_MODE; 209
210 reg = RREG32_SOC15(NBIO, 0, mmRCC_IOV_FUNC_IDENTIFIER);
211 if (reg & 1)
212 adev->virt.caps |= AMDGPU_SRIOV_CAPS_IS_VF;
213
214 if (reg & 0x80000000)
215 adev->virt.caps |= AMDGPU_SRIOV_CAPS_ENABLE_IOV;
216
217 if (!reg) {
218 if (is_virtual_machine()) /* passthrough mode exclus sriov mod */
219 adev->virt.caps |= AMDGPU_PASSTHROUGH_MODE;
220 }
210} 221}
211 222
212static void nbio_v7_4_init_registers(struct amdgpu_device *adev) 223static void nbio_v7_4_init_registers(struct amdgpu_device *adev)