diff options
author | Alex Deucher <alexander.deucher@amd.com> | 2018-11-30 15:29:43 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2018-12-03 11:14:39 -0500 |
commit | 47622ba033d6da529ff37d7e5238359a699496ab (patch) | |
tree | 4f8286bd6887cd152d5e32015bcc55358bfbcc96 | |
parent | e2101675225fa45cf6994916c2051c5167ded3e2 (diff) |
drm/amdgpu: add a xgmi supported flag
Use this to track whether an asic supports xgmi rather than
checking the asic type everywhere.
Reviewed-by: Andrey Grodzovsky <andrey.grodzovsky@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/soc15.c | 3 |
4 files changed, 7 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h index 8c57924c075f..81e6070d255b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.h | |||
@@ -99,6 +99,7 @@ struct amdgpu_xgmi { | |||
99 | unsigned num_physical_nodes; | 99 | unsigned num_physical_nodes; |
100 | /* gpu list in the same hive */ | 100 | /* gpu list in the same hive */ |
101 | struct list_head head; | 101 | struct list_head head; |
102 | bool supported; | ||
102 | }; | 103 | }; |
103 | 104 | ||
104 | struct amdgpu_gmc { | 105 | struct amdgpu_gmc { |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c index fb37e69f1bba..f8c86d0593dd 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c | |||
@@ -94,9 +94,9 @@ int amdgpu_xgmi_add_device(struct amdgpu_device *adev) | |||
94 | 94 | ||
95 | int count = 0, ret = -EINVAL; | 95 | int count = 0, ret = -EINVAL; |
96 | 96 | ||
97 | if ((adev->asic_type < CHIP_VEGA20) || | 97 | if (!adev->gmc.xgmi.supported) |
98 | (adev->flags & AMD_IS_APU) ) | ||
99 | return 0; | 98 | return 0; |
99 | |||
100 | adev->gmc.xgmi.node_id = psp_xgmi_get_node_id(&adev->psp); | 100 | adev->gmc.xgmi.node_id = psp_xgmi_get_node_id(&adev->psp); |
101 | adev->gmc.xgmi.hive_id = psp_xgmi_get_hive_id(&adev->psp); | 101 | adev->gmc.xgmi.hive_id = psp_xgmi_get_hive_id(&adev->psp); |
102 | 102 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c index 3a4e5d8d5162..ed3145b2a596 100644 --- a/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | |||
@@ -934,7 +934,7 @@ static int gmc_v9_0_sw_init(void *handle) | |||
934 | } | 934 | } |
935 | adev->need_swiotlb = drm_get_max_iomem() > ((u64)1 << dma_bits); | 935 | adev->need_swiotlb = drm_get_max_iomem() > ((u64)1 << dma_bits); |
936 | 936 | ||
937 | if (adev->asic_type == CHIP_VEGA20) { | 937 | if (adev->gmc.xgmi.supported) { |
938 | r = gfxhub_v1_1_get_xgmi_info(adev); | 938 | r = gfxhub_v1_1_get_xgmi_info(adev); |
939 | if (r) | 939 | if (r) |
940 | return r; | 940 | return r; |
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c index b318950ebbaa..f2cd87dc365a 100644 --- a/drivers/gpu/drm/amd/amdgpu/soc15.c +++ b/drivers/gpu/drm/amd/amdgpu/soc15.c | |||
@@ -500,6 +500,9 @@ int soc15_set_ip_blocks(struct amdgpu_device *adev) | |||
500 | return -EINVAL; | 500 | return -EINVAL; |
501 | } | 501 | } |
502 | 502 | ||
503 | if (adev->asic_type == CHIP_VEGA20) | ||
504 | adev->gmc.xgmi.supported = true; | ||
505 | |||
503 | if (adev->flags & AMD_IS_APU) | 506 | if (adev->flags & AMD_IS_APU) |
504 | adev->nbio_funcs = &nbio_v7_0_funcs; | 507 | adev->nbio_funcs = &nbio_v7_0_funcs; |
505 | else if (adev->asic_type == CHIP_VEGA20) | 508 | else if (adev->asic_type == CHIP_VEGA20) |