2022-12-26 16:06:02

by Maíra Canal

[permalink] [raw]
Subject: [PATCH 0/9] Convert drivers to the new debugfs device-centered functions

The commit 1c9cacbea880 ("drm/debugfs: create device-centered debugfs functions")
introduced new device-centered debugfs functions, which center the debugfs files
management on the drm_device instead of drm_minor. Therefore, this patchset
converts 8 drivers to this new debugfs device-centered structure as it was already
performed on the vc4 (f2ede40e46e8), v3d (c0dda238e264), and vkms (03d2673bb757)
drivers.

Best Regards,
- Maíra Canal

Maíra Canal (9):
drm/etnaviv: use new debugfs device-centered functions
drm/gud: use new debugfs device-centered functions
drm/arm/hdlcd: use new debugfs device-centered functions
drm/pl111: use new debugfs device-centered functions
drm/arc: use new debugfs device-centered functions
drm/virtio: use new debugfs device-centered functions
drm/omap: use new debugfs device-centered functions
drm/qxl: remove unused debugfs structure
drm/qxl: use new debugfs device-centered functions

drivers/gpu/drm/arm/hdlcd_drv.c | 24 +++++-------
drivers/gpu/drm/etnaviv/etnaviv_drv.c | 29 ++++++---------
drivers/gpu/drm/gud/gud_drv.c | 17 ++-------
drivers/gpu/drm/omapdrm/omap_debugfs.c | 29 +++++----------
drivers/gpu/drm/omapdrm/omap_drv.c | 7 ++--
drivers/gpu/drm/omapdrm/omap_drv.h | 2 +-
drivers/gpu/drm/pl111/pl111_debugfs.c | 15 ++------
drivers/gpu/drm/pl111/pl111_drm.h | 2 +-
drivers/gpu/drm/pl111/pl111_drv.c | 6 +--
drivers/gpu/drm/qxl/qxl_debugfs.c | 47 ++++--------------------
drivers/gpu/drm/qxl/qxl_drv.c | 5 +--
drivers/gpu/drm/qxl/qxl_drv.h | 22 +----------
drivers/gpu/drm/tiny/arcpgu.c | 22 +++--------
drivers/gpu/drm/virtio/virtgpu_debugfs.c | 17 ++++-----
drivers/gpu/drm/virtio/virtgpu_drv.c | 5 +--
drivers/gpu/drm/virtio/virtgpu_drv.h | 2 +-
16 files changed, 74 insertions(+), 177 deletions(-)

--
2.38.1


2022-12-26 16:13:20

by Maíra Canal

[permalink] [raw]
Subject: [PATCH 7/9] drm/omap: use new debugfs device-centered functions

Replace the use of drm_debugfs_create_files() with the new
drm_debugfs_add_files() function, which center 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 omapdrm_init(),
before drm_dev_register().

