diff options
author | Hawking Zhang <[email protected]> | 2020-11-17 15:51:29 +0800 |
---|---|---|
committer | Alex Deucher <[email protected]> | 2021-03-23 22:55:20 -0400 |
commit | 3de60d961cec972afabe9208f51731659201a000 (patch) | |
tree | 47f6da71962afe2648705175e954c68a88eceb3b | |
parent | 063a1e83413996063790cfa4d17690a4b86eaa8e (diff) |
drm/amdgpu: use physical_node_id to calculate aper_base
Similar as xgmi connected gpu nodes, physical_node_id
* segment_size should be used to calculate the offset
of aper_base.
The asic type check is redundant. once physical_node_id
and segment_size are initialized, it should be count
on.
Signed-off-by: Hawking Zhang <[email protected]>
Reviewed-by: Kevin Wang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c index 44fc85b78563..37c815094adf 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c @@ -1263,19 +1263,13 @@ static int gmc_v9_0_mc_init(struct amdgpu_device *adev) */ /* check whether both host-gpu and gpu-gpu xgmi links exist */ - if (adev->gmc.xgmi.supported && adev->gmc.xgmi.connected_to_cpu && - adev->asic_type == CHIP_ALDEBARAN) { - - adev->gmc.aper_base = adev->gfxhub.funcs->get_mc_fb_offset(adev) + - adev->gmc.xgmi.node_id * + if ((adev->flags & AMD_IS_APU) || + (adev->gmc.xgmi.supported && + adev->gmc.xgmi.connected_to_cpu)) { + adev->gmc.aper_base = + adev->gfxhub.funcs->get_mc_fb_offset(adev) + + adev->gmc.xgmi.physical_node_id * adev->gmc.xgmi.node_segment_size; - - adev->gmc.aper_size = adev->gmc.real_vram_size; - - } - - if (adev->flags & AMD_IS_APU) { - adev->gmc.aper_base = adev->gfxhub.funcs->get_mc_fb_offset(adev); adev->gmc.aper_size = adev->gmc.real_vram_size; } |