drm/amdkfd: Expose sdma engine numbers to topology
authorOak Zeng <Oak.Zeng@amd.com>
Fri, 8 Feb 2019 16:56:42 +0000 (10:56 -0600)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 24 May 2019 17:21:02 +0000 (12:21 -0500)
Expose available numbers of both SDMA queue types in the topology.

Signed-off-by: Oak Zeng <Oak.Zeng@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_topology.c
drivers/gpu/drm/amd/amdkfd/kfd_topology.h

index 769dbc7be8cb8b5589066131112e075c5e85a6ea..381d09e0d0f7c9095195d22567cf503aaab7179a 100644 (file)
@@ -476,6 +476,10 @@ static ssize_t node_show(struct kobject *kobj, struct attribute *attr,
                        dev->node_props.drm_render_minor);
        sysfs_show_64bit_prop(buffer, "hive_id",
                        dev->node_props.hive_id);
+       sysfs_show_32bit_prop(buffer, "num_sdma_engines",
+                       dev->node_props.num_sdma_engines);
+       sysfs_show_32bit_prop(buffer, "num_sdma_xgmi_engines",
+                       dev->node_props.num_sdma_xgmi_engines);
 
        if (dev->gpu) {
                log_max_watch_addr =
@@ -1281,6 +1285,9 @@ int kfd_topology_add_device(struct kfd_dev *gpu)
                gpu->shared_resources.drm_render_minor;
 
        dev->node_props.hive_id = gpu->hive_id;
+       dev->node_props.num_sdma_engines = gpu->device_info->num_sdma_engines;
+       dev->node_props.num_sdma_xgmi_engines =
+                               gpu->device_info->num_xgmi_sdma_engines;
 
        kfd_fill_mem_clk_max_info(dev);
        kfd_fill_iolink_non_crat_info(dev);
index 84710cfd23c231e1422bad45c1aa58625b0bbfdb..949e885dfb5328cacf2744be7cc0f056435d1c36 100644 (file)
@@ -78,6 +78,8 @@ struct kfd_node_properties {
        uint32_t max_engine_clk_fcompute;
        uint32_t max_engine_clk_ccompute;
        int32_t  drm_render_minor;
+       uint32_t num_sdma_engines;
+       uint32_t num_sdma_xgmi_engines;
        uint16_t marketing_name[KFD_TOPOLOGY_PUBLIC_NAME_SIZE];
 };