Signed-off-by: Maíra Canal <[email protected]>
---
drivers/gpu/drm/omapdrm/omap_debugfs.c | 29 +++++++++-----------------
drivers/gpu/drm/omapdrm/omap_drv.c | 7 ++++---
drivers/gpu/drm/omapdrm/omap_drv.h | 2 +-
3 files changed, 15 insertions(+), 23 deletions(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_debugfs.c b/drivers/gpu/drm/omapdrm/omap_debugfs.c
index bfb2ccb40bd1..491aa74eb2ec 100644
--- a/drivers/gpu/drm/omapdrm/omap_debugfs.c
+++ b/drivers/gpu/drm/omapdrm/omap_debugfs.c
@@ -19,8 +19,8 @@

static int gem_show(struct seq_file *m, void *arg)
{
- struct drm_info_node *node = (struct drm_info_node *) m->private;
- struct drm_device *dev = node->minor->dev;
+ struct drm_debugfs_entry *entry = m->private;
+ struct drm_device *dev = entry->dev;
struct omap_drm_private *priv = dev->dev_private;

seq_printf(m, "All Objects:\n");
@@ -33,8 +33,8 @@ static int gem_show(struct seq_file *m, void *arg)

static int mm_show(struct seq_file *m, void *arg)
{
- struct drm_info_node *node = (struct drm_info_node *) m->private;
- struct drm_device *dev = node->minor->dev;
+ struct drm_debugfs_entry *entry = m->private;
+ struct drm_device *dev = entry->dev;
struct drm_printer p = drm_seq_file_printer(m);

drm_mm_print(&dev->vma_offset_manager->vm_addr_space_mm, &p);
@@ -45,8 +45,8 @@ static int mm_show(struct seq_file *m, void *arg)
#ifdef CONFIG_DRM_FBDEV_EMULATION
static int fb_show(struct seq_file *m, void *arg)
{
- struct drm_info_node *node = (struct drm_info_node *) m->private;
- struct drm_device *dev = node->minor->dev;
+ struct drm_debugfs_entry *entry = m->private;
+ struct drm_device *dev = entry->dev;
struct omap_drm_private *priv = dev->dev_private;
struct drm_framebuffer *fb;

@@ -68,7 +68,7 @@ static int fb_show(struct seq_file *m, void *arg)
#endif

/* list of debufs files that are applicable to all devices */
-static struct drm_info_list omap_debugfs_list[] = {
+static struct drm_debugfs_info omap_debugfs_list[] = {
{"gem", gem_show, 0},
{"mm", mm_show, 0},
#ifdef CONFIG_DRM_FBDEV_EMULATION
@@ -76,21 +76,12 @@ static struct drm_info_list omap_debugfs_list[] = {
#endif
};

-/* list of debugfs files that are specific to devices with dmm/tiler */
-static struct drm_info_list omap_dmm_debugfs_list[] = {
- {"tiler_map", tiler_map_show, 0},
-};
-
-void omap_debugfs_init(struct drm_minor *minor)
+void omap_debugfs_init(struct drm_device *drm)
{
- drm_debugfs_create_files(omap_debugfs_list,
- ARRAY_SIZE(omap_debugfs_list),
- minor->debugfs_root, minor);
+ drm_debugfs_add_files(drm, omap_debugfs_list, ARRAY_SIZE(omap_debugfs_list));

if (dmm_is_available())
- drm_debugfs_create_files(omap_dmm_debugfs_list,
- ARRAY_SIZE(omap_dmm_debugfs_list),
- minor->debugfs_root, minor);
+ drm_debugfs_add_file(drm, "tiler_map", tiler_map_show, NULL);
}

#endif
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index eaf67b9e5f12..06fc1bc0aa07 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -691,9 +691,6 @@ static const struct drm_driver omap_drm_driver = {
DRIVER_ATOMIC | DRIVER_RENDER,
.open = dev_open,
.lastclose = drm_fb_helper_lastclose,
-#ifdef CONFIG_DEBUG_FS
- .debugfs_init = omap_debugfs_init,
-#endif
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import = omap_gem_prime_import,
@@ -781,6 +778,10 @@ static int omapdrm_init(struct omap_drm_private *priv, struct device *dev)

omap_fbdev_init(ddev);

+#ifdef CONFIG_DEBUG_FS
+ omap_debugfs_init(ddev);
+#endif
+
drm_kms_helper_poll_init(ddev);
omap_modeset_enable_external_hpd(ddev);

diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h
index 825960fd3ea9..1e0d9e10cd6b 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.h
+++ b/drivers/gpu/drm/omapdrm/omap_drv.h
@@ -103,7 +103,7 @@ struct omap_drm_private {
};


-void omap_debugfs_init(struct drm_minor *minor);
+void omap_debugfs_init(struct drm_device *drm);

struct omap_global_state * __must_check omap_get_global_state(struct drm_atomic_state *s);

--
2.38.1

2022-12-26 16:16:02

by Maíra Canal

[permalink] [raw]
Subject: [PATCH 6/9] drm/virtio: use new debugfs device-centered functions

Replace the use of drm_debugfs_create_files() with the new
drm_debugfs_add_files() function, which center 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 virtio_gpu_probe(),
before drm_dev_register().

Signed-off-by: Maíra Canal <[email protected]>
---
drivers/gpu/drm/virtio/virtgpu_debugfs.c | 17 +++++++----------
drivers/gpu/drm/virtio/virtgpu_drv.c | 5 ++---
drivers/gpu/drm/virtio/virtgpu_drv.h | 2 +-
3 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_debugfs.c b/drivers/gpu/drm/virtio/virtgpu_debugfs.c
index 853dd9aa397e..91c81b7429cc 100644
--- a/drivers/gpu/drm/virtio/virtgpu_debugfs.c
+++ b/drivers/gpu/drm/virtio/virtgpu_debugfs.c
@@ -68,8 +68,8 @@ static int virtio_gpu_features(struct seq_file *m, void *data)
static int
virtio_gpu_debugfs_irq_info(struct seq_file *m, void *data)
{
- struct drm_info_node *node = (struct drm_info_node *) m->private;
- struct virtio_gpu_device *vgdev = node->minor->dev->dev_private;
+ struct drm_debugfs_entry *entry = m->private;
+ struct virtio_gpu_device *vgdev = entry->dev->dev_private;

seq_printf(m, "fence %llu %lld\n",
(u64)atomic64_read(&vgdev->fence_drv.last_fence_id),
@@ -80,8 +80,8 @@ virtio_gpu_debugfs_irq_info(struct seq_file *m, void *data)
static int
virtio_gpu_debugfs_host_visible_mm(struct seq_file *m, void *data)
{
- struct drm_info_node *node = (struct drm_info_node *)m->private;
- struct virtio_gpu_device *vgdev = node->minor->dev->dev_private;
+ struct drm_debugfs_entry *entry = m->private;
+ struct virtio_gpu_device *vgdev = entry->dev->dev_private;
struct drm_printer p;

if (!vgdev->has_host_visible) {
@@ -94,7 +94,7 @@ virtio_gpu_debugfs_host_visible_mm(struct seq_file *m, void *data)
return 0;
}

-static struct drm_info_list virtio_gpu_debugfs_list[] = {
+static struct drm_debugfs_info virtio_gpu_debugfs_list[] = {
{ "virtio-gpu-features", virtio_gpu_features },
{ "virtio-gpu-irq-fence", virtio_gpu_debugfs_irq_info, 0, NULL },
{ "virtio-gpu-host-visible-mm", virtio_gpu_debugfs_host_visible_mm },
@@ -102,10 +102,7 @@ static struct drm_info_list virtio_gpu_debugfs_list[] = {

#define VIRTIO_GPU_DEBUGFS_ENTRIES ARRAY_SIZE(virtio_gpu_debugfs_list)

-void
-virtio_gpu_debugfs_init(struct drm_minor *minor)
+void virtio_gpu_debugfs_init(struct drm_device *drm)
{
- drm_debugfs_create_files(virtio_gpu_debugfs_list,
- VIRTIO_GPU_DEBUGFS_ENTRIES,
- minor->debugfs_root, minor);
+ drm_debugfs_add_files(drm, virtio_gpu_debugfs_list, VIRTIO_GPU_DEBUGFS_ENTRIES);
}
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.c b/drivers/gpu/drm/virtio/virtgpu_drv.c
index ae97b98750b6..83aa77e5893b 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.c
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.c
@@ -98,6 +98,8 @@ static int virtio_gpu_probe(struct virtio_device *vdev)
if (ret)
goto err_free;

+ virtio_gpu_debugfs_init(dev);
+
ret = drm_dev_register(dev, 0);
if (ret)
goto err_deinit;
@@ -179,9 +181,6 @@ static const struct drm_driver driver = {
.dumb_create = virtio_gpu_mode_dumb_create,
.dumb_map_offset = virtio_gpu_mode_dumb_mmap,

-#if defined(CONFIG_DEBUG_FS)
- .debugfs_init = virtio_gpu_debugfs_init,
-#endif
.prime_handle_to_fd = drm_gem_prime_handle_to_fd,
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_mmap = drm_gem_prime_mmap,
diff --git a/drivers/gpu/drm/virtio/virtgpu_drv.h b/drivers/gpu/drm/virtio/virtgpu_drv.h
index b7a64c7dcc2c..663d405ccacd 100644
--- a/drivers/gpu/drm/virtio/virtgpu_drv.h
+++ b/drivers/gpu/drm/virtio/virtgpu_drv.h
@@ -469,7 +469,7 @@ struct drm_gem_object *virtgpu_gem_prime_import_sg_table(
struct sg_table *sgt);

/* virtgpu_debugfs.c */
-void virtio_gpu_debugfs_init(struct drm_minor *minor);
+void virtio_gpu_debugfs_init(struct drm_device *drm);

/* virtgpu_vram.c */
bool virtio_gpu_is_vram(struct virtio_gpu_object *bo);
--
2.38.1

2022-12-26 16:28:56

by Maíra Canal

[permalink] [raw]
Subject: [PATCH 4/9] drm/pl111: use new debugfs device-centered functions

Replace the use of drm_debugfs_create_files() with the new
drm_debugfs_add_file() function, which center 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 pl111_amba_probe(),
before drm_dev_register().

Signed-off-by: Maíra Canal <[email protected]>
---
drivers/gpu/drm/pl111/pl111_debugfs.c | 15 ++++-----------
drivers/gpu/drm/pl111/pl111_drm.h | 2 +-
drivers/gpu/drm/pl111/pl111_drv.c | 6 ++----
3 files changed, 7 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/pl111/pl111_debugfs.c b/drivers/gpu/drm/pl111/pl111_debugfs.c
index 6744fa16f464..458f69e5435e 100644
--- a/drivers/gpu/drm/pl111/pl111_debugfs.c
+++ b/drivers/gpu/drm/pl111/pl111_debugfs.c
@@ -32,8 +32,8 @@ static const struct {

static int pl111_debugfs_regs(struct seq_file *m, void *unused)
{
- struct drm_info_node *node = (struct drm_info_node *)m->private;
- struct drm_device *dev = node->minor->dev;
+ struct drm_debugfs_entry *entry = m->private;
+ struct drm_device *dev = entry->dev;
struct pl111_drm_dev_private *priv = dev->dev_private;
int i;

@@ -46,14 +46,7 @@ static int pl111_debugfs_regs(struct seq_file *m, void *unused)
return 0;
}

-static const struct drm_info_list pl111_debugfs_list[] = {
- {"regs", pl111_debugfs_regs, 0},
-};
-
-void
-pl111_debugfs_init(struct drm_minor *minor)
+void pl111_debugfs_init(struct drm_device *drm)
{
- drm_debugfs_create_files(pl111_debugfs_list,
- ARRAY_SIZE(pl111_debugfs_list),
- minor->debugfs_root, minor);
+ drm_debugfs_add_file(drm, "regs", pl111_debugfs_regs, NULL);
}
diff --git a/drivers/gpu/drm/pl111/pl111_drm.h b/drivers/gpu/drm/pl111/pl111_drm.h
index 2a46b5bd8576..7fe74be917f1 100644
--- a/drivers/gpu/drm/pl111/pl111_drm.h
+++ b/drivers/gpu/drm/pl111/pl111_drm.h
@@ -157,6 +157,6 @@ struct pl111_drm_dev_private {

int pl111_display_init(struct drm_device *dev);
irqreturn_t pl111_irq(int irq, void *data);
-void pl111_debugfs_init(struct drm_minor *minor);
+void pl111_debugfs_init(struct drm_device *drm);

#endif /* _PL111_DRM_H_ */
diff --git a/drivers/gpu/drm/pl111/pl111_drv.c b/drivers/gpu/drm/pl111/pl111_drv.c
index 00deba0b7271..c031eb4abc0d 100644
--- a/drivers/gpu/drm/pl111/pl111_drv.c
+++ b/drivers/gpu/drm/pl111/pl111_drv.c
@@ -228,10 +228,6 @@ static const struct drm_driver pl111_drm_driver = {
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import_sg_table = pl111_gem_import_sg_table,
.gem_prime_mmap = drm_gem_prime_mmap,
-
-#if defined(CONFIG_DEBUG_FS)
- .debugfs_init = pl111_debugfs_init,
-#endif
};

static int pl111_amba_probe(struct amba_device *amba_dev,
@@ -304,6 +300,8 @@ static int pl111_amba_probe(struct amba_device *amba_dev,
if (ret != 0)
goto dev_put;

+ pl111_debugfs_init(drm);
+
ret = drm_dev_register(drm, 0);
if (ret < 0)
goto dev_put;
--
2.38.1

2022-12-26 16:29:11

by Maíra Canal

[permalink] [raw]
Subject: [PATCH 1/9] drm/etnaviv: use new debugfs device-centered functions

Replace the use of drm_debugfs_create_files() with the new
drm_debugfs_add_files() function, which center 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 etnaviv_bind(),
before drm_dev_register().

Signed-off-by: Maíra Canal <[email protected]>
---
drivers/gpu/drm/etnaviv/etnaviv_drv.c | 29 +++++++++++----------------
1 file changed, 12 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
index 1d2b4fb4bcf8..2b265460672e 100644
--- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c
+++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c
@@ -191,22 +191,22 @@ static int etnaviv_ring_show(struct etnaviv_gpu *gpu, struct seq_file *m)

static int show_unlocked(struct seq_file *m, void *arg)
{
- struct drm_info_node *node = (struct drm_info_node *) m->private;
- struct drm_device *dev = node->minor->dev;
+ struct drm_debugfs_entry *entry = m->private;
+ struct drm_device *dev = entry->dev;
int (*show)(struct drm_device *dev, struct seq_file *m) =
- node->info_ent->data;
+ entry->file.data;

return show(dev, m);
}

static int show_each_gpu(struct seq_file *m, void *arg)
{
- struct drm_info_node *node = (struct drm_info_node *) m->private;
- struct drm_device *dev = node->minor->dev;
+ struct drm_debugfs_entry *entry = m->private;
+ struct drm_device *dev = entry->dev;
struct etnaviv_drm_private *priv = dev->dev_private;
struct etnaviv_gpu *gpu;
int (*show)(struct etnaviv_gpu *gpu, struct seq_file *m) =
- node->info_ent->data;
+ entry->file.data;
unsigned int i;
int ret = 0;

@@ -223,20 +223,13 @@ static int show_each_gpu(struct seq_file *m, void *arg)
return ret;
}

-static struct drm_info_list etnaviv_debugfs_list[] = {
+static struct drm_debugfs_info etnaviv_debugfs_list[] = {
{"gpu", show_each_gpu, 0, etnaviv_gpu_debugfs},
{"gem", show_unlocked, 0, etnaviv_gem_show},
{ "mm", show_unlocked, 0, etnaviv_mm_show },
{"mmu", show_each_gpu, 0, etnaviv_mmu_show},
{"ring", show_each_gpu, 0, etnaviv_ring_show},
};
-
-static void etnaviv_debugfs_init(struct drm_minor *minor)
-{
- drm_debugfs_create_files(etnaviv_debugfs_list,
- ARRAY_SIZE(etnaviv_debugfs_list),
- minor->debugfs_root, minor);
-}
#endif

/*
@@ -478,9 +471,6 @@ static const struct drm_driver etnaviv_drm_driver = {
.prime_fd_to_handle = drm_gem_prime_fd_to_handle,
.gem_prime_import_sg_table = etnaviv_gem_prime_import_sg_table,
.gem_prime_mmap = drm_gem_prime_mmap,
-#ifdef CONFIG_DEBUG_FS
- .debugfs_init = etnaviv_debugfs_init,
-#endif
.ioctls = etnaviv_ioctls,
.num_ioctls = DRM_ETNAVIV_NUM_IOCTLS,
.fops = &fops,
@@ -534,6 +524,11 @@ static int etnaviv_bind(struct device *dev)

load_gpu(drm);

+#ifdef CONFIG_DEBUG_FS
+ drm_debugfs_add_files(drm, etnaviv_debugfs_list,
+ ARRAY_SIZE(etnaviv_debugfs_list));
+#endif
+
ret = drm_dev_register(drm, 0);
if (ret)
goto out_unbind;
--
2.38.1

2022-12-26 16:31:06

by Maíra Canal

[permalink] [raw]
Subject: [PATCH 3/9] drm/arm/hdlcd: use new debugfs device-centered functions

Replace the use of drm_debugfs_create_files() with the new
drm_debugfs_add_files() function, which center 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 hdlcd_drm_bind(),
before drm_dev_register().

Signed-off-by: Maíra Canal <[email protected]>
---
drivers/gpu/drm/arm/hdlcd_drv.c | 24 +++++++++---------------
1 file changed, 9 insertions(+), 15 deletions(-)

diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
index 7043d1c9ed8f..e3507dd6f82a 100644
--- a/drivers/gpu/drm/arm/hdlcd_drv.c
+++ b/drivers/gpu/drm/arm/hdlcd_drv.c
@@ -195,8 +195,8 @@ static int hdlcd_setup_mode_config(struct drm_device *drm)
#ifdef CONFIG_DEBUG_FS
static int hdlcd_show_underrun_count(struct seq_file *m, void *arg)
{
- struct drm_info_node *node = (struct drm_info_node *)m->private;
- struct drm_device *drm = node->minor->dev;
+ struct drm_debugfs_entry *entry = m->private;
+ struct drm_device *drm = entry->dev;
struct hdlcd_drm_private *hdlcd = drm_to_hdlcd_priv(drm);

seq_printf(m, "underrun : %d\n", atomic_read(&hdlcd->buffer_underrun_count));
@@ -208,8 +208,8 @@ static int hdlcd_show_underrun_count(struct seq_file *m, void *arg)

static int hdlcd_show_pxlclock(struct seq_file *m, void *arg)
{
- struct drm_info_node *node = (struct drm_info_node *)m->private;
- struct drm_device *drm = node->minor->dev;
+ struct drm_debugfs_entry *entry = m->private;
+ struct drm_device *drm = entry->dev;
struct hdlcd_drm_private *hdlcd = drm_to_hdlcd_priv(drm);
unsigned long clkrate = clk_get_rate(hdlcd->clk);
unsigned long mode_clock = hdlcd->crtc.mode.crtc_clock * 1000;
@@ -219,17 +219,10 @@ static int hdlcd_show_pxlclock(struct seq_file *m, void *arg)
return 0;
}

-static struct drm_info_list hdlcd_debugfs_list[] = {
+static struct drm_debugfs_info hdlcd_debugfs_list[] = {
{ "interrupt_count", hdlcd_show_underrun_count, 0 },
{ "clocks", hdlcd_show_pxlclock, 0 },
};
-
-static void hdlcd_debugfs_init(struct drm_minor *minor)
-{
- drm_debugfs_create_files(hdlcd_debugfs_list,
- ARRAY_SIZE(hdlcd_debugfs_list),
- minor->debugfs_root, minor);
-}
#endif

DEFINE_DRM_GEM_DMA_FOPS(fops);
@@ -237,9 +230,6 @@ DEFINE_DRM_GEM_DMA_FOPS(fops);
static const struct drm_driver hdlcd_driver = {
.driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
DRM_GEM_DMA_DRIVER_OPS,
-#ifdef CONFIG_DEBUG_FS
- .debugfs_init = hdlcd_debugfs_init,
-#endif
.fops = &fops,
.name = "hdlcd",
.desc = "ARM HDLCD Controller DRM",
@@ -303,6 +293,10 @@ static int hdlcd_drm_bind(struct device *dev)
drm_mode_config_reset(drm);
drm_kms_helper_poll_init(drm);

+#ifdef CONFIG_DEBUG_FS
+ drm_debugfs_add_files(drm, hdlcd_debugfs_list, ARRAY_SIZE(hdlcd_debugfs_list));
+#endif
+
ret = drm_dev_register(drm, 0);
if (ret)
goto err_register;
--
2.38.1

2022-12-26 16:34:12

by Maíra Canal

[permalink] [raw]
Subject: [PATCH 2/9] drm/gud: use new debugfs device-centered functions

Replace the use of drm_debugfs_create_files() with the new
drm_debugfs_add_file() function, which center 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 gud_probe(),
before drm_dev_register().

Signed-off-by: Maíra Canal <[email protected]>
---
drivers/gpu/drm/gud/gud_drv.c | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/gud/gud_drv.c b/drivers/gpu/drm/gud/gud_drv.c
index 5aac7cda0505..9d7bf8ee45f1 100644
--- a/drivers/gpu/drm/gud/gud_drv.c
+++ b/drivers/gpu/drm/gud/gud_drv.c
@@ -325,8 +325,8 @@ static struct drm_gem_object *gud_gem_prime_import(struct drm_device *drm, struc

static int gud_stats_debugfs(struct seq_file *m, void *data)
{
- struct drm_info_node *node = m->private;
- struct gud_device *gdrm = to_gud_device(node->minor->dev);
+ struct drm_debugfs_entry *entry = m->private;
+ struct gud_device *gdrm = to_gud_device(entry->dev);
char buf[10];

string_get_size(gdrm->bulk_len, 1, STRING_UNITS_2, buf, sizeof(buf));
@@ -352,16 +352,6 @@ static int gud_stats_debugfs(struct seq_file *m, void *data)
return 0;
}

-static const struct drm_info_list gud_debugfs_list[] = {
- { "stats", gud_stats_debugfs, 0, NULL },
-};
-
-static void gud_debugfs_init(struct drm_minor *minor)
-{
- drm_debugfs_create_files(gud_debugfs_list, ARRAY_SIZE(gud_debugfs_list),
- minor->debugfs_root, minor);
-}
-
static const struct drm_simple_display_pipe_funcs gud_pipe_funcs = {
.check = gud_pipe_check,
.update = gud_pipe_update,
@@ -386,7 +376,6 @@ static const struct drm_driver gud_drm_driver = {
.fops = &gud_fops,
DRM_GEM_SHMEM_DRIVER_OPS,
.gem_prime_import = gud_gem_prime_import,
- .debugfs_init = gud_debugfs_init,

.name = "gud",
.desc = "Generic USB Display",
@@ -623,6 +612,8 @@ static int gud_probe(struct usb_interface *intf, const struct usb_device_id *id)
if (!gdrm->dmadev)
dev_warn(dev, "buffer sharing not supported");

+ drm_debugfs_add_file(drm, "stats", gud_stats_debugfs, NULL);
+
ret = drm_dev_register(drm, 0);
if (ret) {
put_device(gdrm->dmadev);
--
2.38.1

2022-12-26 16:34:12

by Maíra Canal

[permalink] [raw]
Subject: [PATCH 5/9] drm/arc: use new debugfs device-centered functions

Replace the use of drm_debugfs_create_files() with the new
drm_debugfs_add_file() function, which center 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 arcpgu_probe(),
before drm_dev_register().

Signed-off-by: Maíra Canal <[email protected]>
---
drivers/gpu/drm/tiny/arcpgu.c | 22 ++++++----------------
1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c
index 611bbee15071..b074a0b4c7b3 100644
--- a/drivers/gpu/drm/tiny/arcpgu.c
+++ b/drivers/gpu/drm/tiny/arcpgu.c
@@ -338,8 +338,8 @@ static int arcpgu_unload(struct drm_device *drm)
#ifdef CONFIG_DEBUG_FS
static int arcpgu_show_pxlclock(struct seq_file *m, void *arg)
{
- struct drm_info_node *node = (struct drm_info_node *)m->private;
- struct drm_device *drm = node->minor->dev;
+ struct drm_debugfs_entry *entry = m->private;
+ struct drm_device *drm = entry->dev;
struct arcpgu_drm_private *arcpgu = dev_to_arcpgu(drm);
unsigned long clkrate = clk_get_rate(arcpgu->clk);
unsigned long mode_clock = arcpgu->pipe.crtc.mode.crtc_clock * 1000;
@@ -348,17 +348,6 @@ static int arcpgu_show_pxlclock(struct seq_file *m, void *arg)
seq_printf(m, "mode: %lu\n", mode_clock);
return 0;
}
-
-static struct drm_info_list arcpgu_debugfs_list[] = {
- { "clocks", arcpgu_show_pxlclock, 0 },
-};
-
-static void arcpgu_debugfs_init(struct drm_minor *minor)
-{
- drm_debugfs_create_files(arcpgu_debugfs_list,
- ARRAY_SIZE(arcpgu_debugfs_list),
- minor->debugfs_root, minor);
-}
#endif

static const struct drm_driver arcpgu_drm_driver = {
@@ -371,9 +360,6 @@ static const struct drm_driver arcpgu_drm_driver = {
.patchlevel = 0,
.fops = &arcpgu_drm_ops,
DRM_GEM_DMA_DRIVER_OPS,
-#ifdef CONFIG_DEBUG_FS
- .debugfs_init = arcpgu_debugfs_init,
-#endif
};

static int arcpgu_probe(struct platform_device *pdev)
@@ -390,6 +376,10 @@ static int arcpgu_probe(struct platform_device *pdev)
if (ret)
return ret;

+#ifdef CONFIG_DEBUG_FS
+ drm_debugfs_add_file(&arcpgu->drm, "clocks", arcpgu_show_pxlclock, NULL);
+#endif
+
ret = drm_dev_register(&arcpgu->drm, 0);
if (ret)
goto err_unload;
--
2.38.1

2023-01-03 13:53:17

by Liviu Dudau

[permalink] [raw]
Subject: Re: [PATCH 3/9] drm/arm/hdlcd: use new debugfs device-centered functions

On Mon, Dec 26, 2022 at 12:50:23PM -0300, Maíra Canal wrote:
> Replace the use of drm_debugfs_create_files() with the new
> drm_debugfs_add_files() function, which center 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 hdlcd_drm_bind(),
> before drm_dev_register().
>
> Signed-off-by: Maíra Canal <[email protected]>

Acked-by: Liviu Dudau <[email protected]>

Best regards,
Liviu

> ---
> drivers/gpu/drm/arm/hdlcd_drv.c | 24 +++++++++---------------
> 1 file changed, 9 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
> index 7043d1c9ed8f..e3507dd6f82a 100644
> --- a/drivers/gpu/drm/arm/hdlcd_drv.c
> +++ b/drivers/gpu/drm/arm/hdlcd_drv.c
> @@ -195,8 +195,8 @@ static int hdlcd_setup_mode_config(struct drm_device *drm)
> #ifdef CONFIG_DEBUG_FS
> static int hdlcd_show_underrun_count(struct seq_file *m, void *arg)
> {
> - struct drm_info_node *node = (struct drm_info_node *)m->private;
> - struct drm_device *drm = node->minor->dev;
> + struct drm_debugfs_entry *entry = m->private;
> + struct drm_device *drm = entry->dev;
> struct hdlcd_drm_private *hdlcd = drm_to_hdlcd_priv(drm);
>
> seq_printf(m, "underrun : %d\n", atomic_read(&hdlcd->buffer_underrun_count));
> @@ -208,8 +208,8 @@ static int hdlcd_show_underrun_count(struct seq_file *m, void *arg)
>
> static int hdlcd_show_pxlclock(struct seq_file *m, void *arg)
> {
> - struct drm_info_node *node = (struct drm_info_node *)m->private;
> - struct drm_device *drm = node->minor->dev;
> + struct drm_debugfs_entry *entry = m->private;
> + struct drm_device *drm = entry->dev;
> struct hdlcd_drm_private *hdlcd = drm_to_hdlcd_priv(drm);
> unsigned long clkrate = clk_get_rate(hdlcd->clk);
> unsigned long mode_clock = hdlcd->crtc.mode.crtc_clock * 1000;
> @@ -219,17 +219,10 @@ static int hdlcd_show_pxlclock(struct seq_file *m, void *arg)
> return 0;
> }
>
> -static struct drm_info_list hdlcd_debugfs_list[] = {
> +static struct drm_debugfs_info hdlcd_debugfs_list[] = {
> { "interrupt_count", hdlcd_show_underrun_count, 0 },
> { "clocks", hdlcd_show_pxlclock, 0 },
> };
> -
> -static void hdlcd_debugfs_init(struct drm_minor *minor)
> -{
> - drm_debugfs_create_files(hdlcd_debugfs_list,
> - ARRAY_SIZE(hdlcd_debugfs_list),
> - minor->debugfs_root, minor);
> -}
> #endif
>
> DEFINE_DRM_GEM_DMA_FOPS(fops);
> @@ -237,9 +230,6 @@ DEFINE_DRM_GEM_DMA_FOPS(fops);
> static const struct drm_driver hdlcd_driver = {
> .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
> DRM_GEM_DMA_DRIVER_OPS,
> -#ifdef CONFIG_DEBUG_FS
> - .debugfs_init = hdlcd_debugfs_init,
> -#endif
> .fops = &fops,
> .name = "hdlcd",
> .desc = "ARM HDLCD Controller DRM",
> @@ -303,6 +293,10 @@ static int hdlcd_drm_bind(struct device *dev)
> drm_mode_config_reset(drm);
> drm_kms_helper_poll_init(drm);
>
> +#ifdef CONFIG_DEBUG_FS
> + drm_debugfs_add_files(drm, hdlcd_debugfs_list, ARRAY_SIZE(hdlcd_debugfs_list));
> +#endif
> +
> ret = drm_dev_register(drm, 0);
> if (ret)
> goto err_register;
> --
> 2.38.1
>

--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯

2023-01-04 13:44:55

by Noralf Trønnes

[permalink] [raw]
Subject: Re: [PATCH 2/9] drm/gud: use new debugfs device-centered functions



On 12/26/22 16:50, Maíra Canal wrote:
> Replace the use of drm_debugfs_create_files() with the new
> drm_debugfs_add_file() function, which center 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 gud_probe(),
> before drm_dev_register().
>
> Signed-off-by: Maíra Canal <[email protected]>
> ---

Acked-by: Noralf Trønnes <[email protected]>

2023-01-05 14:12:22

by kernel test robot

[permalink] [raw]
Subject: Re: [PATCH 4/9] drm/pl111: use new debugfs device-centered functions

Hi Ma?ra,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on drm-misc/drm-misc-next]
[also build test ERROR on drm-intel/for-linux-next drm-intel/for-linux-next-fixes drm-tip/drm-tip linus/master v6.2-rc2 next-20230105]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Ma-ra-Canal/drm-etnaviv-use-new-debugfs-device-centered-functions/20221226-235457
base: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
patch link: https://lore.kernel.org/r/20221226155029.244355-5-mcanal%40igalia.com
patch subject: [PATCH 4/9] drm/pl111: use new debugfs device-centered functions
config: arm-buildonly-randconfig-r004-20230101
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 8d9828ef5aa9688500657d36cd2aefbe12bbd162)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/intel-lab-lkp/linux/commit/9df6e851a016b03f144896a5a05b461402f3770b
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Ma-ra-Canal/drm-etnaviv-use-new-debugfs-device-centered-functions/20221226-235457
git checkout 9df6e851a016b03f144896a5a05b461402f3770b
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>

All errors (new ones prefixed by >>):

>> ld.lld: error: undefined symbol: pl111_debugfs_init
>>> referenced by pl111_drv.c
>>> drivers/gpu/drm/pl111/pl111_drv.o:(pl111_amba_probe) in archive vmlinux.a

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests


Attachments:
(No filename) (2.32 kB)
config (167.05 kB)
Download all attachments

2023-01-06 20:08:08

by Maíra Canal

[permalink] [raw]
Subject: Re: [PATCH 3/9] drm/arm/hdlcd: use new debugfs device-centered functions

On 12/26/22 12:50, Maíra Canal wrote:
> Replace the use of drm_debugfs_create_files() with the new
> drm_debugfs_add_files() function, which center 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 hdlcd_drm_bind(),
> before drm_dev_register().
>
> Signed-off-by: Maíra Canal <[email protected]>

Applied to drm/drm-misc (drm-misc-next).

Best Regards,
- Maíra Canal

> ---
> drivers/gpu/drm/arm/hdlcd_drv.c | 24 +++++++++---------------
> 1 file changed, 9 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c
> index 7043d1c9ed8f..e3507dd6f82a 100644
> --- a/drivers/gpu/drm/arm/hdlcd_drv.c
> +++ b/drivers/gpu/drm/arm/hdlcd_drv.c
> @@ -195,8 +195,8 @@ static int hdlcd_setup_mode_config(struct drm_device *drm)
> #ifdef CONFIG_DEBUG_FS
> static int hdlcd_show_underrun_count(struct seq_file *m, void *arg)
> {
> - struct drm_info_node *node = (struct drm_info_node *)m->private;
> - struct drm_device *drm = node->minor->dev;
> + struct drm_debugfs_entry *entry = m->private;
> + struct drm_device *drm = entry->dev;
> struct hdlcd_drm_private *hdlcd = drm_to_hdlcd_priv(drm);
>
> seq_printf(m, "underrun : %d\n", atomic_read(&hdlcd->buffer_underrun_count));
> @@ -208,8 +208,8 @@ static int hdlcd_show_underrun_count(struct seq_file *m, void *arg)
>
> static int hdlcd_show_pxlclock(struct seq_file *m, void *arg)
> {
> - struct drm_info_node *node = (struct drm_info_node *)m->private;
> - struct drm_device *drm = node->minor->dev;
> + struct drm_debugfs_entry *entry = m->private;
> + struct drm_device *drm = entry->dev;
> struct hdlcd_drm_private *hdlcd = drm_to_hdlcd_priv(drm);
> unsigned long clkrate = clk_get_rate(hdlcd->clk);
> unsigned long mode_clock = hdlcd->crtc.mode.crtc_clock * 1000;
> @@ -219,17 +219,10 @@ static int hdlcd_show_pxlclock(struct seq_file *m, void *arg)
> return 0;
> }
>
> -static struct drm_info_list hdlcd_debugfs_list[] = {
> +static struct drm_debugfs_info hdlcd_debugfs_list[] = {
> { "interrupt_count", hdlcd_show_underrun_count, 0 },
> { "clocks", hdlcd_show_pxlclock, 0 },
> };
> -
> -static void hdlcd_debugfs_init(struct drm_minor *minor)
> -{
> - drm_debugfs_create_files(hdlcd_debugfs_list,
> - ARRAY_SIZE(hdlcd_debugfs_list),
> - minor->debugfs_root, minor);
> -}
> #endif
>
> DEFINE_DRM_GEM_DMA_FOPS(fops);
> @@ -237,9 +230,6 @@ DEFINE_DRM_GEM_DMA_FOPS(fops);
> static const struct drm_driver hdlcd_driver = {
> .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
> DRM_GEM_DMA_DRIVER_OPS,
> -#ifdef CONFIG_DEBUG_FS
> - .debugfs_init = hdlcd_debugfs_init,
> -#endif
> .fops = &fops,
> .name = "hdlcd",
> .desc = "ARM HDLCD Controller DRM",
> @@ -303,6 +293,10 @@ static int hdlcd_drm_bind(struct device *dev)
> drm_mode_config_reset(drm);
> drm_kms_helper_poll_init(drm);
>
> +#ifdef CONFIG_DEBUG_FS
> + drm_debugfs_add_files(drm, hdlcd_debugfs_list, ARRAY_SIZE(hdlcd_debugfs_list));
> +#endif
> +
> ret = drm_dev_register(drm, 0);
> if (ret)
> goto err_register;

2023-01-06 20:12:03

by Maíra Canal

[permalink] [raw]
Subject: Re: [PATCH 2/9] drm/gud: use new debugfs device-centered functions

On 12/26/22 12:50, Maíra Canal wrote:
> Replace the use of drm_debugfs_create_files() with the new
> drm_debugfs_add_file() function, which center 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 gud_probe(),
> before drm_dev_register().
>
> Signed-off-by: Maíra Canal <[email protected]>

Applied to drm/drm-misc (drm-misc-next).

Best Regards,
- Maíra Canal

> ---
> drivers/gpu/drm/gud/gud_drv.c | 17 ++++-------------
> 1 file changed, 4 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/gud/gud_drv.c b/drivers/gpu/drm/gud/gud_drv.c
> index 5aac7cda0505..9d7bf8ee45f1 100644
> --- a/drivers/gpu/drm/gud/gud_drv.c
> +++ b/drivers/gpu/drm/gud/gud_drv.c
> @@ -325,8 +325,8 @@ static struct drm_gem_object *gud_gem_prime_import(struct drm_device *drm, struc
>
> static int gud_stats_debugfs(struct seq_file *m, void *data)
> {
> - struct drm_info_node *node = m->private;
> - struct gud_device *gdrm = to_gud_device(node->minor->dev);
> + struct drm_debugfs_entry *entry = m->private;
> + struct gud_device *gdrm = to_gud_device(entry->dev);
> char buf[10];
>
> string_get_size(gdrm->bulk_len, 1, STRING_UNITS_2, buf, sizeof(buf));
> @@ -352,16 +352,6 @@ static int gud_stats_debugfs(struct seq_file *m, void *data)
> return 0;
> }
>
> -static const struct drm_info_list gud_debugfs_list[] = {
> - { "stats", gud_stats_debugfs, 0, NULL },
> -};
> -
> -static void gud_debugfs_init(struct drm_minor *minor)
> -{
> - drm_debugfs_create_files(gud_debugfs_list, ARRAY_SIZE(gud_debugfs_list),
> - minor->debugfs_root, minor);
> -}
> -
> static const struct drm_simple_display_pipe_funcs gud_pipe_funcs = {
> .check = gud_pipe_check,
> .update = gud_pipe_update,
> @@ -386,7 +376,6 @@ static const struct drm_driver gud_drm_driver = {
> .fops = &gud_fops,
> DRM_GEM_SHMEM_DRIVER_OPS,
> .gem_prime_import = gud_gem_prime_import,
> - .debugfs_init = gud_debugfs_init,
>
> .name = "gud",
> .desc = "Generic USB Display",
> @@ -623,6 +612,8 @@ static int gud_probe(struct usb_interface *intf, const struct usb_device_id *id)
> if (!gdrm->dmadev)
> dev_warn(dev, "buffer sharing not supported");
>
> + drm_debugfs_add_file(drm, "stats", gud_stats_debugfs, NULL);
> +
> ret = drm_dev_register(drm, 0);
> if (ret) {
> put_device(gdrm->dmadev);

2023-01-06 20:19:31

by Daniel Vetter

[permalink] [raw]
Subject: Re: [PATCH 5/9] drm/arc: use new debugfs device-centered functions

On Mon, Dec 26, 2022 at 12:50:25PM -0300, Ma?ra Canal wrote:
> Replace the use of drm_debugfs_create_files() with the new
> drm_debugfs_add_file() function, which center 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 arcpgu_probe(),
> before drm_dev_register().
>
> Signed-off-by: Ma?ra Canal <[email protected]>
> ---
> drivers/gpu/drm/tiny/arcpgu.c | 22 ++++++----------------
> 1 file changed, 6 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/tiny/arcpgu.c b/drivers/gpu/drm/tiny/arcpgu.c
> index 611bbee15071..b074a0b4c7b3 100644
> --- a/drivers/gpu/drm/tiny/arcpgu.c
> +++ b/drivers/gpu/drm/tiny/arcpgu.c
> @@ -338,8 +338,8 @@ static int arcpgu_unload(struct drm_device *drm)
> #ifdef CONFIG_DEBUG_FS
> static int arcpgu_show_pxlclock(struct seq_file *m, void *arg)
> {
> - struct drm_info_node *node = (struct drm_info_node *)m->private;
> - struct drm_device *drm = node->minor->dev;
> + struct drm_debugfs_entry *entry = m->private;
> + struct drm_device *drm = entry->dev;
> struct arcpgu_drm_private *arcpgu = dev_to_arcpgu(drm);
> unsigned long clkrate = clk_get_rate(arcpgu->clk);
> unsigned long mode_clock = arcpgu->pipe.crtc.mode.crtc_clock * 1000;
> @@ -348,17 +348,6 @@ static int arcpgu_show_pxlclock(struct seq_file *m, void *arg)
> seq_printf(m, "mode: %lu\n", mode_clock);
> return 0;
> }
> -
> -static struct drm_info_list arcpgu_debugfs_list[] = {
> - { "clocks", arcpgu_show_pxlclock, 0 },
> -};
> -
> -static void arcpgu_debugfs_init(struct drm_minor *minor)
> -{
> - drm_debugfs_create_files(arcpgu_debugfs_list,
> - ARRAY_SIZE(arcpgu_debugfs_list),
> - minor->debugfs_root, minor);
> -}
> #endif
>
> static const struct drm_driver arcpgu_drm_driver = {
> @@ -371,9 +360,6 @@ static const struct drm_driver arcpgu_drm_driver = {
> .patchlevel = 0,
> .fops = &arcpgu_drm_ops,
> DRM_GEM_DMA_DRIVER_OPS,
> -#ifdef CONFIG_DEBUG_FS
> - .debugfs_init = arcpgu_debugfs_init,
> -#endif
> };
>
> static int arcpgu_probe(struct platform_device *pdev)
> @@ -390,6 +376,10 @@ static int arcpgu_probe(struct platform_device *pdev)
> if (ret)
> return ret;
>
> +#ifdef CONFIG_DEBUG_FS
> + drm_debugfs_add_file(&arcpgu->drm, "clocks", arcpgu_show_pxlclock, NULL);
> +#endif

A pure bikeshed, but I think it's cleaner to drop the #ifdef here and
above and mark the potentially unused functions as __maybe_unused.

With or without that: Reviewed-by: Daniel Vetter <[email protected]>

> +
> ret = drm_dev_register(&arcpgu->drm, 0);
> if (ret)
> goto err_unload;
> --
> 2.38.1
>

--
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch