aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.19.8/0376-drm-amdgpu-add-vega20-sriov-capability-detection.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.19.8/0376-drm-amdgpu-add-vega20-sriov-capability-detection.patch')
-rw-r--r--common/recipes-kernel/linux/linux-yocto-4.19.8/0376-drm-amdgpu-add-vega20-sriov-capability-detection.patch44
1 files changed, 44 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.19.8/0376-drm-amdgpu-add-vega20-sriov-capability-detection.patch b/common/recipes-kernel/linux/linux-yocto-4.19.8/0376-drm-amdgpu-add-vega20-sriov-capability-detection.patch
new file mode 100644
index 00000000..ba98be5e
--- /dev/null
+++ b/common/recipes-kernel/linux/linux-yocto-4.19.8/0376-drm-amdgpu-add-vega20-sriov-capability-detection.patch
@@ -0,0 +1,44 @@
+From e76984e73744952153922b2fad73a66aaa7e2479 Mon Sep 17 00:00:00 2001
+From: Frank Min <Frank.Min@amd.com>
+Date: Fri, 27 Apr 2018 03:44:11 +0800
+Subject: [PATCH 0376/2940] drm/amdgpu: add vega20 sriov capability detection
+
+Add sriov capability detection for vega20, then can check if device is
+virtual device.
+
+Signed-off-by: Frank Min <Frank.Min@amd.com>
+Signed-off-by: Xiangliang Yu <Xiangliang.Yu@amd.com>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c | 15 +++++++++++++--
+ 1 file 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 = {
+
+ static void nbio_v7_4_detect_hw_virt(struct amdgpu_device *adev)
+ {
+- if (is_virtual_machine()) /* passthrough mode exclus sriov mod */
+- adev->virt.caps |= AMDGPU_PASSTHROUGH_MODE;
++ uint32_t reg;
++
++ reg = RREG32_SOC15(NBIO, 0, mmRCC_IOV_FUNC_IDENTIFIER);
++ if (reg & 1)
++ adev->virt.caps |= AMDGPU_SRIOV_CAPS_IS_VF;
++
++ if (reg & 0x80000000)
++ adev->virt.caps |= AMDGPU_SRIOV_CAPS_ENABLE_IOV;
++
++ if (!reg) {
++ if (is_virtual_machine()) /* passthrough mode exclus sriov mod */
++ adev->virt.caps |= AMDGPU_PASSTHROUGH_MODE;
++ }
+ }
+
+ static void nbio_v7_4_init_registers(struct amdgpu_device *adev)
+--
+2.17.1
+