Lines Matching refs:gpu

95 	return top_dev->gpu;  in kfd_device_by_id()
106 if (top_dev->gpu && top_dev->gpu->pdev == pdev) { in kfd_device_by_pci_dev()
107 device = top_dev->gpu; in kfd_device_by_pci_dev()
124 if (top_dev->gpu && top_dev->gpu->kgd == kgd) { in kfd_device_by_kgd()
125 device = top_dev->gpu; in kfd_device_by_kgd()
275 if (iolink->gpu && kfd_devcgroup_check_permission(iolink->gpu)) in iolink_show()
315 if (mem->gpu && kfd_devcgroup_check_permission(mem->gpu)) in mem_show()
348 if (cache->gpu && kfd_devcgroup_check_permission(cache->gpu)) in kfd_cache_show()
429 if (dev->gpu && kfd_devcgroup_check_permission(dev->gpu)) in node_show()
438 if (dev->gpu && kfd_devcgroup_check_permission(dev->gpu)) in node_show()
445 if (dev->gpu && kfd_devcgroup_check_permission(dev->gpu)) in node_show()
450 dev->gpu ? dev->node_props.simd_count : 0); in node_show()
504 if (dev->gpu) { in node_show()
506 __ilog2_u32(dev->gpu->device_info->num_of_watch_points); in node_show()
518 if (dev->gpu->device_info->asic_family == CHIP_TONGA) in node_show()
528 dev->gpu->mec_fw_version); in node_show()
532 dev->gpu->sdma_fw_version); in node_show()
534 amdgpu_amdkfd_get_unique_id(dev->gpu->kgd)); in node_show()
960 if (!kdev->gpu) { in kfd_add_non_crat_information()
1098 static uint32_t kfd_generate_gpu_id(struct kfd_dev *gpu) in kfd_generate_gpu_id() argument
1106 if (!gpu) in kfd_generate_gpu_id()
1109 amdgpu_amdkfd_get_local_mem_info(gpu->kgd, &local_mem_info); in kfd_generate_gpu_id()
1114 buf[0] = gpu->pdev->devfn; in kfd_generate_gpu_id()
1115 buf[1] = gpu->pdev->subsystem_vendor | in kfd_generate_gpu_id()
1116 (gpu->pdev->subsystem_device << 16); in kfd_generate_gpu_id()
1117 buf[2] = pci_domain_nr(gpu->pdev->bus); in kfd_generate_gpu_id()
1118 buf[3] = gpu->pdev->device; in kfd_generate_gpu_id()
1119 buf[4] = gpu->pdev->bus->number; in kfd_generate_gpu_id()
1133 static struct kfd_topology_device *kfd_assign_gpu(struct kfd_dev *gpu) in kfd_assign_gpu() argument
1146 if (!gpu->use_iommu_v2 && in kfd_assign_gpu()
1150 if (!dev->gpu && (dev->node_props.simd_count > 0)) { in kfd_assign_gpu()
1151 dev->gpu = gpu; in kfd_assign_gpu()
1155 mem->gpu = dev->gpu; in kfd_assign_gpu()
1157 cache->gpu = dev->gpu; in kfd_assign_gpu()
1159 iolink->gpu = dev->gpu; in kfd_assign_gpu()
1192 amdgpu_amdkfd_get_local_mem_info(dev->gpu->kgd, &local_mem_info); in kfd_fill_mem_clk_max_info()
1210 pcie_capability_read_dword(target_gpu_dev->gpu->pdev, in kfd_set_iolink_no_atomics()
1219 if (!dev->gpu->pci_atomic_requested || in kfd_set_iolink_no_atomics()
1220 dev->gpu->device_info->asic_family == in kfd_set_iolink_no_atomics()
1232 if (!to_dev->gpu && in kfd_set_iolink_non_coherent()
1236 if (to_dev->gpu) { in kfd_set_iolink_non_coherent()
1242 to_dev->gpu->device_info->asic_family == CHIP_VEGA20)) { in kfd_set_iolink_non_coherent()
1254 if (!dev || !dev->gpu) in kfd_fill_iolink_non_crat_info()
1279 int kfd_topology_add_device(struct kfd_dev *gpu) in kfd_topology_add_device() argument
1293 gpu_id = kfd_generate_gpu_id(gpu); in kfd_topology_add_device()
1299 adev = (struct amdgpu_device *)(gpu->kgd); in kfd_topology_add_device()
1302 if (gpu->hive_id && adev->gmc.xgmi.connected_to_cpu) { in kfd_topology_add_device()
1308 if (top_dev->gpu) in kfd_topology_add_device()
1311 top_dev->node_props.hive_id = gpu->hive_id; in kfd_topology_add_device()
1323 dev = kfd_assign_gpu(gpu); in kfd_topology_add_device()
1326 COMPUTE_UNIT_GPU, gpu, in kfd_topology_add_device()
1357 dev = kfd_assign_gpu(gpu); in kfd_topology_add_device()
1365 gpu->id = gpu_id; in kfd_topology_add_device()
1375 amdgpu_amdkfd_get_cu_info(dev->gpu->kgd, &cu_info); in kfd_topology_add_device()
1377 strncpy(dev->node_props.name, gpu->device_info->asic_name, in kfd_topology_add_device()
1383 dev->node_props.gfx_target_version = gpu->device_info->gfx_target_version; in kfd_topology_add_device()
1384 dev->node_props.vendor_id = gpu->pdev->vendor; in kfd_topology_add_device()
1385 dev->node_props.device_id = gpu->pdev->device; in kfd_topology_add_device()
1387 ((amdgpu_amdkfd_get_asic_rev_id(dev->gpu->kgd) << in kfd_topology_add_device()
1390 dev->node_props.location_id = pci_dev_id(gpu->pdev); in kfd_topology_add_device()
1391 dev->node_props.domain = pci_domain_nr(gpu->pdev->bus); in kfd_topology_add_device()
1393 amdgpu_amdkfd_get_max_engine_clock_in_mhz(dev->gpu->kgd); in kfd_topology_add_device()
1397 gpu->shared_resources.drm_render_minor; in kfd_topology_add_device()
1399 dev->node_props.hive_id = gpu->hive_id; in kfd_topology_add_device()
1400 dev->node_props.num_sdma_engines = gpu->device_info->num_sdma_engines; in kfd_topology_add_device()
1402 gpu->device_info->num_xgmi_sdma_engines; in kfd_topology_add_device()
1404 gpu->device_info->num_sdma_queues_per_engine; in kfd_topology_add_device()
1405 dev->node_props.num_gws = (dev->gpu->gws && in kfd_topology_add_device()
1406 dev->gpu->dqm->sched_policy != KFD_SCHED_POLICY_NO_HWS) ? in kfd_topology_add_device()
1407 amdgpu_amdkfd_get_num_gws(dev->gpu->kgd) : 0; in kfd_topology_add_device()
1408 dev->node_props.num_cp_queues = get_cp_queues_num(dev->gpu->dqm); in kfd_topology_add_device()
1413 switch (dev->gpu->device_info->asic_family) { in kfd_topology_add_device()
1455 dev->gpu->device_info->asic_family); in kfd_topology_add_device()
1462 if (dev->gpu->use_iommu_v2) in kfd_topology_add_device()
1472 if (dev->gpu->device_info->asic_family == CHIP_CARRIZO) { in kfd_topology_add_device()
1501 int kfd_topology_remove_device(struct kfd_dev *gpu) in kfd_topology_remove_device() argument
1510 if (dev->gpu == gpu) { in kfd_topology_remove_device()
1546 *kdev = top_dev->gpu; in kfd_topology_enum_kfd_devices()
1589 void kfd_double_confirm_iommu_support(struct kfd_dev *gpu) in kfd_double_confirm_iommu_support() argument
1593 gpu->use_iommu_v2 = false; in kfd_double_confirm_iommu_support()
1595 if (!gpu->device_info->needs_iommu_device) in kfd_double_confirm_iommu_support()
1606 !dev->gpu) in kfd_double_confirm_iommu_support()
1607 gpu->use_iommu_v2 = true; in kfd_double_confirm_iommu_support()
1623 if (!dev->gpu) { in kfd_debugfs_hqds_by_device()
1628 seq_printf(m, "Node %u, gpu_id %x:\n", i++, dev->gpu->id); in kfd_debugfs_hqds_by_device()
1629 r = dqm_debugfs_hqds(m, dev->gpu->dqm); in kfd_debugfs_hqds_by_device()
1648 if (!dev->gpu) { in kfd_debugfs_rls_by_device()
1653 seq_printf(m, "Node %u, gpu_id %x:\n", i++, dev->gpu->id); in kfd_debugfs_rls_by_device()
1654 r = pm_debugfs_runlist(m, &dev->gpu->dqm->packet_mgr); in kfd_debugfs_rls_by_device()