Re: [PATCH v2 5/9] rust: drm: add debugfs_init callback to Driver trait

"Danilo Krummrich" <[email protected]> Mon, 03 Aug 2026 19:55:50 +0200
Newsgroups gmane.linux.kernel.rust,gmane.comp.video.dri.devel
Message-ID <[email protected]>
On Thu Jul 30, 2026 at 7:05 PM CEST, Alvin Sun wrote:
> +    /// Populates debugfs for this DRM device.
> +    ///
> +    /// Called by the DRM core during registration, once per minor (callback
> +    /// runs after `dev->registered`).
> +    fn debugfs_init<'a>(_dev: &'a drm::Device<Self, drm::Normal>, _dir: &ScopedDir<'a, 'static>)
> +    where
> +        Self: Sized,
> +    {
> +    }
>  }

This could just be

	fn debugfs_init(dir: &debugfs::ScopeRef<'_, Self::RegistrationData<'_>>)

as it is only needed to populate files / directories for exposing things in
RegistrationData.

Subsequent debugfs::Scopes can be registered from drm::File<'_>::open() and
IOCTLs (I also work on introducing HRT private data for IOCTLs; semantically
equivalent to a Vec in DriverFile<'_> or RegistrationData<'_>, but managed by
the subsystem).