]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/panthor: Move panthor_gems_debugfs_init() to panthor_gem.c
authorBoris Brezillon <boris.brezillon@collabora.com>
Wed, 1 Apr 2026 13:48:47 +0000 (15:48 +0200)
committerBoris Brezillon <boris.brezillon@collabora.com>
Fri, 3 Apr 2026 11:23:27 +0000 (13:23 +0200)
There's no reason for panthor_drv to know about panthor_gem.c internals,
so let's move the GEM debugfs init logic to panthor_gem.c.

v2:
- Collect R-bs

v3:
-No changes

v4:
- No changes

v5:
- No changes

v6:
- No changes

v7:
- No changes

Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Link: https://patch.msgid.link/20260401134854.2275433-4-boris.brezillon@collabora.com
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
drivers/gpu/drm/panthor/panthor_drv.c
drivers/gpu/drm/panthor/panthor_gem.c
drivers/gpu/drm/panthor/panthor_gem.h

index 87d27c3c145693ad14f4bd099d38ebc7c9856762..b1339d4db0a9124e7089d9669b2302288110595e 100644 (file)
@@ -1756,34 +1756,10 @@ static const struct file_operations panthor_drm_driver_fops = {
 };
 
 #ifdef CONFIG_DEBUG_FS
-static int panthor_gems_show(struct seq_file *m, void *data)
-{
-       struct drm_info_node *node = m->private;
-       struct drm_device *dev = node->minor->dev;
-       struct panthor_device *ptdev = container_of(dev, struct panthor_device, base);
-
-       panthor_gem_debugfs_print_bos(ptdev, m);
-
-       return 0;
-}
-
-static struct drm_info_list panthor_debugfs_list[] = {
-       {"gems", panthor_gems_show, 0, NULL},
-};
-
-static int panthor_gems_debugfs_init(struct drm_minor *minor)
-{
-       drm_debugfs_create_files(panthor_debugfs_list,
-                                ARRAY_SIZE(panthor_debugfs_list),
-                                minor->debugfs_root, minor);
-
-       return 0;
-}
-
 static void panthor_debugfs_init(struct drm_minor *minor)
 {
        panthor_mmu_debugfs_init(minor);
-       panthor_gems_debugfs_init(minor);
+       panthor_gem_debugfs_init(minor);
 }
 #endif
 
index 6d14b0269574a41d37994ea94142acc471c7e613..c7b8b84a8f8b7daf0d70414822ff94a088304449 100644 (file)
@@ -9,6 +9,8 @@
 #include <linux/err.h>
 #include <linux/slab.h>
 
+#include <drm/drm_debugfs.h>
+#include <drm/drm_file.h>
 #include <drm/drm_print.h>
 #include <drm/panthor_drm.h>
 
@@ -683,8 +685,8 @@ static void panthor_gem_debugfs_bo_print(struct panthor_gem_object *bo,
                totals->reclaimable += resident_size;
 }
 
-void panthor_gem_debugfs_print_bos(struct panthor_device *ptdev,
-                                  struct seq_file *m)
+static void panthor_gem_debugfs_print_bos(struct panthor_device *ptdev,
+                                         struct seq_file *m)
 {
        struct gem_size_totals totals = {0};
        struct panthor_gem_object *bo;
@@ -704,4 +706,27 @@ void panthor_gem_debugfs_print_bos(struct panthor_device *ptdev,
        seq_printf(m, "Total size: %zd, Total resident: %zd, Total reclaimable: %zd\n",
                   totals.size, totals.resident, totals.reclaimable);
 }
+
+static int panthor_gem_show_bos(struct seq_file *m, void *data)
+{
+       struct drm_info_node *node = m->private;
+       struct drm_device *dev = node->minor->dev;
+       struct panthor_device *ptdev =
+               container_of(dev, struct panthor_device, base);
+
+       panthor_gem_debugfs_print_bos(ptdev, m);
+
+       return 0;
+}
+
+static struct drm_info_list panthor_gem_debugfs_list[] = {
+       { "gems", panthor_gem_show_bos, 0, NULL },
+};
+
+void panthor_gem_debugfs_init(struct drm_minor *minor)
+{
+       drm_debugfs_create_files(panthor_gem_debugfs_list,
+                                ARRAY_SIZE(panthor_gem_debugfs_list),
+                                minor->debugfs_root, minor);
+}
 #endif
index 22519c570b5a925500f9ec24aa5453957740b58e..94b2d17cf03298ffacc5ade15c8b1f6407fa07a4 100644 (file)
@@ -203,8 +203,7 @@ panthor_kernel_bo_create(struct panthor_device *ptdev, struct panthor_vm *vm,
 void panthor_kernel_bo_destroy(struct panthor_kernel_bo *bo);
 
 #ifdef CONFIG_DEBUG_FS
-void panthor_gem_debugfs_print_bos(struct panthor_device *pfdev,
-                                  struct seq_file *m);
+void panthor_gem_debugfs_init(struct drm_minor *minor);
 #endif
 
 #endif /* __PANTHOR_GEM_H__ */