drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c- Extension
.c- Size
- 87729 bytes
- Lines
- 2659
- 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_dp_capability.hlink_ddc.hlink_dpcd.hlink_dp_dpia.hlink_dp_phy.hlink_edp_panel_control.hlink_dp_irq_handler.hlink/accessories/link_dp_trace.hlink/link_detection.hlink/link_validation.hlink_dp_training.hatomfirmware.hresource.hlink_enc_cfg.hdc_dmub_srv.hgpio_service_interface.h
Detected Declarations
struct dp_lt_fallback_entryfunction is_dp_active_donglefunction is_dp_branch_devicefunction translate_dpcd_max_bpcfunction dp_parse_lttpr_repeater_countfunction dp_get_closest_lttpr_offsetfunction link_bw_kbps_from_raw_frl_link_rate_datafunction linkRateInKHzToLinkRateMultiplierfunction intersect_cable_idfunction intersect_frl_link_bw_supportfunction get_clock_source_idfunction dp_wa_power_up_0010FAfunction dp_is_fec_supportedfunction dp_should_enable_fecfunction dp_is_128b_132b_signalfunction dp_is_lttpr_presentfunction get_link_rate_from_max_link_bwfunction get_lttpr_max_lane_countfunction get_lttpr_max_link_ratefunction get_cable_max_link_ratefunction reached_minimum_lane_countfunction reached_minimum_link_ratefunction reduce_lane_countfunction reduce_link_ratefunction increase_lane_countfunction increase_link_ratefunction increase_edp_link_ratefunction decide_fallback_link_setting_max_bw_policyfunction decide_fallback_link_settingfunction decide_dp_link_settingsfunction edp_decide_link_settingsfunction decide_edp_link_settings_with_dscfunction decide_mst_link_settingsfunction link_decide_link_settingsfunction link_dp_get_encoding_formatfunction mst_decide_link_encoding_formatfunction read_dp_device_vendor_idfunction wake_up_aux_channelfunction read_and_intersect_post_frl_lt_statusfunction get_active_converter_infofunction apply_usbc_combo_phy_reset_wafunction dp_overwrite_extended_receiver_capfunction dpcd_set_source_specific_datafunction dpcd_write_cable_id_to_dprxfunction get_usbc_cable_idfunction retrieve_cable_idfunction read_is_mst_supportedfunction address
Annotated Snippet
struct dp_lt_fallback_entry {
enum dc_lane_count lane_count;
enum dc_link_rate link_rate;
};
static const struct dp_lt_fallback_entry dp_lt_fallbacks[] = {
/* This link training fallback array is ordered by
* link bandwidth from highest to lowest.
* DP specs makes it a normative policy to always
* choose the next highest link bandwidth during
* link training fallback.
*/
{LANE_COUNT_FOUR, LINK_RATE_UHBR20},
{LANE_COUNT_FOUR, LINK_RATE_UHBR13_5},
{LANE_COUNT_TWO, LINK_RATE_UHBR20},
{LANE_COUNT_FOUR, LINK_RATE_UHBR10},
{LANE_COUNT_TWO, LINK_RATE_UHBR13_5},
{LANE_COUNT_FOUR, LINK_RATE_HIGH3},
{LANE_COUNT_ONE, LINK_RATE_UHBR20},
{LANE_COUNT_TWO, LINK_RATE_UHBR10},
{LANE_COUNT_FOUR, LINK_RATE_HIGH2},
{LANE_COUNT_ONE, LINK_RATE_UHBR13_5},
{LANE_COUNT_TWO, LINK_RATE_HIGH3},
{LANE_COUNT_ONE, LINK_RATE_UHBR10},
{LANE_COUNT_TWO, LINK_RATE_HIGH2},
{LANE_COUNT_FOUR, LINK_RATE_HIGH},
{LANE_COUNT_ONE, LINK_RATE_HIGH3},
{LANE_COUNT_FOUR, LINK_RATE_LOW},
{LANE_COUNT_ONE, LINK_RATE_HIGH2},
{LANE_COUNT_TWO, LINK_RATE_HIGH},
{LANE_COUNT_TWO, LINK_RATE_LOW},
{LANE_COUNT_ONE, LINK_RATE_HIGH},
{LANE_COUNT_ONE, LINK_RATE_LOW},
};
static const struct dc_link_settings fail_safe_link_settings = {
.lane_count = LANE_COUNT_ONE,
.link_rate = LINK_RATE_LOW,
.link_spread = LINK_SPREAD_DISABLED,
};
bool is_dp_active_dongle(const struct dc_link *link)
{
return (link->dpcd_caps.dongle_type >= DISPLAY_DONGLE_DP_VGA_CONVERTER) &&
(link->dpcd_caps.dongle_type <= DISPLAY_DONGLE_DP_HDMI_CONVERTER);
}
bool is_dp_branch_device(const struct dc_link *link)
{
return link->dpcd_caps.is_branch_dev;
}
static int translate_dpcd_max_bpc(enum dpcd_downstream_port_max_bpc bpc)
{
switch (bpc) {
case DOWN_STREAM_MAX_8BPC:
return 8;
case DOWN_STREAM_MAX_10BPC:
return 10;
case DOWN_STREAM_MAX_12BPC:
return 12;
case DOWN_STREAM_MAX_16BPC:
return 16;
default:
break;
}
return -1;
}
uint8_t dp_parse_lttpr_repeater_count(uint8_t lttpr_repeater_count)
{
switch (lttpr_repeater_count) {
case 0x80: // 1 lttpr repeater
return 1;
case 0x40: // 2 lttpr repeaters
return 2;
case 0x20: // 3 lttpr repeaters
return 3;
case 0x10: // 4 lttpr repeaters
return 4;
case 0x08: // 5 lttpr repeaters
return 5;
case 0x04: // 6 lttpr repeaters
return 6;
case 0x02: // 7 lttpr repeaters
return 7;
case 0x01: // 8 lttpr repeaters
return 8;
default:
Annotation
- Immediate include surface: `link_dp_capability.h`, `link_ddc.h`, `link_dpcd.h`, `link_dp_dpia.h`, `link_dp_phy.h`, `link_edp_panel_control.h`, `link_dp_irq_handler.h`, `link/accessories/link_dp_trace.h`.
- Detected declarations: `struct dp_lt_fallback_entry`, `function is_dp_active_dongle`, `function is_dp_branch_device`, `function translate_dpcd_max_bpc`, `function dp_parse_lttpr_repeater_count`, `function dp_get_closest_lttpr_offset`, `function link_bw_kbps_from_raw_frl_link_rate_data`, `function linkRateInKHzToLinkRateMultiplier`, `function intersect_cable_id`, `function intersect_frl_link_bw_support`.
- 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.