summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_bridge_connector.c
diff options
context:
space:
mode:
authorDouglas Anderson <dianders@chromium.org>2022-02-04 16:13:41 -0800
committerDouglas Anderson <dianders@chromium.org>2022-02-15 15:25:18 -0800
commit2509969a9862b522d2208e8663057fb227556687 (patch)
treeff52cebcc0aece228591915b6f6840f5cf7ecff9 /drivers/gpu/drm/drm_bridge_connector.c
parente283820cbf8092c87a8d6461260d5bc525da72c9 (diff)
drm: Plumb debugfs_init through to panels
We'd like panels to be able to add things to debugfs underneath the connector's directory. Let's plumb it through. A panel will be able to put things in a "panel" directory under the connector's directory. Note that debugfs is not ABI and so it's always possible that the location that the panel gets for its debugfs could change in the future. NOTE: this currently only works if you're using a modern architecture. Specifically the plumbing relies on _both_ drm_bridge_connector and drm_panel_bridge. If you're not using one or both of these things then things won't be plumbed through. As a side effect of this change, drm_bridges can also get callbacks to put stuff underneath the connector's debugfs directory. At the moment all bridges in the chain have their debugfs_init() called with the connector's root directory. Signed-off-by: Douglas Anderson <dianders@chromium.org> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://patchwork.freedesktop.org/patch/msgid/20220204161245.v2.2.Ib0bd5346135cbb0b63006b69b61d4c8af6484740@changeid
Diffstat (limited to 'drivers/gpu/drm/drm_bridge_connector.c')
-rw-r--r--drivers/gpu/drm/drm_bridge_connector.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/drm/drm_bridge_connector.c b/drivers/gpu/drm/drm_bridge_connector.c
index 791379816837..60923cdfe8e1 100644
--- a/drivers/gpu/drm/drm_bridge_connector.c
+++ b/drivers/gpu/drm/drm_bridge_connector.c
@@ -216,6 +216,20 @@ static void drm_bridge_connector_destroy(struct drm_connector *connector)
kfree(bridge_connector);
}
+static void drm_bridge_connector_debugfs_init(struct drm_connector *connector,
+ struct dentry *root)
+{
+ struct drm_bridge_connector *bridge_connector =
+ to_drm_bridge_connector(connector);
+ struct drm_encoder *encoder = bridge_connector->encoder;
+ struct drm_bridge *bridge;
+
+ list_for_each_entry(bridge, &encoder->bridge_chain, chain_node) {
+ if (bridge->funcs->debugfs_init)
+ bridge->funcs->debugfs_init(bridge, root);
+ }
+}
+
static const struct drm_connector_funcs drm_bridge_connector_funcs = {
.reset = drm_atomic_helper_connector_reset,
.detect = drm_bridge_connector_detect,
@@ -223,6 +237,7 @@ static const struct drm_connector_funcs drm_bridge_connector_funcs = {
.destroy = drm_bridge_connector_destroy,
.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
+ .debugfs_init = drm_bridge_connector_debugfs_init,
};
/* -----------------------------------------------------------------------------