diff options
author | Shiwu Zhang <shiwu.zhang@amd.com> | 2023-09-20 18:36:55 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2023-10-20 15:11:28 -0400 |
commit | e8a5ded36b4c68db4e0d4066ae2d420116715105 (patch) | |
tree | 2ec9b177db5b38ca9dfa6d79676ee3b2643987d8 /drivers/gpu/drm/amd/amdgpu | |
parent | d9443ac4f9ea97f9eaebf2569d3fd044da4c9c98 (diff) |
drm/amdgpu: prepare the output buffer for GET_PEER_LINKS command
Per the xgmi ta implementation, KGD needs to fill in node_ids
in concern into the shared command output buffer rather than the
command input buffer.
Input buffer is not used for GET_PEER_LINKS command execution.
In this way, xgmi ta can reuse the node info in the output buffer
just filled in and populate the same buffer with link info directly.
Signed-off-by: Shiwu Zhang <shiwu.zhang@amd.com>
Reviewed-by: Le Ma <le.ma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index bd398e10fa0a..37891042ce9f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c @@ -1431,14 +1431,22 @@ int psp_xgmi_get_topology_info(struct psp_context *psp, amdgpu_ip_version(psp->adev, MP0_HWIP, 0) == IP_VERSION(13, 0, 6); - xgmi_cmd->cmd_id = TA_COMMAND_XGMI__GET_PEER_LINKS; + link_info_output = &xgmi_cmd->xgmi_out_message.get_link_info; + /* popluate the shared output buffer rather than the cmd input buffer + * with node_ids as the input for GET_PEER_LINKS command execution. + * This is required for GET_PEER_LINKS only per xgmi ta implementation + */ + for (i = 0; i < topology->num_nodes; i++) { + link_info_output->nodes[i].node_id = topology->nodes[i].node_id; + } + link_info_output->num_nodes = topology->num_nodes; + xgmi_cmd->cmd_id = TA_COMMAND_XGMI__GET_PEER_LINKS; ret = psp_xgmi_invoke(psp, TA_COMMAND_XGMI__GET_PEER_LINKS); if (ret) return ret; - link_info_output = &xgmi_cmd->xgmi_out_message.get_link_info; for (i = 0; i < topology->num_nodes; i++) { /* accumulate num_links on extended data */ topology->nodes[i].num_links = get_extended_data ? |