diff options
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_device.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c | 15 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_priv.h | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdkfd/kfd_topology.c | 26 |
4 files changed, 50 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c index 58ed9794679b..666853e0cc36 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c @@ -371,6 +371,12 @@ static void kfd_debugfs_init(struct kfd_dev *kfd) &kfd_debugfs_fops); if (ent == NULL) dev_warn(kfd_device, "Failed to create hqds in kfd debugfs\n"); + + ent = debugfs_create_file("rls", S_IFREG | S_IRUGO, kfd->debugfs_root, + kfd_debugfs_rls_by_device, + &kfd_debugfs_fops); + if (ent == NULL) + dev_warn(kfd_device, "Failed to create rls in kfd debugfs\n"); } static void kfd_debugfs_fini(struct kfd_dev *kfd) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c index ad4466d98b12..616c1901fc28 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c @@ -449,6 +449,7 @@ static int pm_create_runlist_ib(struct packet_manager *pm, return retval; *rl_size_bytes = alloc_size_bytes; + pm->ib_size_bytes = alloc_size_bytes; pr_debug("kfd: In func %s\n", __func__); pr_debug("kfd: building runlist ib process count: %d queues count %d\n", @@ -831,3 +832,17 @@ void pm_release_ib(struct packet_manager *pm) mutex_unlock(&pm->lock); } +int pm_debugfs_runlist(struct seq_file *m, void *data) +{ + struct packet_manager *pm = data; + + if (!pm->allocated) { + seq_puts(m, " No active runlist\n"); + return 0; + } + + seq_hex_dump(m, " ", DUMP_PREFIX_OFFSET, 32, 4, + pm->ib_buffer_obj->cpu_ptr, pm->ib_size_bytes, false); + + return 0; +} diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h index 80128e90e4bc..a222efcc0d0a 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h +++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h @@ -830,6 +830,7 @@ struct packet_manager { struct mutex lock; bool allocated; struct kfd_mem_obj *ib_buffer_obj; + unsigned ib_size_bytes; struct packet_manager_firmware *pmf; }; @@ -924,6 +925,8 @@ int kfd_debugfs_mqds_by_process(struct seq_file *m, void *data); int pqm_debugfs_mqds(struct seq_file *m, void *data); int kfd_debugfs_hqds_by_device(struct seq_file *m, void *data); int device_queue_manager_debugfs_hqds(struct seq_file *m, void *data); +int kfd_debugfs_rls_by_device(struct seq_file *m, void *data); +int pm_debugfs_runlist(struct seq_file *m, void *data); #endif diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c index 99ae62592c58..b2f2a672af2b 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_topology.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_topology.c @@ -34,6 +34,7 @@ #include "kfd_priv.h" #include "kfd_crat.h" #include "kfd_topology.h" +#include "kfd_device_queue_manager.h" /* topology_device_list - Master list of all topology devices */ struct list_head topology_device_list; @@ -1267,3 +1268,28 @@ int kfd_debugfs_hqds_by_device(struct seq_file *m, void *data) return r; } + +int kfd_debugfs_rls_by_device(struct seq_file *m, void *data) +{ + struct kfd_topology_device *dev; + unsigned i = 0; + int r = 0; + + down_read(&topology_lock); + + list_for_each_entry(dev, &topology_device_list, list) { + if (!dev->gpu) { + i++; + continue; + } + + seq_printf(m, "Node %u, gpu_id %x:\n", i++, dev->gpu->id); + r = pm_debugfs_runlist(m, &dev->gpu->dqm->packets); + if (r != 0) + break; + } + + up_read(&topology_lock); + + return r; +} |