drm/amdgpu: get extended xgmi topology data
authorJonathan Kim <jonathan.kim@amd.com>
Tue, 3 Aug 2021 23:01:55 +0000 (19:01 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 18 Aug 2021 22:22:24 +0000 (18:22 -0400)
commit44357a1bd5f5a1012024a127a4653c2dfa4af18a
tree2cce7ef66e40d8c3652cdb4470c0fa6b5656ec54
parent3a6e4106a8fdb87fd3ede0eb242b70b0c4c82bd5
drm/amdgpu: get extended xgmi topology data

The TA has a limit to the amount of data that can be retrieved from
GET_TOPOLOGY.  For setups that exceed this limit, the xGMI topology
needs to be re-initialized and data needs to be re-fetched from the
extended link records by setting a flag in the shared command buffer.

The number of hops and the number of links must be accumulated by the
driver. Other data points are all fetched from the first request.
Because the TA has already exceeded its link record limit, it
cannot hold bidirectional information.  Otherwise the driver would
have to do more than two fetches so the driver has to reflect the
topology information in the opposite direction.

v2: squashed with internal reviewed fix

Signed-off-by: Jonathan Kim <jonathan.kim@amd.com>
Reviewed-by: Hawking Zhang <hawking.zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c
drivers/gpu/drm/amd/amdgpu/ta_xgmi_if.h