Skip to content

Commit 3575067

Browse files
Lijo Lazaralexdeucher
authored andcommitted
drm/amdgpu: Calculate IP specific xgmi bandwidth
Use IP version specific xgmi speed/width for bandwidth calculation. Signed-off-by: Lijo Lazar <[email protected]> Reviewed-by: Jonathan Kim <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 2bc0167 commit 3575067

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2757,6 +2757,9 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev)
27572757
if (!total)
27582758
return -ENODEV;
27592759

2760+
if (adev->gmc.xgmi.supported)
2761+
amdgpu_xgmi_early_init(adev);
2762+
27602763
ip_block = amdgpu_device_ip_get_ip_block(adev, AMD_IP_BLOCK_TYPE_GFX);
27612764
if (ip_block->status.valid != false)
27622765
amdgpu_amdkfd_device_probe(adev);

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,9 @@ int amdgpu_xgmi_get_bandwidth(struct amdgpu_device *adev, struct amdgpu_device *
844844
{
845845
bool peer_mode = bw_mode == AMDGPU_XGMI_BW_MODE_PER_PEER;
846846
int unit_scale = bw_unit == AMDGPU_XGMI_BW_UNIT_MBYTES ? 1000 : 1;
847-
int speed = 25, num_lanes = 16, num_links = !peer_mode ? 1 : -1;
847+
int num_lanes = adev->gmc.xgmi.max_width;
848+
int speed = adev->gmc.xgmi.max_speed;
849+
int num_links = !peer_mode ? 1 : -1;
848850

849851
if (!(min_bw && max_bw))
850852
return -EINVAL;

0 commit comments

Comments
 (0)