drivers/gpu/drm/i915/display/g4x_dp.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/g4x_dp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/g4x_dp.c- Extension
.c- Size
- 42730 bytes
- Lines
- 1429
- 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/string_helpers.hdrm/drm_print.hg4x_dp.hintel_audio.hintel_backlight.hintel_connector.hintel_crtc.hintel_de.hintel_display_power.hintel_display_regs.hintel_display_types.hintel_display_utils.hintel_dp.hintel_dp_aux.hintel_dp_link_training.hintel_dp_test.hintel_dpio_phy.hintel_encoder.hintel_fifo_underrun.hintel_hdmi.hintel_hotplug.hintel_pch_display.hintel_pps.h
Detected Declarations
function g4x_dp_set_clockfunction intel_dp_preparefunction assert_dp_portfunction assert_edp_pllfunction ilk_edp_pll_onfunction ilk_edp_pll_offfunction cpt_dp_port_selectedfunction for_each_pipefunction g4x_dp_port_enabledfunction intel_dp_get_hw_statefunction g4x_dp_get_m_nfunction intel_dp_get_configfunction intel_dp_link_downfunction g4x_dp_audio_enablefunction g4x_dp_audio_disablefunction intel_disable_dpfunction g4x_disable_dpfunction vlv_disable_dpfunction g4x_post_disable_dpfunction vlv_post_disable_dpfunction chv_post_disable_dpfunction cpt_set_link_trainfunction cpt_set_idle_link_trainfunction g4x_set_link_trainfunction g4x_set_idle_link_trainfunction intel_dp_enable_portfunction intel_enable_dpfunction with_intel_pps_lockfunction g4x_enable_dpfunction vlv_enable_dpfunction g4x_pre_enable_dpfunction vlv_pre_enable_dpfunction vlv_dp_pre_pll_enablefunction chv_pre_enable_dpfunction chv_dp_pre_pll_enablefunction chv_dp_post_pll_disablefunction intel_dp_voltage_max_2function intel_dp_voltage_max_3function intel_dp_preemph_max_2function intel_dp_preemph_max_3function vlv_set_signal_levelsfunction chv_set_signal_levelsfunction g4x_signal_levelsfunction g4x_set_signal_levelsfunction snb_cpu_edp_signal_levelsfunction snb_cpu_edp_set_signal_levelsfunction ivb_cpu_edp_signal_levelsfunction ivb_cpu_edp_set_signal_levels
Annotated Snippet
if (pipe_config->port_clock == divisor[i].dot) {
pipe_config->dpll = divisor[i];
pipe_config->clock_set = true;
break;
}
}
}
}
static void intel_dp_prepare(struct intel_encoder *encoder,
const struct intel_crtc_state *pipe_config)
{
struct intel_display *display = to_intel_display(encoder);
struct intel_dp *intel_dp = enc_to_intel_dp(encoder);
enum port port = encoder->port;
struct intel_crtc *crtc = to_intel_crtc(pipe_config->uapi.crtc);
const struct drm_display_mode *adjusted_mode = &pipe_config->hw.adjusted_mode;
intel_dp_set_link_params(intel_dp,
pipe_config->port_clock,
pipe_config->lane_count);
/*
* There are four kinds of DP registers:
* IBX PCH
* SNB CPU
* IVB CPU
* CPT PCH
*
* IBX PCH and CPU are the same for almost everything,
* except that the CPU DP PLL is configured in this
* register
*
* CPT PCH is quite different, having many bits moved
* to the TRANS_DP_CTL register instead. That
* configuration happens (oddly) in ilk_pch_enable
*/
/* Preserve the BIOS-computed detected bit. This is
* supposed to be read-only.
*/
intel_dp->DP = intel_de_read(display, intel_dp->output_reg) & DP_DETECTED;
/* Handle DP bits in common between all three register formats */
intel_dp->DP |= DP_VOLTAGE_0_4 | DP_PRE_EMPHASIS_0;
intel_dp->DP |= DP_PORT_WIDTH(pipe_config->lane_count);
/* Split out the IBX/CPU vs CPT settings */
if (display->platform.ivybridge && port == PORT_A) {
if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC)
intel_dp->DP |= DP_SYNC_HS_HIGH;
if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC)
intel_dp->DP |= DP_SYNC_VS_HIGH;
intel_dp->DP |= DP_LINK_TRAIN_OFF_CPT;
if (pipe_config->enhanced_framing)
intel_dp->DP |= DP_ENHANCED_FRAMING;
intel_dp->DP |= DP_PIPE_SEL_IVB(crtc->pipe);
} else if (HAS_PCH_CPT(display) && port != PORT_A) {
intel_dp->DP |= DP_LINK_TRAIN_OFF_CPT;
intel_de_rmw(display, TRANS_DP_CTL(crtc->pipe),
TRANS_DP_ENH_FRAMING,
pipe_config->enhanced_framing ?
TRANS_DP_ENH_FRAMING : 0);
} else {
if (display->platform.g4x && pipe_config->limited_color_range)
intel_dp->DP |= DP_COLOR_RANGE_16_235;
if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC)
intel_dp->DP |= DP_SYNC_HS_HIGH;
if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC)
intel_dp->DP |= DP_SYNC_VS_HIGH;
intel_dp->DP |= DP_LINK_TRAIN_OFF;
if (pipe_config->enhanced_framing)
intel_dp->DP |= DP_ENHANCED_FRAMING;
if (display->platform.cherryview)
intel_dp->DP |= DP_PIPE_SEL_CHV(crtc->pipe);
else
intel_dp->DP |= DP_PIPE_SEL(crtc->pipe);
}
}
static void assert_dp_port(struct intel_dp *intel_dp, bool state)
{
struct intel_display *display = to_intel_display(intel_dp);
Annotation
- Immediate include surface: `linux/string_helpers.h`, `drm/drm_print.h`, `g4x_dp.h`, `intel_audio.h`, `intel_backlight.h`, `intel_connector.h`, `intel_crtc.h`, `intel_de.h`.
- Detected declarations: `function g4x_dp_set_clock`, `function intel_dp_prepare`, `function assert_dp_port`, `function assert_edp_pll`, `function ilk_edp_pll_on`, `function ilk_edp_pll_off`, `function cpt_dp_port_selected`, `function for_each_pipe`, `function g4x_dp_port_enabled`, `function intel_dp_get_hw_state`.
- 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.