drivers/gpu/drm/i915/display/intel_ddi.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_ddi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_ddi.c- Extension
.c- Size
- 169393 bytes
- Lines
- 5517
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/iopoll.hlinux/seq_buf.hlinux/string_helpers.hdrm/display/drm_dp_helper.hdrm/display/drm_scdc_helper.hdrm/drm_print.hdrm/drm_privacy_screen_consumer.hdrm/intel/step.hicl_dsi.hintel_alpm.hintel_audio.hintel_audio_regs.hintel_backlight.hintel_combo_phy.hintel_combo_phy_regs.hintel_connector.hintel_crtc.hintel_cx0_phy.hintel_cx0_phy_regs.hintel_ddi.hintel_ddi_buf_trans.hintel_de.hintel_display_power.hintel_display_regs.hintel_display_types.hintel_display_utils.hintel_display_wa.hintel_dkl_phy.hintel_dkl_phy_regs.hintel_dp.hintel_dp_aux.hintel_dp_link_training.h
Detected Declarations
struct intel_dpllfunction intel_ddi_hdmi_levelfunction has_buf_trans_selectfunction has_iboostfunction hsw_prepare_dp_ddi_buffersfunction hsw_prepare_hdmi_ddi_buffersfunction intel_ddi_buf_status_regfunction intel_wait_ddi_buf_idlefunction intel_wait_ddi_buf_activefunction hsw_pll_to_ddi_pll_selfunction icl_pll_to_ddi_clk_selfunction ddi_buf_phy_link_ratefunction dp_phy_lane_stagger_delayfunction intel_ddi_init_dp_buf_regfunction icl_calc_tbt_pll_linkfunction ddi_dotclock_getfunction intel_ddi_set_dp_msafunction bdw_trans_port_sync_master_selectfunction intel_ddi_config_transcoder_dp2function intel_ddi_enable_transcoder_funcfunction intel_dp_is_uhbrfunction intel_ddi_enable_transcoder_funcfunction intel_ddi_enable_transcoder_funcfunction intel_ddi_post_disable_dpfunction intel_ddi_toggle_hdcp_bitsfunction intel_ddi_connector_get_hw_statefunction intel_ddi_get_encoder_pipesfunction for_each_pipefunction intel_ddi_get_hw_statefunction intel_ddi_main_link_aux_domainfunction main_link_aux_power_domain_getfunction main_link_aux_power_domain_putfunction intel_ddi_get_power_domainsfunction intel_ddi_enable_transcoder_clockfunction intel_ddi_disable_transcoder_clockfunction _skl_ddi_set_iboostfunction skl_ddi_set_iboostfunction intel_ddi_dp_voltage_maxfunction intel_ddi_dp_preemph_maxfunction icl_combo_phy_loadgen_selectfunction icl_ddi_combo_vswing_programfunction icl_combo_phy_set_signal_levelsfunction icl_mg_phy_set_signal_levelsfunction tgl_dkl_phy_set_signal_levelsfunction translate_signal_levelfunction intel_ddi_dp_levelfunction intel_ddi_levelfunction hsw_set_signal_levels
Annotated Snippet
switch (clock) {
case 162000:
return DDI_CLK_SEL_TBT_162;
case 270000:
return DDI_CLK_SEL_TBT_270;
case 540000:
return DDI_CLK_SEL_TBT_540;
case 810000:
return DDI_CLK_SEL_TBT_810;
default:
MISSING_CASE(clock);
return DDI_CLK_SEL_NONE;
}
case DPLL_ID_ICL_MGPLL1:
case DPLL_ID_ICL_MGPLL2:
case DPLL_ID_ICL_MGPLL3:
case DPLL_ID_ICL_MGPLL4:
case DPLL_ID_TGL_MGPLL5:
case DPLL_ID_TGL_MGPLL6:
return DDI_CLK_SEL_MG;
}
}
static u32 ddi_buf_phy_link_rate(int port_clock)
{
switch (port_clock) {
case 162000:
return DDI_BUF_PHY_LINK_RATE(0);
case 216000:
return DDI_BUF_PHY_LINK_RATE(4);
case 243000:
return DDI_BUF_PHY_LINK_RATE(5);
case 270000:
return DDI_BUF_PHY_LINK_RATE(1);
case 324000:
return DDI_BUF_PHY_LINK_RATE(6);
case 432000:
return DDI_BUF_PHY_LINK_RATE(7);
case 540000:
return DDI_BUF_PHY_LINK_RATE(2);
case 810000:
return DDI_BUF_PHY_LINK_RATE(3);
default:
MISSING_CASE(port_clock);
return DDI_BUF_PHY_LINK_RATE(0);
}
}
static int dp_phy_lane_stagger_delay(int port_clock)
{
/*
* Return the number of symbol clocks delay used to stagger the
* assertion/desassertion of the port lane enables. The target delay
* time is 100 ns or greater, return the number of symbols specific to
* the provided port_clock (aka link clock) corresponding to this delay
* time, i.e. so that
*
* number_of_symbols * duration_of_one_symbol >= 100 ns
*
* The delay must be applied only on TypeC DP outputs, for everything else
* the delay must be set to 0.
*
* Return the number of link symbols per 100 ns:
* port_clock (10 kHz) -> bits / 100 us
* / symbol_size -> symbols / 100 us
* / 1000 -> symbols / 100 ns
*/
return DIV_ROUND_UP(port_clock, intel_dp_link_symbol_size(port_clock) * 1000);
}
static void intel_ddi_init_dp_buf_reg(struct intel_encoder *encoder,
const struct intel_crtc_state *crtc_state)
{
struct intel_display *display = to_intel_display(encoder);
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
/* DDI_BUF_CTL_ENABLE will be set by intel_ddi_prepare_link_retrain() later */
intel_dp->DP = DDI_PORT_WIDTH(crtc_state->lane_count) |
DDI_BUF_TRANS_SELECT(0);
if (dig_port->lane_reversal)
intel_dp->DP |= DDI_BUF_PORT_REVERSAL;
if (dig_port->ddi_a_4_lanes)
intel_dp->DP |= DDI_A_4_LANES;
if (DISPLAY_VER(display) >= 14) {
if (intel_dp_is_uhbr(crtc_state))
intel_dp->DP |= DDI_BUF_PORT_DATA_40BIT;
else
Annotation
- Immediate include surface: `linux/iopoll.h`, `linux/seq_buf.h`, `linux/string_helpers.h`, `drm/display/drm_dp_helper.h`, `drm/display/drm_scdc_helper.h`, `drm/drm_print.h`, `drm/drm_privacy_screen_consumer.h`, `drm/intel/step.h`.
- Detected declarations: `struct intel_dpll`, `function intel_ddi_hdmi_level`, `function has_buf_trans_select`, `function has_iboost`, `function hsw_prepare_dp_ddi_buffers`, `function hsw_prepare_hdmi_ddi_buffers`, `function intel_ddi_buf_status_reg`, `function intel_wait_ddi_buf_idle`, `function intel_wait_ddi_buf_active`, `function hsw_pll_to_ddi_pll_sel`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.