drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_link_encoder.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_link_encoder.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_link_encoder.c- Extension
.c- Size
- 41294 bytes
- Lines
- 1520
- 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
reg_helper.hcore_types.hlink_encoder.hdcn10_link_encoder.hstream_encoder.hdc_bios_types.hgpio_service_interface.h
Detected Declarations
function link_transmitter_controlfunction enable_phy_bypass_modefunction disable_prbs_symbolsfunction disable_prbs_modefunction program_pattern_symbolsfunction set_dp_phy_pattern_d102function set_link_training_completefunction dcn10_link_encoder_set_dp_phy_pattern_training_patternfunction setup_panel_modefunction set_dp_phy_pattern_symbol_errorfunction set_dp_phy_pattern_prbs7function set_dp_phy_pattern_80bit_customfunction set_dp_phy_pattern_hbr2_compliance_cp2520_2function set_dp_phy_pattern_passthrough_modefunction get_frontend_sourcefunction dcn10_get_dig_frontendfunction enc1_configure_encoderfunction dcn10_psr_program_dp_dphy_fast_trainingfunction dcn10_psr_program_secondary_packetfunction dcn10_is_dig_enabledfunction link_encoder_disablefunction hpd_initializefunction dcn10_link_encoder_validate_dvi_outputfunction dcn10_link_encoder_validate_hdmi_outputfunction dcn10_link_encoder_validate_dp_outputfunction dcn10_link_encoder_constructfunction dcn10_link_encoder_validate_output_with_streamfunction dcn10_link_encoder_hw_initfunction dcn10_link_encoder_destroyfunction dcn10_link_encoder_setupfunction dcn10_link_encoder_enable_tmds_outputfunction dcn10_link_encoder_enable_tmds_output_with_clk_pattern_wafunction dcn10_link_encoder_enable_dp_outputfunction dcn10_link_encoder_enable_dp_mst_outputfunction dcn10_link_encoder_disable_outputfunction dcn10_link_encoder_dp_set_lane_settingsfunction dcn10_link_encoder_dp_set_phy_patternfunction fill_stream_allocation_row_infofunction dcn10_link_encoder_update_mst_stream_allocation_tablefunction dcn10_link_encoder_connect_dig_be_to_fefunction dm_read_regfunction dcn10_link_encoder_disable_hpdfunction dm_read_regfunction dcn10_get_dig_modefunction dcn10_link_encoder_get_max_link_capfunction dcn10_get_hpd_statefunction dcn10_program_hpd_filter
Annotated Snippet
if (link_settings->link_rate == LINK_RATE_HIGH2) {
/* this is passed to VBIOS
* to program post cursor 2 level
*/
training_lane_set.bits.POST_CURSOR2_SET =
lane_settings[lane].POST_CURSOR2;
}
cntl.lane_select = lane;
cntl.lane_settings = training_lane_set.raw;
/* call VBIOS table to set voltage swing and pre-emphasis */
result = link_transmitter_control(enc10, &cntl);
if (result != BP_RESULT_OK) {
DC_LOG_ERROR("%s: Failed to execute VBIOS command table!\n", __func__);
BREAK_TO_DEBUGGER();
}
}
}
/* set DP PHY test and training patterns */
void dcn10_link_encoder_dp_set_phy_pattern(
struct link_encoder *enc,
const struct encoder_set_dp_phy_pattern_param *param)
{
struct dcn10_link_encoder *enc10 = TO_DCN10_LINK_ENC(enc);
switch (param->dp_phy_pattern) {
case DP_TEST_PATTERN_TRAINING_PATTERN1:
dcn10_link_encoder_set_dp_phy_pattern_training_pattern(enc, 0);
break;
case DP_TEST_PATTERN_TRAINING_PATTERN2:
dcn10_link_encoder_set_dp_phy_pattern_training_pattern(enc, 1);
break;
case DP_TEST_PATTERN_TRAINING_PATTERN3:
dcn10_link_encoder_set_dp_phy_pattern_training_pattern(enc, 2);
break;
case DP_TEST_PATTERN_TRAINING_PATTERN4:
dcn10_link_encoder_set_dp_phy_pattern_training_pattern(enc, 3);
break;
case DP_TEST_PATTERN_D102:
set_dp_phy_pattern_d102(enc10);
break;
case DP_TEST_PATTERN_SYMBOL_ERROR:
set_dp_phy_pattern_symbol_error(enc10);
break;
case DP_TEST_PATTERN_PRBS7:
set_dp_phy_pattern_prbs7(enc10);
break;
case DP_TEST_PATTERN_80BIT_CUSTOM:
set_dp_phy_pattern_80bit_custom(
enc10, param->custom_pattern);
break;
case DP_TEST_PATTERN_CP2520_1:
set_dp_phy_pattern_hbr2_compliance_cp2520_2(enc10, 1);
break;
case DP_TEST_PATTERN_CP2520_2:
set_dp_phy_pattern_hbr2_compliance_cp2520_2(enc10, 2);
break;
case DP_TEST_PATTERN_CP2520_3:
set_dp_phy_pattern_hbr2_compliance_cp2520_2(enc10, 3);
break;
case DP_TEST_PATTERN_VIDEO_MODE: {
set_dp_phy_pattern_passthrough_mode(
enc10, param->dp_panel_mode);
break;
}
default:
/* invalid phy pattern */
ASSERT_CRITICAL(false);
break;
}
}
static void fill_stream_allocation_row_info(
const struct link_mst_stream_allocation *stream_allocation,
uint32_t *src,
uint32_t *slots)
{
const struct stream_encoder *stream_enc = stream_allocation->stream_enc;
if (stream_enc) {
*src = stream_enc->id;
*slots = stream_allocation->slot_count;
} else {
*src = 0;
*slots = 0;
}
Annotation
- Immediate include surface: `reg_helper.h`, `core_types.h`, `link_encoder.h`, `dcn10_link_encoder.h`, `stream_encoder.h`, `dc_bios_types.h`, `gpio_service_interface.h`.
- Detected declarations: `function link_transmitter_control`, `function enable_phy_bypass_mode`, `function disable_prbs_symbols`, `function disable_prbs_mode`, `function program_pattern_symbols`, `function set_dp_phy_pattern_d102`, `function set_link_training_complete`, `function dcn10_link_encoder_set_dp_phy_pattern_training_pattern`, `function setup_panel_mode`, `function set_dp_phy_pattern_symbol_error`.
- 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.