[PATCH 3/3] drm/debugfs: remove dev->debugfs_list and debugfs_mutex
Stanislaw Gruszka
stanislaw.gruszka at linux.intel.com
Tue Feb 14 12:46:03 UTC 2023
On Tue, Feb 14, 2023 at 01:19:51PM +0100, Stanislaw Gruszka wrote:
> On Thu, Feb 09, 2023 at 09:18:38AM +0100, Christian König wrote:
> > -void drm_debugfs_late_register(struct drm_device *dev)
> > -{
> > - struct drm_minor *minor = dev->primary;
> > - struct drm_debugfs_entry *entry, *tmp;
> > -
> > - if (!minor)
> > - return;
> > -
> > - list_for_each_entry_safe(entry, tmp, &dev->debugfs_list, list) {
> > - debugfs_create_file(entry->file.name, 0444,
> > - minor->debugfs_root, entry, &drm_debugfs_entry_fops);
> > - list_del(&entry->list);
> > - }
> > }
> >
> > int drm_debugfs_remove_files(const struct drm_info_list *files, int count,
> > @@ -343,9 +321,13 @@ void drm_debugfs_add_file(struct drm_device *dev, const char *name,
> > entry->file.data = data;
> > entry->dev = dev;
> >
> > - mutex_lock(&dev->debugfs_mutex);
> > - list_add(&entry->list, &dev->debugfs_list);
> > - mutex_unlock(&dev->debugfs_mutex);
> > + debugfs_create_file(name, 0444, dev->primary->debugfs_root, entry,
> > + &drm_debugfs_entry_fops);
> > +
> > + /* TODO: This should probably only be a symlink */
> > + if (dev->render)
> > + debugfs_create_file(name, 0444, dev->render->debugfs_root,
> > + entry, &drm_debugfs_entry_fops);
>
> For accel we would need conditional check for DRM_MINOR_ACCEL here as
> well.
Actually my comment make no sense, since we do not have minor pointer
here. What is needed is additional dev->accel code like for dev->render,
perhaps also make dev->primary conditional.
Alternatively we can just create separate helper: accel_debugfs_add_file.
> With this change and one from first patch, drm_debugfs_add_file() should
> work for accel as well. We could get rid of debugfs_init from accel_debugfs_init().
>
> However we still need support for writable files. I think we can just
> add helper for providing debugfs dir to drivers i.e:
>
> struct dentry *accel_debugfs_dir(struct drm_device *drm)
> {
> return drm->accel->debugfs_root;
> }
or just this :-)
Regards
Stanislaw
More information about the dri-devel
mailing list