aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2935-drm-amdgpu-Hack-xgmi-topology-info-when-there-is-no-.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2935-drm-amdgpu-Hack-xgmi-topology-info-when-there-is-no-.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2935-drm-amdgpu-Hack-xgmi-topology-info-when-there-is-no-.patch62
1 files changed, 62 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2935-drm-amdgpu-Hack-xgmi-topology-info-when-there-is-no-.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2935-drm-amdgpu-Hack-xgmi-topology-info-when-there-is-no-.patch
new file mode 100644
index 00000000..9a6d1e5a
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.19.8/2935-drm-amdgpu-Hack-xgmi-topology-info-when-there-is-no-.patch
@@ -0,0 +1,62 @@
+From 75d14faebe501958dc4d63e71de14fe210dcba9a Mon Sep 17 00:00:00 2001
+From: Oak Zeng <Oak.Zeng@amd.com>
+Date: Thu, 14 Mar 2019 11:44:24 -0500
+Subject: [PATCH 2935/2940] drm/amdgpu: Hack xgmi topology info when there is
+ no psp fw
+
+This is only needed on emulation platform where psp fw might
+not be available, to hack xgmi topology info such as hive id and
+node id.
+
+v2: Add offset to hacked hive/node id
+v3: Don't use introduce new module parameter.
+
+Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 27 ++++++++++++++----------
+ 1 file changed, 16 insertions(+), 11 deletions(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
+index b9ba99f6b3fb..1725c1ec1536 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
+@@ -301,18 +301,23 @@ int amdgpu_xgmi_add_device(struct amdgpu_device *adev)
+ if (!adev->gmc.xgmi.supported)
+ return 0;
+
+- ret = psp_xgmi_get_node_id(&adev->psp, &adev->gmc.xgmi.node_id);
+- if (ret) {
+- dev_err(adev->dev,
+- "XGMI: Failed to get node id\n");
+- return ret;
+- }
++ if (amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_PSP)) {
++ ret = psp_xgmi_get_hive_id(&adev->psp, &adev->gmc.xgmi.hive_id);
++ if (ret) {
++ dev_err(adev->dev,
++ "XGMI: Failed to get hive id\n");
++ return ret;
++ }
+
+- ret = psp_xgmi_get_hive_id(&adev->psp, &adev->gmc.xgmi.hive_id);
+- if (ret) {
+- dev_err(adev->dev,
+- "XGMI: Failed to get hive id\n");
+- return ret;
++ ret = psp_xgmi_get_node_id(&adev->psp, &adev->gmc.xgmi.node_id);
++ if (ret) {
++ dev_err(adev->dev,
++ "XGMI: Failed to get node id\n");
++ return ret;
++ }
++ } else {
++ adev->gmc.xgmi.hive_id = 16;
++ adev->gmc.xgmi.node_id = adev->gmc.xgmi.physical_node_id + 16;
+ }
+
+ hive = amdgpu_get_xgmi_hive(adev, 1);
+--
+2.17.1
+