diff options
author | Noralf Trønnes <noralf@tronnes.org> | 2018-07-03 18:03:51 +0200 |
---|---|---|
committer | Noralf Trønnes <noralf@tronnes.org> | 2018-07-10 14:53:35 +0200 |
commit | e896c132eb2cb4975d99477ea7e95aedb6dffa95 (patch) | |
tree | 2c3d7befcc54a7ca2de048b5ecfaed187becc44d /drivers/gpu/drm/drm_client.c | |
parent | 894a677f4b3e6d2ab8d01bb46c1fbd5f92e4591b (diff) |
drm/debugfs: Add internal client debugfs file
Print the names of the internal clients currently attached.
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20180703160354.59955-6-noralf@tronnes.org
Diffstat (limited to 'drivers/gpu/drm/drm_client.c')
-rw-r--r-- | drivers/gpu/drm/drm_client.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_client.c b/drivers/gpu/drm/drm_client.c index 743495f7f833..4039a4d103a8 100644 --- a/drivers/gpu/drm/drm_client.c +++ b/drivers/gpu/drm/drm_client.c @@ -385,3 +385,31 @@ void drm_client_framebuffer_delete(struct drm_client_buffer *buffer) drm_client_buffer_delete(buffer); } EXPORT_SYMBOL(drm_client_framebuffer_delete); + +#ifdef CONFIG_DEBUG_FS +static int drm_client_debugfs_internal_clients(struct seq_file *m, void *data) +{ + struct drm_info_node *node = m->private; + struct drm_device *dev = node->minor->dev; + struct drm_printer p = drm_seq_file_printer(m); + struct drm_client_dev *client; + + mutex_lock(&dev->clientlist_mutex); + list_for_each_entry(client, &dev->clientlist, list) + drm_printf(&p, "%s\n", client->name); + mutex_unlock(&dev->clientlist_mutex); + + return 0; +} + +static const struct drm_info_list drm_client_debugfs_list[] = { + { "internal_clients", drm_client_debugfs_internal_clients, 0 }, +}; + +int drm_client_debugfs_init(struct drm_minor *minor) +{ + return drm_debugfs_create_files(drm_client_debugfs_list, + ARRAY_SIZE(drm_client_debugfs_list), + minor->debugfs_root, minor); +} +#endif |