From: David Francis <david.fran...@amd.com>

DRM provides drm_dp_mst_dump_topology, which prints
useful information about MST devices

Hook this up to a debugfs file named amdgpu_mst_topology

Signed-off-by: David Francis <david.fran...@amd.com>
Acked-by: Bhawanpreet Lakha <bhawanpreet.la...@amd.com>
---
 .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 24 +++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c 
b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
index 406129e67e79..97bbb934cc04 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
@@ -1051,9 +1051,33 @@ static int target_backlight_read(struct seq_file *m, 
void *data)
        return 0;
 }
 
+static int mst_topo(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_connector *connector;
+       struct drm_connector_list_iter conn_iter;
+       struct amdgpu_dm_connector *aconnector;
+
+       drm_connector_list_iter_begin(dev, &conn_iter);
+       drm_for_each_connector_iter(connector, &conn_iter) {
+               if (connector->connector_type != DRM_MODE_CONNECTOR_DisplayPort)
+                       continue;
+
+               aconnector = to_amdgpu_dm_connector(connector);
+
+               seq_printf(m, "\nMST topology for connector %d\n", 
aconnector->connector_id);
+               drm_dp_mst_dump_topology(m, &aconnector->mst_mgr);
+       }
+       drm_connector_list_iter_end(&conn_iter);
+
+       return 0;
+}
+
 static const struct drm_info_list amdgpu_dm_debugfs_list[] = {
        {"amdgpu_current_backlight_pwm", &current_backlight_read},
        {"amdgpu_target_backlight_pwm", &target_backlight_read},
+       {"amdgpu_mst_topology", &mst_topo},
 };
 
 /*
-- 
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to