Commit 03d2673b authored by Maíra Canal's avatar Maíra Canal Committed by Maíra Canal

drm/vkms: use new debugfs device-centered functions

Replace the use of drm_debugfs_create_files() with the new
drm_debugfs_add_files() function, which centers the debugfs files
management on the drm_device instead of drm_minor. Moreover, remove the
debugfs_init hook and add the debugfs files directly on vkms_create(),
before drm_dev_register().
Signed-off-by: default avatarMaíra Canal <mcanal@igalia.com>
Reviewed-by: default avatarMelissa Wen <mwen@igalia.com>
Acked-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: default avatarMaíra Canal <mairacanal@riseup.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20221219120621.15086-7-mcanal@igalia.com
parent c0dda238
...@@ -92,8 +92,8 @@ static void vkms_atomic_commit_tail(struct drm_atomic_state *old_state) ...@@ -92,8 +92,8 @@ static void vkms_atomic_commit_tail(struct drm_atomic_state *old_state)
static int vkms_config_show(struct seq_file *m, void *data) static int vkms_config_show(struct seq_file *m, void *data)
{ {
struct drm_info_node *node = (struct drm_info_node *)m->private; struct drm_debugfs_entry *entry = m->private;
struct drm_device *dev = node->minor->dev; struct drm_device *dev = entry->dev;
struct vkms_device *vkmsdev = drm_device_to_vkms_device(dev); struct vkms_device *vkmsdev = drm_device_to_vkms_device(dev);
seq_printf(m, "writeback=%d\n", vkmsdev->config->writeback); seq_printf(m, "writeback=%d\n", vkmsdev->config->writeback);
...@@ -103,24 +103,16 @@ static int vkms_config_show(struct seq_file *m, void *data) ...@@ -103,24 +103,16 @@ static int vkms_config_show(struct seq_file *m, void *data)
return 0; return 0;
} }
static const struct drm_info_list vkms_config_debugfs_list[] = { static const struct drm_debugfs_info vkms_config_debugfs_list[] = {
{ "vkms_config", vkms_config_show, 0 }, { "vkms_config", vkms_config_show, 0 },
}; };
static void vkms_config_debugfs_init(struct drm_minor *minor)
{
drm_debugfs_create_files(vkms_config_debugfs_list, ARRAY_SIZE(vkms_config_debugfs_list),
minor->debugfs_root, minor);
}
static const struct drm_driver vkms_driver = { static const struct drm_driver vkms_driver = {
.driver_features = DRIVER_MODESET | DRIVER_ATOMIC | DRIVER_GEM, .driver_features = DRIVER_MODESET | DRIVER_ATOMIC | DRIVER_GEM,
.release = vkms_release, .release = vkms_release,
.fops = &vkms_driver_fops, .fops = &vkms_driver_fops,
DRM_GEM_SHMEM_DRIVER_OPS, DRM_GEM_SHMEM_DRIVER_OPS,
.debugfs_init = vkms_config_debugfs_init,
.name = DRIVER_NAME, .name = DRIVER_NAME,
.desc = DRIVER_DESC, .desc = DRIVER_DESC,
.date = DRIVER_DATE, .date = DRIVER_DATE,
...@@ -202,6 +194,9 @@ static int vkms_create(struct vkms_config *config) ...@@ -202,6 +194,9 @@ static int vkms_create(struct vkms_config *config)
if (ret) if (ret)
goto out_devres; goto out_devres;
drm_debugfs_add_files(&vkms_device->drm, vkms_config_debugfs_list,
ARRAY_SIZE(vkms_config_debugfs_list));
ret = drm_dev_register(&vkms_device->drm, 0); ret = drm_dev_register(&vkms_device->drm, 0);
if (ret) if (ret)
goto out_devres; goto out_devres;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment