[PATCH] drm/amdkfd: add family_id property for kfd_node
Lang Yu
Lang.Yu at amd.com
Wed Aug 17 03:09:26 UTC 2022
Then we can remove the burden of maintaining codes to
parse family_id from gfx version in rocr,
i.e., remove DevIDToAddrLibFamily().
Signed-off-by: Lang Yu <Lang.Yu at amd.com>
---
drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 3 +++
drivers/gpu/drm/amd/amdkfd/kfd_topology.h | 1 +
2 files changed, 4 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
index 3f0a4a415907..7e0331e853d5 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c
@@ -507,6 +507,8 @@ static ssize_t node_show(struct kobject *kobj, struct attribute *attr,
dev->node_props.vendor_id);
sysfs_show_32bit_prop(buffer, offs, "device_id",
dev->node_props.device_id);
+ sysfs_show_32bit_prop(buffer, offs, "family_id",
+ dev->node_props.family_id);
sysfs_show_32bit_prop(buffer, offs, "location_id",
dev->node_props.location_id);
sysfs_show_32bit_prop(buffer, offs, "domain",
@@ -1690,6 +1692,7 @@ int kfd_topology_add_device(struct kfd_dev *gpu)
dev->node_props.gfx_target_version = gpu->device_info.gfx_target_version;
dev->node_props.vendor_id = gpu->pdev->vendor;
dev->node_props.device_id = gpu->pdev->device;
+ dev->node_props.family_id = gpu->adev->family;
dev->node_props.capability |=
((dev->gpu->adev->rev_id << HSA_CAP_ASIC_REVISION_SHIFT) &
HSA_CAP_ASIC_REVISION_MASK);
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.h b/drivers/gpu/drm/amd/amdkfd/kfd_topology.h
index 9f6c949186c1..4ff8dd2c9549 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.h
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.h
@@ -56,6 +56,7 @@ struct kfd_node_properties {
uint32_t gfx_target_version;
uint32_t vendor_id;
uint32_t device_id;
+ uint32_t family_id;
uint32_t location_id;
uint32_t domain;
uint32_t max_engine_clk_fcompute;
--
2.25.1
More information about the amd-gfx
mailing list