Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <Wayne.Lin@amd.com>
Acked-by: Jasdeep Dhillon <jdhillon@amd.com>
Signed-off-by: Stylon Wang <stylon.wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Stylon Wang and committed by
Alex Deucher
7a259c6d bb622e0c

+22 -1
+22 -1
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
··· 2639 2639 return 0; 2640 2640 } 2641 2641 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 + 2642 2661 DEFINE_SHOW_ATTRIBUTE(dp_dsc_fec_support); 2643 2662 DEFINE_SHOW_ATTRIBUTE(dmub_fw_state); 2644 2663 DEFINE_SHOW_ATTRIBUTE(dmub_tracebuffer); ··· 2669 2650 DEFINE_SHOW_ATTRIBUTE(psr_capability); 2670 2651 DEFINE_SHOW_ATTRIBUTE(dp_is_mst_connector); 2671 2652 DEFINE_SHOW_ATTRIBUTE(dp_mst_progress_status); 2653 + DEFINE_SHOW_ATTRIBUTE(is_dpia_link); 2672 2654 2673 2655 static const struct file_operations dp_dsc_clock_en_debugfs_fops = { 2674 2656 .owner = THIS_MODULE, ··· 2814 2794 {"max_bpc", &dp_max_bpc_debugfs_fops}, 2815 2795 {"dsc_disable_passthrough", &dp_dsc_disable_passthrough_debugfs_fops}, 2816 2796 {"is_mst_connector", &dp_is_mst_connector_fops}, 2817 - {"mst_progress_status", &dp_mst_progress_status_fops} 2797 + {"mst_progress_status", &dp_mst_progress_status_fops}, 2798 + {"is_dpia_link", &is_dpia_link_fops} 2818 2799 }; 2819 2800 2820 2801 #ifdef CONFIG_DRM_AMD_DC_HDCP