diff options
author | Eric Anholt <eric@anholt.net> | 2019-04-01 11:35:58 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2019-04-03 12:49:13 -0700 |
commit | c9be804c8c7a2d3fcd8e236407c8623be0356a01 (patch) | |
tree | d320accd6c36f18105895804caf5d1850e2dca46 /drivers/gpu/drm/vc4/vc4_bo.c | |
parent | fc13d7100299d4a10fd77bfd87954b33312f796f (diff) | |
download | lwn-c9be804c8c7a2d3fcd8e236407c8623be0356a01.tar.gz lwn-c9be804c8c7a2d3fcd8e236407c8623be0356a01.zip |
drm/vc4: Use common helpers for debugfs setup by the driver components.
The global list of all debugfs entries for the driver was painful: the
list couldn't see into the components' structs, so each component had
its own debugs show function to find the component, then find the
regset and dump it. The components also had to be careful to check
that they were actually registered in vc4 before dereferencing
themselves, in case they weren't probed on a particular platform.
They routinely failed at that.
Instead, we can have the components add their debugfs callbacks to a
little list in vc4 to be registered at drm_dev_register() time, which
gets vc4_debugfs.c out of the business of knowing the whole list of
components.
Thanks to this change, dsi0 (if it existed) would register its node.
v2: Rebase on hvs_underrun addition.
v3: whitespace fixup
Signed-off-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20190401183559.3823-1-eric@anholt.net
Reviewed-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Diffstat (limited to 'drivers/gpu/drm/vc4/vc4_bo.c')
-rw-r--r-- | drivers/gpu/drm/vc4/vc4_bo.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_bo.c b/drivers/gpu/drm/vc4/vc4_bo.c index 276ea9c550c0..88ebd681d7eb 100644 --- a/drivers/gpu/drm/vc4/vc4_bo.c +++ b/drivers/gpu/drm/vc4/vc4_bo.c @@ -66,8 +66,7 @@ static void vc4_bo_stats_print(struct drm_printer *p, struct vc4_dev *vc4) mutex_unlock(&vc4->purgeable.lock); } -#ifdef CONFIG_DEBUG_FS -int vc4_bo_stats_debugfs(struct seq_file *m, void *unused) +static int vc4_bo_stats_debugfs(struct seq_file *m, void *unused) { struct drm_info_node *node = (struct drm_info_node *)m->private; struct drm_device *dev = node->minor->dev; @@ -78,7 +77,6 @@ int vc4_bo_stats_debugfs(struct seq_file *m, void *unused) return 0; } -#endif /* Takes ownership of *name and returns the appropriate slot for it in * the bo_labels[] array, extending it as necessary. @@ -1005,6 +1003,8 @@ int vc4_bo_cache_init(struct drm_device *dev) mutex_init(&vc4->bo_lock); + vc4_debugfs_add_file(dev, "bo_stats", vc4_bo_stats_debugfs, NULL); + INIT_LIST_HEAD(&vc4->bo_cache.time_list); INIT_WORK(&vc4->bo_cache.time_work, vc4_bo_cache_time_work); |