Skip to content

Commit e8a5ded

Browse files
Shiwu Zhangalexdeucher
authored andcommitted
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 <[email protected]> Reviewed-by: Le Ma <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent d9443ac commit e8a5ded

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1431,14 +1431,22 @@ int psp_xgmi_get_topology_info(struct psp_context *psp,
14311431
amdgpu_ip_version(psp->adev, MP0_HWIP, 0) ==
14321432
IP_VERSION(13, 0, 6);
14331433

1434-
xgmi_cmd->cmd_id = TA_COMMAND_XGMI__GET_PEER_LINKS;
1434+
link_info_output = &xgmi_cmd->xgmi_out_message.get_link_info;
1435+
/* popluate the shared output buffer rather than the cmd input buffer
1436+
* with node_ids as the input for GET_PEER_LINKS command execution.
1437+
* This is required for GET_PEER_LINKS only per xgmi ta implementation
1438+
*/
1439+
for (i = 0; i < topology->num_nodes; i++) {
1440+
link_info_output->nodes[i].node_id = topology->nodes[i].node_id;
1441+
}
1442+
link_info_output->num_nodes = topology->num_nodes;
14351443

1444+
xgmi_cmd->cmd_id = TA_COMMAND_XGMI__GET_PEER_LINKS;
14361445
ret = psp_xgmi_invoke(psp, TA_COMMAND_XGMI__GET_PEER_LINKS);
14371446

14381447
if (ret)
14391448
return ret;
14401449

1441-
link_info_output = &xgmi_cmd->xgmi_out_message.get_link_info;
14421450
for (i = 0; i < topology->num_nodes; i++) {
14431451
/* accumulate num_links on extended data */
14441452
topology->nodes[i].num_links = get_extended_data ?

0 commit comments

Comments
 (0)