DRM accel and debugfs/sysfs

Maíra Canal mcanal at igalia.com
Tue Feb 7 16:17:47 UTC 2023


On 2/7/23 12:43, Jeffrey Hugo wrote:
> On 2/7/2023 4:31 AM, Maíra Canal wrote:
>> Hi Stanislaw,
>>
>> On 2/1/23 12:20, Stanislaw Gruszka wrote:
>>> Hi
>>>
>>> I was about to send debugfs support for ivpu and noticed that there
>>> are current changes that deprecate drm_devel->debugfs_init callback.
>>>
>>> Further I looked at this commit [1], that stated we should not
>>> use drm_minor for debugfs and sysfs. What is quite contrary to
>>> what drm accel framework did in the first place.
>>>
>>> So my question is how we should use debugfs/sysfs in accel?
>>> Use it with old fashioned minor-centric way or change
>>> the framework somehow ?
>>
>> As we are trying to replace drm_debugfs_create_files() [1], it would
>> be nice to see the accel debugfs support use the new debugfs API. This
>> would mean using the debugfs_list from the drm_device, deprecating
>> the debugfs_init callback, and adding the a similar code snippet to
>> accel_debugfs_init:
>>
>> 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);
>>
>> Maybe Daniel has some more thoughts on this matter, but I guess it
>> would be better to drop the use of the old-fashioned minor-centric
>> implementation in accel.
>>
>> [1] https://cgit.freedesktop.org/drm/drm-misc/tree/Documentation/gpu/todo.rst#n511
>>
>> Best Regards,
>> - Maíra Canal
> 
> Thank you for the details Maira.  It helps to explain what the todo is suggesting.  Is there an example of a driver/drm_device that uses debugfs_list which you can easily point to?

The implementation of this device-centered infrastructure is linked in [1]
and an example of the conversion of debugfs APIs is linked in [2], and other
drivers such as v3d, vkms, vc4 and gud use this new API as well.

[1] https://cgit.freedesktop.org/drm/drm-misc/commit/?id=1c9cacbea880513a896aee65a5c58007bcb55653
[2] https://cgit.freedesktop.org/drm/drm-misc/commit/?id=2e3ab8a6994f265bbd4dbd00448b84548f18464c

Best Regards,
- Maíra Canal

> 
> -Jeff
> 
>>
>>>
>>> [1] https://cgit.freedesktop.org/drm/drm-misc/commit/?id=99845faae7099cd704ebf67514c1157c26960a26
>>>
>>> Regards
>>> Stanislaw
>>>
> 


More information about the dri-devel mailing list