drm: move drm based debugfs funcs to drm_debugfs.c

Requirement is to create per client-id based directories to
hold key debugging information and for that access to
root debugfs dentry is need which is not in one place
and that information cannot be stored in drm_device.

Move the debugfs functionality from drm_drv.c and drm_accel.c
to drm_debugfs.c This enables debugfs root node reference
directly drm_debugfs.c and hence enable to create per client-id
directory.

v8: Create drm_accel dentry only if it's config is enabled (Jeff, Hugo)
v8: Merge drm_drv and drm_accel debugfs patches (Koenig, Christian)

v10: Since we moved drm_debugfs_root, hence to handle drm bridge
debugfs add a new function which call drm_bridge_debugfs_params where
drm_debugfs_root is accessible.

Suggested-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
Link: https://lore.kernel.org/r/20250704075548.1549849-2-sunil.khatri@amd.com
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Christian König <christian.koenig@amd.com>
This commit is contained in:
Sunil Khatri
2025-07-04 13:25:45 +05:30
committed by Christian König
parent 9cbc40521b
commit 348fe34a61
6 changed files with 55 additions and 44 deletions

View File

@@ -58,7 +58,6 @@ void accel_core_exit(void);
int accel_core_init(void);
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_device *dev);
void accel_debugfs_register(struct drm_device *dev);
#else
@@ -77,10 +76,6 @@ static inline void accel_set_device_instance_params(struct device *kdev, int ind
{
}
static inline void accel_debugfs_init(struct drm_device *dev)
{
}
static inline void accel_debugfs_register(struct drm_device *dev)
{
}

View File

@@ -572,9 +572,24 @@ static inline bool drm_firmware_drivers_only(void)
}
#if defined(CONFIG_DEBUG_FS)
void drm_debugfs_dev_init(struct drm_device *dev, struct dentry *root);
void drm_debugfs_dev_init(struct drm_device *dev);
void drm_debugfs_init_root(void);
void drm_debugfs_remove_root(void);
void drm_debugfs_bridge_params(void);
#else
static inline void drm_debugfs_dev_init(struct drm_device *dev, struct dentry *root)
static inline void drm_debugfs_dev_init(struct drm_device *dev)
{
}
static inline void drm_debugfs_init_root(void)
{
}
static inline void drm_debugfs_remove_root(void)
{
}
static inline void drm_debugfs_bridge_params(void)
{
}
#endif