diff options
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c index f56f8e376b62..e5dd052d9e06 100644 --- a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c +++ b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | |||
@@ -615,7 +615,29 @@ static int psp_v11_0_xgmi_get_topology_info(struct psp_context *psp, | |||
615 | static int psp_v11_0_xgmi_set_topology_info(struct psp_context *psp, | 615 | static int psp_v11_0_xgmi_set_topology_info(struct psp_context *psp, |
616 | int number_devices, struct psp_xgmi_topology_info *topology) | 616 | int number_devices, struct psp_xgmi_topology_info *topology) |
617 | { | 617 | { |
618 | return 0; | 618 | struct ta_xgmi_shared_memory *xgmi_cmd; |
619 | struct ta_xgmi_cmd_get_topology_info_input *topology_info_input; | ||
620 | int i; | ||
621 | |||
622 | if (!topology || topology->num_nodes > TA_XGMI__MAX_CONNECTED_NODES) | ||
623 | return -EINVAL; | ||
624 | |||
625 | xgmi_cmd = (struct ta_xgmi_shared_memory*)psp->xgmi_context.xgmi_shared_buf; | ||
626 | memset(xgmi_cmd, 0, sizeof(struct ta_xgmi_shared_memory)); | ||
627 | |||
628 | topology_info_input = &xgmi_cmd->xgmi_in_message.get_topology_info; | ||
629 | xgmi_cmd->cmd_id = TA_COMMAND_XGMI__SET_TOPOLOGY_INFO; | ||
630 | topology_info_input->num_nodes = number_devices; | ||
631 | |||
632 | for (i = 0; i < topology_info_input->num_nodes; i++) { | ||
633 | topology_info_input->nodes[i].node_id = topology->nodes[i].node_id; | ||
634 | topology_info_input->nodes[i].num_hops = topology->nodes[i].num_hops; | ||
635 | topology_info_input->nodes[i].is_sharing_enabled = topology->nodes[i].is_sharing_enabled; | ||
636 | topology_info_input->nodes[i].sdma_engine = topology->nodes[i].sdma_engine; | ||
637 | } | ||
638 | |||
639 | /* Invoke xgmi ta to set topology information */ | ||
640 | return psp_xgmi_invoke(psp, TA_COMMAND_XGMI__SET_TOPOLOGY_INFO); | ||
619 | } | 641 | } |
620 | 642 | ||
621 | static u64 psp_v11_0_xgmi_get_hive_id(struct psp_context *psp) | 643 | static u64 psp_v11_0_xgmi_get_hive_id(struct psp_context *psp) |