Commit 6fd80729 authored by Maíra Canal's avatar Maíra Canal Committed by Maíra Canal

drm: use new debugfs device-centered functions on DRM core files

Replace the use of drm_debugfs_create_files() with the new
drm_debugfs_add_files() function in all DRM core files, centering the
debugfs files management on the drm_device instead of drm_minor.
Signed-off-by: default avatarMaíra Canal <mcanal@igalia.com>
Reviewed-by: default avatarMaxime Ripard <maxime@cerno.tech>
Reviewed-by: default avatarMelissa Wen <mwen@igalia.com>
Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarMaíra Canal <mairacanal@riseup.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219120621.15086-3-mcanal@igalia.com
parent 1c9cacbe
...@@ -1756,8 +1756,8 @@ EXPORT_SYMBOL(drm_state_dump); ...@@ -1756,8 +1756,8 @@ EXPORT_SYMBOL(drm_state_dump);
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
static int drm_state_info(struct seq_file *m, void *data) static int drm_state_info(struct seq_file *m, void *data)
{ {
struct drm_info_node *node = (struct drm_info_node *) m->private; struct drm_debugfs_entry *entry = m->private;
struct drm_device *dev = node->minor->dev; struct drm_device *dev = entry->dev;
struct drm_printer p = drm_seq_file_printer(m); struct drm_printer p = drm_seq_file_printer(m);
__drm_state_dump(dev, &p, true); __drm_state_dump(dev, &p, true);
...@@ -1766,14 +1766,13 @@ static int drm_state_info(struct seq_file *m, void *data) ...@@ -1766,14 +1766,13 @@ static int drm_state_info(struct seq_file *m, void *data)
} }
/* any use in debugfs files to dump individual planes/crtc/etc? */ /* any use in debugfs files to dump individual planes/crtc/etc? */
static const struct drm_info_list drm_atomic_debugfs_list[] = { static const struct drm_debugfs_info drm_atomic_debugfs_list[] = {
{"state", drm_state_info, 0}, {"state", drm_state_info, 0},
}; };
void drm_atomic_debugfs_init(struct drm_minor *minor) void drm_atomic_debugfs_init(struct drm_minor *minor)
{ {
drm_debugfs_create_files(drm_atomic_debugfs_list, drm_debugfs_add_files(minor->dev, drm_atomic_debugfs_list,
ARRAY_SIZE(drm_atomic_debugfs_list), ARRAY_SIZE(drm_atomic_debugfs_list));
minor->debugfs_root, minor);
} }
#endif #endif
...@@ -480,8 +480,8 @@ EXPORT_SYMBOL(drm_client_framebuffer_flush); ...@@ -480,8 +480,8 @@ EXPORT_SYMBOL(drm_client_framebuffer_flush);
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
static int drm_client_debugfs_internal_clients(struct seq_file *m, void *data) static int drm_client_debugfs_internal_clients(struct seq_file *m, void *data)
{ {
struct drm_info_node *node = m->private; struct drm_debugfs_entry *entry = m->private;
struct drm_device *dev = node->minor->dev; struct drm_device *dev = entry->dev;
struct drm_printer p = drm_seq_file_printer(m); struct drm_printer p = drm_seq_file_printer(m);
struct drm_client_dev *client; struct drm_client_dev *client;
...@@ -493,14 +493,13 @@ static int drm_client_debugfs_internal_clients(struct seq_file *m, void *data) ...@@ -493,14 +493,13 @@ static int drm_client_debugfs_internal_clients(struct seq_file *m, void *data)
return 0; return 0;
} }
static const struct drm_info_list drm_client_debugfs_list[] = { static const struct drm_debugfs_info drm_client_debugfs_list[] = {
{ "internal_clients", drm_client_debugfs_internal_clients, 0 }, { "internal_clients", drm_client_debugfs_internal_clients, 0 },
}; };
void drm_client_debugfs_init(struct drm_minor *minor) void drm_client_debugfs_init(struct drm_minor *minor)
{ {
drm_debugfs_create_files(drm_client_debugfs_list, drm_debugfs_add_files(minor->dev, drm_client_debugfs_list,
ARRAY_SIZE(drm_client_debugfs_list), ARRAY_SIZE(drm_client_debugfs_list));
minor->debugfs_root, minor);
} }
#endif #endif
...@@ -51,9 +51,8 @@ ...@@ -51,9 +51,8 @@
static int drm_name_info(struct seq_file *m, void *data) static int drm_name_info(struct seq_file *m, void *data)
{ {
struct drm_info_node *node = (struct drm_info_node *) m->private; struct drm_debugfs_entry *entry = m->private;
struct drm_minor *minor = node->minor; struct drm_device *dev = entry->dev;
struct drm_device *dev = minor->dev;
struct drm_master *master; struct drm_master *master;
mutex_lock(&dev->master_mutex); mutex_lock(&dev->master_mutex);
...@@ -73,8 +72,8 @@ static int drm_name_info(struct seq_file *m, void *data) ...@@ -73,8 +72,8 @@ static int drm_name_info(struct seq_file *m, void *data)
static int drm_clients_info(struct seq_file *m, void *data) static int drm_clients_info(struct seq_file *m, void *data)
{ {
struct drm_info_node *node = (struct drm_info_node *) m->private; struct drm_debugfs_entry *entry = m->private;
struct drm_device *dev = node->minor->dev; struct drm_device *dev = entry->dev;
struct drm_file *priv; struct drm_file *priv;
kuid_t uid; kuid_t uid;
...@@ -125,8 +124,8 @@ static int drm_gem_one_name_info(int id, void *ptr, void *data) ...@@ -125,8 +124,8 @@ static int drm_gem_one_name_info(int id, void *ptr, void *data)
static int drm_gem_name_info(struct seq_file *m, void *data) static int drm_gem_name_info(struct seq_file *m, void *data)
{ {
struct drm_info_node *node = (struct drm_info_node *) m->private; struct drm_debugfs_entry *entry = m->private;
struct drm_device *dev = node->minor->dev; struct drm_device *dev = entry->dev;
seq_printf(m, " name size handles refcount\n"); seq_printf(m, " name size handles refcount\n");
...@@ -137,7 +136,7 @@ static int drm_gem_name_info(struct seq_file *m, void *data) ...@@ -137,7 +136,7 @@ static int drm_gem_name_info(struct seq_file *m, void *data)
return 0; return 0;
} }
static const struct drm_info_list drm_debugfs_list[] = { static const struct drm_debugfs_info drm_debugfs_list[] = {
{"name", drm_name_info, 0}, {"name", drm_name_info, 0},
{"clients", drm_clients_info, 0}, {"clients", drm_clients_info, 0},
{"gem_names", drm_gem_name_info, DRIVER_GEM}, {"gem_names", drm_gem_name_info, DRIVER_GEM},
...@@ -231,8 +230,7 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id, ...@@ -231,8 +230,7 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id,
sprintf(name, "%d", minor_id); sprintf(name, "%d", minor_id);
minor->debugfs_root = debugfs_create_dir(name, root); minor->debugfs_root = debugfs_create_dir(name, root);
drm_debugfs_create_files(drm_debugfs_list, DRM_DEBUGFS_ENTRIES, drm_debugfs_add_files(minor->dev, drm_debugfs_list, DRM_DEBUGFS_ENTRIES);
minor->debugfs_root, minor);
if (drm_drv_uses_atomic_modeset(dev)) { if (drm_drv_uses_atomic_modeset(dev)) {
drm_atomic_debugfs_init(minor); drm_atomic_debugfs_init(minor);
......
...@@ -1203,8 +1203,8 @@ void drm_framebuffer_print_info(struct drm_printer *p, unsigned int indent, ...@@ -1203,8 +1203,8 @@ void drm_framebuffer_print_info(struct drm_printer *p, unsigned int indent,
#ifdef CONFIG_DEBUG_FS #ifdef CONFIG_DEBUG_FS
static int drm_framebuffer_info(struct seq_file *m, void *data) static int drm_framebuffer_info(struct seq_file *m, void *data)
{ {
struct drm_info_node *node = m->private; struct drm_debugfs_entry *entry = m->private;
struct drm_device *dev = node->minor->dev; struct drm_device *dev = entry->dev;
struct drm_printer p = drm_seq_file_printer(m); struct drm_printer p = drm_seq_file_printer(m);
struct drm_framebuffer *fb; struct drm_framebuffer *fb;
...@@ -1218,14 +1218,13 @@ static int drm_framebuffer_info(struct seq_file *m, void *data) ...@@ -1218,14 +1218,13 @@ static int drm_framebuffer_info(struct seq_file *m, void *data)
return 0; return 0;
} }
static const struct drm_info_list drm_framebuffer_debugfs_list[] = { static const struct drm_debugfs_info drm_framebuffer_debugfs_list[] = {
{ "framebuffer", drm_framebuffer_info, 0 }, { "framebuffer", drm_framebuffer_info, 0 },
}; };
void drm_framebuffer_debugfs_init(struct drm_minor *minor) void drm_framebuffer_debugfs_init(struct drm_minor *minor)
{ {
drm_debugfs_create_files(drm_framebuffer_debugfs_list, drm_debugfs_add_files(minor->dev, drm_framebuffer_debugfs_list,
ARRAY_SIZE(drm_framebuffer_debugfs_list), ARRAY_SIZE(drm_framebuffer_debugfs_list));
minor->debugfs_root, minor);
} }
#endif #endif
...@@ -957,8 +957,8 @@ static struct ttm_device_funcs bo_driver = { ...@@ -957,8 +957,8 @@ static struct ttm_device_funcs bo_driver = {
static int drm_vram_mm_debugfs(struct seq_file *m, void *data) static int drm_vram_mm_debugfs(struct seq_file *m, void *data)
{ {
struct drm_info_node *node = (struct drm_info_node *) m->private; struct drm_debugfs_entry *entry = m->private;
struct drm_vram_mm *vmm = node->minor->dev->vram_mm; struct drm_vram_mm *vmm = entry->dev->vram_mm;
struct ttm_resource_manager *man = ttm_manager_type(&vmm->bdev, TTM_PL_VRAM); struct ttm_resource_manager *man = ttm_manager_type(&vmm->bdev, TTM_PL_VRAM);
struct drm_printer p = drm_seq_file_printer(m); struct drm_printer p = drm_seq_file_printer(m);
...@@ -966,7 +966,7 @@ static int drm_vram_mm_debugfs(struct seq_file *m, void *data) ...@@ -966,7 +966,7 @@ static int drm_vram_mm_debugfs(struct seq_file *m, void *data)
return 0; return 0;
} }
static const struct drm_info_list drm_vram_mm_debugfs_list[] = { static const struct drm_debugfs_info drm_vram_mm_debugfs_list[] = {
{ "vram-mm", drm_vram_mm_debugfs, 0, NULL }, { "vram-mm", drm_vram_mm_debugfs, 0, NULL },
}; };
...@@ -978,9 +978,8 @@ static const struct drm_info_list drm_vram_mm_debugfs_list[] = { ...@@ -978,9 +978,8 @@ static const struct drm_info_list drm_vram_mm_debugfs_list[] = {
*/ */
void drm_vram_mm_debugfs_init(struct drm_minor *minor) void drm_vram_mm_debugfs_init(struct drm_minor *minor)
{ {
drm_debugfs_create_files(drm_vram_mm_debugfs_list, drm_debugfs_add_files(minor->dev, drm_vram_mm_debugfs_list,
ARRAY_SIZE(drm_vram_mm_debugfs_list), ARRAY_SIZE(drm_vram_mm_debugfs_list));
minor->debugfs_root, minor);
} }
EXPORT_SYMBOL(drm_vram_mm_debugfs_init); EXPORT_SYMBOL(drm_vram_mm_debugfs_init);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment