[PATCH 2/3] drm/debugfs: split registration into dev and minor

Maíra Canal mcanal at igalia.com
Thu Feb 9 11:12:51 UTC 2023


On 2/9/23 05:18, Christian König wrote:
> The different subsystems should probably only register their debugfs
> files once.
> 
> This temporary removes the common files from the render node directory.
> 
> Signed-off-by: Christian König <christian.koenig at amd.com>
> ---
>   drivers/gpu/drm/drm_atomic.c        |  4 ++--
>   drivers/gpu/drm/drm_client.c        |  4 ++--
>   drivers/gpu/drm/drm_crtc_internal.h |  2 +-
>   drivers/gpu/drm/drm_debugfs.c       | 24 ++++++++++++------------
>   drivers/gpu/drm/drm_drv.c           |  4 +++-
>   drivers/gpu/drm/drm_framebuffer.c   |  4 ++--
>   drivers/gpu/drm/drm_internal.h      |  5 +++--
>   include/drm/drm_client.h            |  2 +-
>   8 files changed, 26 insertions(+), 23 deletions(-)
> 

[...]

> diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h
> index 332fb65a935a..5ff7bf88f162 100644
> --- a/drivers/gpu/drm/drm_internal.h
> +++ b/drivers/gpu/drm/drm_internal.h
> @@ -185,7 +185,8 @@ int drm_gem_dumb_destroy(struct drm_file *file, struct drm_device *dev,
>   #if defined(CONFIG_DEBUG_FS)
>   int drm_debugfs_init(struct drm_minor *minor, int minor_id,
>   		     struct dentry *root);
> -void drm_debugfs_register(struct drm_minor *minor);
> +void drm_debugfs_dev_register(struct drm_device *dev);
> +void drm_debugfs_minor_register(struct drm_minor *minor);

For this patch and the previous one, I believe you need to add the functions
to the #else path as well, otherwise it won't compile for CONFIG_DEBUG_FS=n.

Best Regards,
- Maíra Canal

>   void drm_debugfs_cleanup(struct drm_minor *minor);
>   void drm_debugfs_late_register(struct drm_device *dev);
>   void drm_debugfs_connector_add(struct drm_connector *connector);
> @@ -261,4 +262,4 @@ int drm_syncobj_query_ioctl(struct drm_device *dev, void *data,
>   /* drm_framebuffer.c */
>   void drm_framebuffer_print_info(struct drm_printer *p, unsigned int indent,
>   				const struct drm_framebuffer *fb);
> -void drm_framebuffer_debugfs_init(struct drm_minor *minor);
> +void drm_framebuffer_debugfs_init(struct drm_device *dev);
> diff --git a/include/drm/drm_client.h b/include/drm/drm_client.h
> index 39482527a775..507d132cf494 100644
> --- a/include/drm/drm_client.h
> +++ b/include/drm/drm_client.h
> @@ -200,6 +200,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


More information about the dri-devel mailing list