[RFC 0/1] drm/mipi-dbi: Use drm_device for debugfs, drop drm_minor

Jagath Jog J posted 1 patch 9 months, 3 weeks ago
drivers/gpu/drm/drm_mipi_dbi.c        | 8 ++++----
drivers/gpu/drm/tiny/ili9163.c        | 3 ++-
drivers/gpu/drm/tiny/panel-mipi-dbi.c | 3 ++-
include/drm/drm_mipi_dbi.h            | 4 ++--
4 files changed, 10 insertions(+), 8 deletions(-)
[RFC 0/1] drm/mipi-dbi: Use drm_device for debugfs, drop drm_minor
Posted by Jagath Jog J 9 months, 3 weeks ago
This patch updates the MIPI DBI driver to use drm_device.debugfs_root
instead of drm_minor for creating debugfs files. The debugfs setup is now
done earlier in probe(), before drm_dev_register(), and the drivers can
avoid using the .debugfs_init callback.

This is an initial version, and only a few drivers are updated for now.

I noticed that some newer drivers or patches still use
drm_debugfs_create_files(), which relies on drm_minor. I was wondering if
there is a specific reason for this, or if there's a plan to switch to
drm_debugfs_add_files? I can send patches to update more drivers if
that helps.

This patch helps move toward the debugfs cleanup task listed here:
https://docs.kernel.org/gpu/todo.html#clean-up-the-debugfs-support

Looking forward to your feedback.

Jagath Jog J (1):
  drm/mipi-dbi: Use drm_device for debugfs, drop drm_minor and
    .debugfs_init

 drivers/gpu/drm/drm_mipi_dbi.c        | 8 ++++----
 drivers/gpu/drm/tiny/ili9163.c        | 3 ++-
 drivers/gpu/drm/tiny/panel-mipi-dbi.c | 3 ++-
 include/drm/drm_mipi_dbi.h            | 4 ++--
 4 files changed, 10 insertions(+), 8 deletions(-)

-- 
2.20.1
Re: [RFC 0/1] drm/mipi-dbi: Use drm_device for debugfs, drop drm_minor
Posted by Maíra Canal 9 months, 2 weeks ago
Hi Jagath,

On 21/04/25 05:59, Jagath Jog J wrote:
> This patch updates the MIPI DBI driver to use drm_device.debugfs_root
> instead of drm_minor for creating debugfs files. The debugfs setup is now
> done earlier in probe(), before drm_dev_register(), and the drivers can
> avoid using the .debugfs_init callback.
> 
> This is an initial version, and only a few drivers are updated for now.
> 
> I noticed that some newer drivers or patches still use
> drm_debugfs_create_files(), which relies on drm_minor. I was wondering if
> there is a specific reason for this, or if there's a plan to switch to
> drm_debugfs_add_files? I can send patches to update more drivers if
> that helps.

Yes, there was a plan to switch to drm_debugfs_add_files(), as it
centers the debugfs files management on the drm_device instead of
drm_minor.

But, in the end, we concluded that we needed a few more changes in the
infrastructure to make things more generic. Here are some discussions
[1][2] and this was my plan to make things more generic [3], which
needed some improvements.

It would be create if you help us to cleanup debugfs and feel free to
use my patches as a base for it.

[1] 
https://lore.kernel.org/dri-devel/20230209081838.45273-1-christian.koenig@amd.com/
[2] https://lore.kernel.org/dri-devel/87eds0gm9b.fsf@intel.com/
[3] 
https://lore.kernel.org/dri-devel/20230131195825.677487-1-mcanal@igalia.com/

Best Regards,
- Maíra

> 
> This patch helps move toward the debugfs cleanup task listed here:
> https://docs.kernel.org/gpu/todo.html#clean-up-the-debugfs-support
> 
> Looking forward to your feedback.
> 
> Jagath Jog J (1):
>    drm/mipi-dbi: Use drm_device for debugfs, drop drm_minor and
>      .debugfs_init
> 
>   drivers/gpu/drm/drm_mipi_dbi.c        | 8 ++++----
>   drivers/gpu/drm/tiny/ili9163.c        | 3 ++-
>   drivers/gpu/drm/tiny/panel-mipi-dbi.c | 3 ++-
>   include/drm/drm_mipi_dbi.h            | 4 ++--
>   4 files changed, 10 insertions(+), 8 deletions(-)
> 

Re: [RFC 0/1] drm/mipi-dbi: Use drm_device for debugfs, drop drm_minor
Posted by Jagath Jog J 9 months, 2 weeks ago
Hi Maíra,

On Wed, Apr 23, 2025 at 4:22 PM Maíra Canal <mcanal@igalia.com> wrote:
>
> Hi Jagath,
>
> On 21/04/25 05:59, Jagath Jog J wrote:
> > This patch updates the MIPI DBI driver to use drm_device.debugfs_root
> > instead of drm_minor for creating debugfs files. The debugfs setup is now
> > done earlier in probe(), before drm_dev_register(), and the drivers can
> > avoid using the .debugfs_init callback.
> >
> > This is an initial version, and only a few drivers are updated for now.
> >
> > I noticed that some newer drivers or patches still use
> > drm_debugfs_create_files(), which relies on drm_minor. I was wondering if
> > there is a specific reason for this, or if there's a plan to switch to
> > drm_debugfs_add_files? I can send patches to update more drivers if
> > that helps.
>
> Yes, there was a plan to switch to drm_debugfs_add_files(), as it
> centers the debugfs files management on the drm_device instead of
> drm_minor.
>
> But, in the end, we concluded that we needed a few more changes in the
> infrastructure to make things more generic. Here are some discussions
> [1][2] and this was my plan to make things more generic [3], which
> needed some improvements.
>
> It would be create if you help us to cleanup debugfs and feel free to
> use my patches as a base for it.
>
> [1]
> https://lore.kernel.org/dri-devel/20230209081838.45273-1-christian.koenig@amd.com/
> [2] https://lore.kernel.org/dri-devel/87eds0gm9b.fsf@intel.com/
> [3]
> https://lore.kernel.org/dri-devel/20230131195825.677487-1-mcanal@igalia.com/

Thanks for sharing the links. I had missed these discussions.
I will go through them and get back soon. Since these touch core DRM infra,
I will study the changes more closely before proceeding.
Thanks for sharing your patches as a base, that should help a lot.


Regards
Jagath

>
> Best Regards,
> - Maíra
>
> >
> > This patch helps move toward the debugfs cleanup task listed here:
> > https://docs.kernel.org/gpu/todo.html#clean-up-the-debugfs-support
> >
> > Looking forward to your feedback.
> >
> > Jagath Jog J (1):
> >    drm/mipi-dbi: Use drm_device for debugfs, drop drm_minor and
> >      .debugfs_init
> >
> >   drivers/gpu/drm/drm_mipi_dbi.c        | 8 ++++----
> >   drivers/gpu/drm/tiny/ili9163.c        | 3 ++-
> >   drivers/gpu/drm/tiny/panel-mipi-dbi.c | 3 ++-
> >   include/drm/drm_mipi_dbi.h            | 4 ++--
> >   4 files changed, 10 insertions(+), 8 deletions(-)
> >
>