Skip to content

Commit 7a259c6

Browse files
Stylon Wangalexdeucher
authored andcommitted
drm/amd/display: Create debugfs to tell if connector is DPIA link
[Why] Tests need to tell if display is connected via USB4 DPIA link. Currently this is only possible via analyzing dmesg logs. [How] Create a per-connector debugfs entry to report if the link is tunneled via USB4 DPIA. Reviewed-by: Wayne Lin <[email protected]> Acked-by: Jasdeep Dhillon <[email protected]> Signed-off-by: Stylon Wang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent bb622e0 commit 7a259c6

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2639,6 +2639,25 @@ static int dp_mst_progress_status_show(struct seq_file *m, void *unused)
26392639
return 0;
26402640
}
26412641

2642+
/*
2643+
* Reports whether the connected display is a USB4 DPIA tunneled display
2644+
* Example usage: cat /sys/kernel/debug/dri/0/DP-8/is_dpia_link
2645+
*/
2646+
static int is_dpia_link_show(struct seq_file *m, void *data)
2647+
{
2648+
struct drm_connector *connector = m->private;
2649+
struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
2650+
struct dc_link *link = aconnector->dc_link;
2651+
2652+
if (connector->status != connector_status_connected)
2653+
return -ENODEV;
2654+
2655+
seq_printf(m, "%s\n", (link->ep_type == DISPLAY_ENDPOINT_USB4_DPIA) ? "yes" :
2656+
(link->ep_type == DISPLAY_ENDPOINT_PHY) ? "no" : "unknown");
2657+
2658+
return 0;
2659+
}
2660+
26422661
DEFINE_SHOW_ATTRIBUTE(dp_dsc_fec_support);
26432662
DEFINE_SHOW_ATTRIBUTE(dmub_fw_state);
26442663
DEFINE_SHOW_ATTRIBUTE(dmub_tracebuffer);
@@ -2650,6 +2669,7 @@ DEFINE_SHOW_ATTRIBUTE(internal_display);
26502669
DEFINE_SHOW_ATTRIBUTE(psr_capability);
26512670
DEFINE_SHOW_ATTRIBUTE(dp_is_mst_connector);
26522671
DEFINE_SHOW_ATTRIBUTE(dp_mst_progress_status);
2672+
DEFINE_SHOW_ATTRIBUTE(is_dpia_link);
26532673

26542674
static const struct file_operations dp_dsc_clock_en_debugfs_fops = {
26552675
.owner = THIS_MODULE,
@@ -2794,7 +2814,8 @@ static const struct {
27942814
{"max_bpc", &dp_max_bpc_debugfs_fops},
27952815
{"dsc_disable_passthrough", &dp_dsc_disable_passthrough_debugfs_fops},
27962816
{"is_mst_connector", &dp_is_mst_connector_fops},
2797-
{"mst_progress_status", &dp_mst_progress_status_fops}
2817+
{"mst_progress_status", &dp_mst_progress_status_fops},
2818+
{"is_dpia_link", &is_dpia_link_fops}
27982819
};
27992820

28002821
#ifdef CONFIG_DRM_AMD_DC_HDCP

0 commit comments

Comments
 (0)