aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0760-drm-amdgpu-psp-add-helper-function-to-invoke-xgmi-ta.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0760-drm-amdgpu-psp-add-helper-function-to-invoke-xgmi-ta.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0760-drm-amdgpu-psp-add-helper-function-to-invoke-xgmi-ta.patch88
1 files changed, 88 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0760-drm-amdgpu-psp-add-helper-function-to-invoke-xgmi-ta.patch b/meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0760-drm-amdgpu-psp-add-helper-function-to-invoke-xgmi-ta.patch
new file mode 100644
index 00000000..d1178169
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux-4.19/linux-yocto-4.19.8/0760-drm-amdgpu-psp-add-helper-function-to-invoke-xgmi-ta.patch
@@ -0,0 +1,88 @@
+From e86be994a4d0dab0e0cd705369031d7152ba42fc Mon Sep 17 00:00:00 2001
+From: Hawking Zhang <Hawking.Zhang@amd.com>
+Date: Fri, 28 Sep 2018 15:01:57 +0800
+Subject: [PATCH 0760/2940] drm/amdgpu/psp: add helper function to invoke xgmi
+ ta per ta cmd_id
+
+psp_xgmi_invoke is the helper function to issue ta cmd to firmware
+
+Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
+Acked-by: Alex Deucher <alexander.deucher@amd.com>
+Reviewed-by: Huang Rui <ray.huang@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 36 +++++++++++++++++++++++++
+ drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h | 3 +++
+ 2 files changed, 39 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+index e9d100b80b65..c4dc935e2f80 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
+@@ -375,6 +375,42 @@ static int psp_xgmi_unload(struct psp_context *psp)
+ return ret;
+ }
+
++static void psp_prep_xgmi_ta_invoke_cmd_buf(struct psp_gfx_cmd_resp *cmd,
++ uint32_t ta_cmd_id,
++ uint32_t xgmi_session_id)
++{
++ cmd->cmd_id = GFX_CMD_ID_INVOKE_CMD;
++ cmd->cmd.cmd_invoke_cmd.session_id = xgmi_session_id;
++ cmd->cmd.cmd_invoke_cmd.ta_cmd_id = ta_cmd_id;
++ /* Note: cmd_invoke_cmd.buf is not used for now */
++}
++
++int psp_xgmi_invoke(struct psp_context *psp, uint32_t ta_cmd_id)
++{
++ int ret;
++ struct psp_gfx_cmd_resp *cmd;
++
++ /*
++ * TODO: bypass the loading in sriov for now
++ */
++ if (amdgpu_sriov_vf(psp->adev))
++ return 0;
++
++ cmd = kzalloc(sizeof(struct psp_gfx_cmd_resp), GFP_KERNEL);
++ if (!cmd)
++ return -ENOMEM;
++
++ psp_prep_xgmi_ta_invoke_cmd_buf(cmd, ta_cmd_id,
++ psp->xgmi_context.session_id);
++
++ ret = psp_cmd_submit_buf(psp, NULL, cmd,
++ psp->fence_buf_mc_addr);
++
++ kfree(cmd);
++
++ return ret;
++}
++
+ static int psp_hw_start(struct psp_context *psp)
+ {
+ struct amdgpu_device *adev = psp->adev;
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
+index 26f17d9fcd4c..000e12b437f0 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
+@@ -27,6 +27,7 @@
+
+ #include "amdgpu.h"
+ #include "psp_gfx_if.h"
++#include "ta_xgmi_if.h"
+
+ #define PSP_FENCE_BUFFER_SIZE 0x1000
+ #define PSP_CMD_BUFFER_SIZE 0x1000
+@@ -218,6 +219,8 @@ extern int psp_wait_for(struct psp_context *psp, uint32_t reg_index,
+ extern const struct amdgpu_ip_block_version psp_v10_0_ip_block;
+
+ int psp_gpu_reset(struct amdgpu_device *adev);
++int psp_xgmi_invoke(struct psp_context *psp, uint32_t ta_cmd_id);
++
+ extern const struct amdgpu_ip_block_version psp_v11_0_ip_block;
+
+ #endif
+--
+2.17.1
+