aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlora Cui <flora.cui@amd.com>2017-12-08 23:08:46 -0500
committerOded Gabbay <oded.gabbay@gmail.com>2017-12-08 23:08:46 -0500
commitf7ce2fade6e143a333dc51d84f2080738d6831bf (patch)
tree480f7efe09a1d52f8ac1f928aa79e41917cc66ca
parent4248bd0b102ae832cddf961b94a125385a2dfc92 (diff)
drm/amdkfd: Update number of compute unit from KGD
Overwrite the active simd_count from KGD at driver loading time. This is based on assumption that register GC_USER_SHADER_ARRAY_CONFIG won’t get changed. V2: remove the incorrect simd_count reported at loading module. Signed-off-by: Flora Cui <flora.cui@amd.com> Reviewed by: Yair Shachar< yair.shachar@amd.com> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Acked-by: Oded Gabbay <oded.gabbay@gmail.com> Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_topology.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
index cb0303a323d2..ca2e51a2fe75 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
@@ -133,8 +133,7 @@ static void kfd_populated_cu_info_gpu(struct kfd_topology_device *dev,
133 dev->node_props.max_slots_scratch_cu = cu->max_slots_scatch_cu; 133 dev->node_props.max_slots_scratch_cu = cu->max_slots_scatch_cu;
134 if (cu->hsa_capability & CRAT_CU_FLAGS_HOT_PLUGGABLE) 134 if (cu->hsa_capability & CRAT_CU_FLAGS_HOT_PLUGGABLE)
135 dev->node_props.capability |= HSA_CAP_HOT_PLUGGABLE; 135 dev->node_props.capability |= HSA_CAP_HOT_PLUGGABLE;
136 pr_info("CU GPU: simds=%d id_base=%d\n", cu->num_simd_cores, 136 pr_info("CU GPU: id_base=%d\n", cu->processor_id_low);
137 cu->processor_id_low);
138} 137}
139 138
140/* kfd_parse_subtype_cu is called when the topology mutex is already acquired */ 139/* kfd_parse_subtype_cu is called when the topology mutex is already acquired */
@@ -1124,6 +1123,7 @@ int kfd_topology_add_device(struct kfd_dev *gpu)
1124{ 1123{
1125 uint32_t gpu_id; 1124 uint32_t gpu_id;
1126 struct kfd_topology_device *dev; 1125 struct kfd_topology_device *dev;
1126 struct kfd_cu_info cu_info;
1127 int res; 1127 int res;
1128 1128
1129 gpu_id = kfd_generate_gpu_id(gpu); 1129 gpu_id = kfd_generate_gpu_id(gpu);
@@ -1161,6 +1161,9 @@ int kfd_topology_add_device(struct kfd_dev *gpu)
1161 1161
1162 dev->gpu_id = gpu_id; 1162 dev->gpu_id = gpu_id;
1163 gpu->id = gpu_id; 1163 gpu->id = gpu_id;
1164 dev->gpu->kfd2kgd->get_cu_info(dev->gpu->kgd, &cu_info);
1165 dev->node_props.simd_count = dev->node_props.simd_per_cu *
1166 cu_info.cu_active_number;
1164 dev->node_props.vendor_id = gpu->pdev->vendor; 1167 dev->node_props.vendor_id = gpu->pdev->vendor;
1165 dev->node_props.device_id = gpu->pdev->device; 1168 dev->node_props.device_id = gpu->pdev->device;
1166 dev->node_props.location_id = (gpu->pdev->bus->number << 24) + 1169 dev->node_props.location_id = (gpu->pdev->bus->number << 24) +