Skip to content

Commit 9ddea8c

Browse files
amd-morriszhangalexdeucher
authored andcommitted
drm/amdgpu: add and populate the port num into xgmi topology info
The port num info is firstly introduced with 20.00.01.13 xgmi ta and make them as part of topology info. 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>
1 parent 5e8a0d3 commit 9ddea8c

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1473,6 +1473,11 @@ int psp_xgmi_get_topology_info(struct psp_context *psp,
14731473
topology->nodes[i].num_links = (requires_reflection && topology->nodes[i].num_links) ?
14741474
topology->nodes[i].num_links : node_num_links;
14751475
}
1476+
/* popluate the connected port num info if supported and available */
1477+
if (ta_port_num_support && topology->nodes[i].num_links) {
1478+
memcpy(topology->nodes[i].port_num, link_extend_info_output->nodes[i].port_num,
1479+
sizeof(struct xgmi_connected_port_num) * TA_XGMI__MAX_PORT_NUM);
1480+
}
14761481

14771482
/* reflect the topology information for bi-directionality */
14781483
if (requires_reflection && topology->nodes[i].num_hops)

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ struct psp_xgmi_node_info {
150150
uint8_t is_sharing_enabled;
151151
enum ta_xgmi_assigned_sdma_engine sdma_engine;
152152
uint8_t num_links;
153+
struct xgmi_connected_port_num port_num[TA_XGMI__MAX_PORT_NUM];
153154
};
154155

155156
struct psp_xgmi_topology_info {

0 commit comments

Comments
 (0)