drm/v3d: use new debugfs device-centered functions
authorMaíra Canal <mcanal@igalia.com>
Mon, 19 Dec 2022 12:06:19 +0000 (09:06 -0300)
committerMaíra Canal <mairacanal@riseup.net>
Thu, 22 Dec 2022 17:59:23 +0000 (14:59 -0300)
Replace the use of drm_debugfs_create_files() with the new
drm_debugfs_add_files() function, which centers the debugfs files
management on the drm_device instead of drm_minor.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Melissa Wen <mwen@igalia.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Maíra Canal <mairacanal@riseup.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219120621.15086-6-mcanal@igalia.com
drivers/gpu/drm/v3d/v3d_debugfs.c

index efbde124c296629989a157654511900904936958..330669f51fa79eb090bfdd76fea11cf9d1e7b006 100644 (file)
@@ -79,8 +79,8 @@ static const struct v3d_reg_def v3d_csd_reg_defs[] = {
 
 static int v3d_v3d_debugfs_regs(struct seq_file *m, void *unused)
 {
-       struct drm_info_node *node = (struct drm_info_node *)m->private;
-       struct drm_device *dev = node->minor->dev;
+       struct drm_debugfs_entry *entry = m->private;
+       struct drm_device *dev = entry->dev;
        struct v3d_dev *v3d = to_v3d_dev(dev);
        int i, core;
 
@@ -126,8 +126,8 @@ static int v3d_v3d_debugfs_regs(struct seq_file *m, void *unused)
 
 static int v3d_v3d_debugfs_ident(struct seq_file *m, void *unused)
 {
-       struct drm_info_node *node = (struct drm_info_node *)m->private;
-       struct drm_device *dev = node->minor->dev;
+       struct drm_debugfs_entry *entry = m->private;
+       struct drm_device *dev = entry->dev;
        struct v3d_dev *v3d = to_v3d_dev(dev);
        u32 ident0, ident1, ident2, ident3, cores;
        int core;
@@ -188,8 +188,8 @@ static int v3d_v3d_debugfs_ident(struct seq_file *m, void *unused)
 
 static int v3d_debugfs_bo_stats(struct seq_file *m, void *unused)
 {
-       struct drm_info_node *node = (struct drm_info_node *)m->private;
-       struct drm_device *dev = node->minor->dev;
+       struct drm_debugfs_entry *entry = m->private;
+       struct drm_device *dev = entry->dev;
        struct v3d_dev *v3d = to_v3d_dev(dev);
 
        mutex_lock(&v3d->bo_lock);
@@ -204,8 +204,8 @@ static int v3d_debugfs_bo_stats(struct seq_file *m, void *unused)
 
 static int v3d_measure_clock(struct seq_file *m, void *unused)
 {
-       struct drm_info_node *node = (struct drm_info_node *)m->private;
-       struct drm_device *dev = node->minor->dev;
+       struct drm_debugfs_entry *entry = m->private;
+       struct drm_device *dev = entry->dev;
        struct v3d_dev *v3d = to_v3d_dev(dev);
        uint32_t cycles;
        int core = 0;
@@ -236,7 +236,7 @@ static int v3d_measure_clock(struct seq_file *m, void *unused)
        return 0;
 }
 
-static const struct drm_info_list v3d_debugfs_list[] = {
+static const struct drm_debugfs_info v3d_debugfs_list[] = {
        {"v3d_ident", v3d_v3d_debugfs_ident, 0},
        {"v3d_regs", v3d_v3d_debugfs_regs, 0},
        {"measure_clock", v3d_measure_clock, 0},
@@ -246,7 +246,5 @@ static const struct drm_info_list v3d_debugfs_list[] = {
 void
 v3d_debugfs_init(struct drm_minor *minor)
 {
-       drm_debugfs_create_files(v3d_debugfs_list,
-                                ARRAY_SIZE(v3d_debugfs_list),
-                                minor->debugfs_root, minor);
+       drm_debugfs_add_files(minor->dev, v3d_debugfs_list, ARRAY_SIZE(v3d_debugfs_list));
 }