Now that bridges are refcounted, exposing the refcount in debugfs can be
useful.

Suggested-by: Dmitry Baryshkov <dmitry.barysh...@linaro.org>
Signed-off-by: Luca Ceresoli <luca.ceres...@bootlin.com>

---

Changes in v7:
- rebased on current code:
  - code is in drm_bridge.c now
  - removed if (drm_bridge_is_refcounted(bridge)), refcounting is not
    optional

This patch was added in v6.
---
 drivers/gpu/drm/drm_bridge.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
index 
0688f936eeb69d9f5655f2b00de4a0843dc76088..36e0829d25c29457cff5da5fec99646c74b6ad5a
 100644
--- a/drivers/gpu/drm/drm_bridge.c
+++ b/drivers/gpu/drm/drm_bridge.c
@@ -1477,6 +1477,9 @@ static void drm_bridge_debugfs_show_bridge(struct 
drm_printer *p,
                                           unsigned int idx)
 {
        drm_printf(p, "bridge[%u]: %ps\n", idx, bridge->funcs);
+
+       drm_printf(p, "\trefcount: %u\n", kref_read(&bridge->refcount));
+
        drm_printf(p, "\ttype: [%d] %s\n",
                   bridge->type,
                   drm_get_connector_type_name(bridge->type));

-- 
2.50.1

Reply via email to