drivers/gpu/drm/amd/display/dc/link/link_detection.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/link/link_detection.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/link/link_detection.c- Extension
.c- Size
- 51792 bytes
- Lines
- 1756
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
link_dpms.hlink_detection.hlink_hwss.hprotocols/link_edp_panel_control.hprotocols/link_ddc.hprotocols/link_hpd.hprotocols/link_dpcd.hprotocols/link_dp_capability.hprotocols/link_dp_dpia.hprotocols/link_dp_phy.hprotocols/link_dp_training.hprotocols/link_hdmi_frl.hprotocols/link_dp_dpia_bw.haccessories/link_dp_trace.hlink_enc_cfg.hdm_helpers.hclk_mgr.h
Detected Declarations
function get_ddc_transaction_typefunction get_basic_signal_typefunction link_detect_sink_signal_typefunction decide_signal_from_strap_and_dongle_typefunction read_scdc_capsfunction i2c_readfunction query_dp_dual_mode_adaptorfunction dp_passive_dongle_detectionfunction link_disconnect_sinkfunction link_disconnect_remapfunction query_hdcp_capabilityfunction read_current_link_settings_on_detectfunction detect_dpfunction is_same_edidfunction wait_for_entering_dp_alt_modefunction apply_dpia_mst_dsc_always_on_wafunction revert_dpia_mst_dsc_always_on_wafunction discover_dp_mst_topologyfunction link_reset_cur_dp_mst_topologyfunction should_prepare_phy_clocks_for_link_verificationfunction is_hdmi_frl_in_usefunction prepare_phy_clocks_for_destructive_link_verificationfunction restore_phy_clocks_for_destructive_link_verificationfunction verify_link_capability_destructivefunction verify_link_capability_non_destructivefunction should_verify_link_capability_destructivelyfunction verify_link_capabilityfunction link_detect_evaluate_edid_headerfunction link_detect_ddc_probefunction link_detect_dac_load_detectfunction detect_link_and_local_sinkfunction link_detect_connection_type_analogfunction link_detect_connection_typefunction link_detectfunction link_clear_dprx_statesfunction link_is_hdcp14function link_is_hdcp22function link_add_remote_sink_helperfunction link_remove_remote_sink
Annotated Snippet
switch (downstream.id) {
case CONNECTOR_ID_SINGLE_LINK_DVII:
switch (encoder.id) {
case ENCODER_ID_INTERNAL_DAC1:
case ENCODER_ID_INTERNAL_KLDSCP_DAC1:
case ENCODER_ID_INTERNAL_DAC2:
case ENCODER_ID_INTERNAL_KLDSCP_DAC2:
return SIGNAL_TYPE_RGB;
default:
return SIGNAL_TYPE_DVI_SINGLE_LINK;
}
break;
case CONNECTOR_ID_DUAL_LINK_DVII:
{
switch (encoder.id) {
case ENCODER_ID_INTERNAL_DAC1:
case ENCODER_ID_INTERNAL_KLDSCP_DAC1:
case ENCODER_ID_INTERNAL_DAC2:
case ENCODER_ID_INTERNAL_KLDSCP_DAC2:
return SIGNAL_TYPE_RGB;
default:
return SIGNAL_TYPE_DVI_DUAL_LINK;
}
}
break;
case CONNECTOR_ID_SINGLE_LINK_DVID:
return SIGNAL_TYPE_DVI_SINGLE_LINK;
case CONNECTOR_ID_DUAL_LINK_DVID:
return SIGNAL_TYPE_DVI_DUAL_LINK;
case CONNECTOR_ID_VGA:
return SIGNAL_TYPE_RGB;
case CONNECTOR_ID_HDMI_TYPE_A:
return SIGNAL_TYPE_HDMI_TYPE_A;
case CONNECTOR_ID_LVDS:
return SIGNAL_TYPE_LVDS;
case CONNECTOR_ID_DISPLAY_PORT:
case CONNECTOR_ID_USBC:
return SIGNAL_TYPE_DISPLAY_PORT;
case CONNECTOR_ID_EDP:
return SIGNAL_TYPE_EDP;
default:
return SIGNAL_TYPE_NONE;
}
}
return SIGNAL_TYPE_NONE;
}
/*
* @brief
* Detect output sink type
*/
static enum signal_type link_detect_sink_signal_type(struct dc_link *link,
enum dc_detect_reason reason)
{
enum signal_type result;
struct audio_support *aud_support;
struct graphics_object_id enc_id;
/* External DP bridges should use DP signal regardless of connector type. */
if (link->ext_enc_id.id)
return SIGNAL_TYPE_DISPLAY_PORT;
if (link->is_dig_mapping_flexible)
enc_id = (struct graphics_object_id){.id = ENCODER_ID_UNKNOWN};
else
enc_id = link->link_enc->id;
result = get_basic_signal_type(enc_id, link->link_id);
/* Use basic signal type for link without physical connector. */
if (link->ep_type != DISPLAY_ENDPOINT_PHY)
return result;
/*
* Internal digital encoder will detect only dongles
* that require digital signal
*/
/*
* Detection mechanism is different
* for different native connectors.
* LVDS connector supports only LVDS signal;
* PCIE is a bus slot, the actual connector needs to be detected first;
* eDP connector supports only eDP signal;
* HDMI should check straps for audio
*/
switch (link->link_id.id) {
case CONNECTOR_ID_HDMI_TYPE_A:
/*
* check audio support:
Annotation
- Immediate include surface: `link_dpms.h`, `link_detection.h`, `link_hwss.h`, `protocols/link_edp_panel_control.h`, `protocols/link_ddc.h`, `protocols/link_hpd.h`, `protocols/link_dpcd.h`, `protocols/link_dp_capability.h`.
- Detected declarations: `function get_ddc_transaction_type`, `function get_basic_signal_type`, `function link_detect_sink_signal_type`, `function decide_signal_from_strap_and_dongle_type`, `function read_scdc_caps`, `function i2c_read`, `function query_dp_dual_mode_adaptor`, `function dp_passive_dongle_detection`, `function link_disconnect_sink`, `function link_disconnect_remap`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.