summaryrefslogtreecommitdiff
path: root/include/drm
diff options
context:
space:
mode:
authorChristian König <ckoenig.leichtzumerken@gmail.com>2023-08-29 14:01:13 +0300
committerChristian König <christian.koenig@amd.com>2023-09-01 09:51:18 +0300
commit0b30d57acafcaa5374756d314ee54f80d0bcc860 (patch)
tree39096f84ff057c447719d6cb284578f149802c55 /include/drm
parent19ecbe8325a2a7ffda5ff4790955b84eaccba49f (diff)
downloadlinux-0b30d57acafcaa5374756d314ee54f80d0bcc860.tar.xz
drm/debugfs: rework debugfs directory creation v5
Instead of the per minor directories only create a single debugfs directory for the whole device directly when the device is initialized. For DRM devices each minor gets a symlink to the per device directory for now until we can be sure that this isn't useful any more in any way. Accel devices create only the per device directory and also drops the mid layer callback to create driver specific files. v2: cleanup accel component as well v3: fix typo when debugfs is disabled v4: call drm_debugfs_dev_fini() during release as well, some kerneldoc typos fixed v5: rebased and one more kerneldoc fix Signed-off-by: Christian König <christian.koenig@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20230829110115.3442-4-christian.koenig@amd.com Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Diffstat (limited to 'include/drm')
-rw-r--r--include/drm/drm_accel.h9
-rw-r--r--include/drm/drm_bridge.h2
-rw-r--r--include/drm/drm_client.h2
-rw-r--r--include/drm/drm_device.h7
-rw-r--r--include/drm/drm_drv.h8
-rw-r--r--include/drm/drm_file.h1
6 files changed, 25 insertions, 4 deletions
diff --git a/include/drm/drm_accel.h b/include/drm/drm_accel.h
index d4955062c77e..f4d3784b1dce 100644
--- a/include/drm/drm_accel.h
+++ b/include/drm/drm_accel.h
@@ -58,7 +58,8 @@ int accel_minor_alloc(void);
void accel_minor_replace(struct drm_minor *minor, int index);
void accel_set_device_instance_params(struct device *kdev, int index);
int accel_open(struct inode *inode, struct file *filp);
-void accel_debugfs_init(struct drm_minor *minor, int minor_id);
+void accel_debugfs_init(struct drm_device *dev);
+void accel_debugfs_register(struct drm_device *dev);
#else
@@ -89,7 +90,11 @@ static inline void accel_set_device_instance_params(struct device *kdev, int ind
{
}
-static inline void accel_debugfs_init(struct drm_minor *minor, int minor_id)
+static inline void accel_debugfs_init(struct drm_device *dev)
+{
+}
+
+static inline void accel_debugfs_register(struct drm_device *dev)
{
}
diff --git a/include/drm/drm_bridge.h b/include/drm/drm_bridge.h
index c339fc85fd07..2dd94224f17e 100644
--- a/include/drm/drm_bridge.h
+++ b/include/drm/drm_bridge.h
@@ -950,6 +950,6 @@ static inline struct drm_bridge *drmm_of_get_bridge(struct drm_device *drm,
}
#endif
-void drm_bridge_debugfs_init(struct drm_minor *minor);
+void drm_bridge_debugfs_init(struct drm_device *dev);
#endif
diff --git a/include/drm/drm_client.h b/include/drm/drm_client.h
index c0a14b40c039..d47458ecdac4 100644
--- a/include/drm/drm_client.h
+++ b/include/drm/drm_client.h
@@ -195,6 +195,6 @@ int drm_client_modeset_dpms(struct drm_client_dev *client, int mode);
drm_for_each_connector_iter(connector, iter) \
if (connector->connector_type != DRM_MODE_CONNECTOR_WRITEBACK)
-void drm_client_debugfs_init(struct drm_minor *minor);
+void drm_client_debugfs_init(struct drm_device *dev);
#endif
diff --git a/include/drm/drm_device.h b/include/drm/drm_device.h
index 7cf4afae2e79..3cf12b14232d 100644
--- a/include/drm/drm_device.h
+++ b/include/drm/drm_device.h
@@ -312,6 +312,13 @@ struct drm_device {
struct drm_fb_helper *fb_helper;
/**
+ * @debugfs_root:
+ *
+ * Root directory for debugfs files.
+ */
+ struct dentry *debugfs_root;
+
+ /**
* @debugfs_mutex:
*
* Protects &debugfs_list access.
diff --git a/include/drm/drm_drv.h b/include/drm/drm_drv.h
index 9813fa759b75..9850fe73b739 100644
--- a/include/drm/drm_drv.h
+++ b/include/drm/drm_drv.h
@@ -581,4 +581,12 @@ static inline bool drm_firmware_drivers_only(void)
return video_firmware_drivers_only();
}
+#if defined(CONFIG_DEBUG_FS)
+void drm_debugfs_dev_init(struct drm_device *dev, struct dentry *root);
+#else
+static void drm_debugfs_dev_init(struct drm_device *dev, struct dentry *root)
+{
+}
+#endif
+
#endif
diff --git a/include/drm/drm_file.h b/include/drm/drm_file.h
index 010239392adf..12930a08368c 100644
--- a/include/drm/drm_file.h
+++ b/include/drm/drm_file.h
@@ -79,6 +79,7 @@ struct drm_minor {
struct device *kdev; /* Linux device */
struct drm_device *dev;
+ struct dentry *debugfs_symlink;
struct dentry *debugfs_root;
struct list_head debugfs_list;