From: Xiangliang Yu <[email protected]>

If gpu device is vf, set virt ops so that guest can talk with GPU
hypervisor.

Signed-off-by: Xiangliang Yu <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Reviewed-by: Monk Liu <[email protected]>
Acked-by: Christian König <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
---
 drivers/gpu/drm/amd/amdgpu/soc15.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c 
b/drivers/gpu/drm/amd/amdgpu/soc15.c
index b197288..46ccd60 100644
--- a/drivers/gpu/drm/amd/amdgpu/soc15.c
+++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
@@ -58,6 +58,7 @@
 #include "uvd_v7_0.h"
 #include "vce_v4_0.h"
 #include "amdgpu_powerplay.h"
+#include "mxgpu_ai.h"
 
 MODULE_FIRMWARE("amdgpu/vega10_smc.bin");
 
@@ -471,6 +472,9 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev)
 {
        nbio_v6_1_detect_hw_virt(adev);
 
+       if (amdgpu_sriov_vf(adev))
+               adev->virt.ops = &xgpu_ai_virt_ops;
+
        switch (adev->asic_type) {
        case CHIP_VEGA10:
                amdgpu_ip_block_add(adev, &vega10_common_ip_block);
-- 
2.5.5

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to