drivers/gpu/drm/i915/display/intel_pch_display.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_pch_display.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_pch_display.c- Extension
.c- Size
- 19834 bytes
- Lines
- 644
- 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
drm/drm_print.hg4x_dp.hintel_crt.hintel_crt_regs.hintel_de.hintel_display_regs.hintel_display_types.hintel_dpll.hintel_fdi.hintel_fdi_regs.hintel_lvds.hintel_lvds_regs.hintel_pch_display.hintel_pch_refclk.hintel_pps.hintel_sdvo.h
Detected Declarations
function intel_has_pch_trancoderfunction intel_crtc_pch_transcoderfunction assert_pch_dp_disabledfunction assert_pch_hdmi_disabledfunction assert_pch_ports_disabledfunction assert_pch_transcoder_disabledfunction ibx_sanitize_pch_hdmi_portfunction ibx_sanitize_pch_dp_portfunction ibx_sanitize_pch_portsfunction intel_pch_transcoder_set_m1_n1function intel_pch_transcoder_set_m2_n2function intel_pch_transcoder_get_m1_n1function intel_pch_transcoder_get_m2_n2function ilk_pch_transcoder_set_timingsfunction ilk_enable_pch_transcoderfunction ilk_disable_pch_transcoderfunction ilk_pch_pre_enablefunction ilk_pch_enablefunction intel_crtc_has_dp_encoderfunction ilk_pch_disablefunction ilk_pch_post_disablefunction ilk_pch_clock_getfunction ilk_pch_get_configfunction lpt_enable_pch_transcoderfunction lpt_disable_pch_transcoderfunction lpt_pch_enablefunction lpt_pch_disablefunction lpt_pch_get_configfunction intel_pch_sanitize
Annotated Snippet
intel_crtc_has_dp_encoder(crtc_state)) {
const struct drm_display_mode *adjusted_mode =
&crtc_state->hw.adjusted_mode;
u32 bpc = (intel_de_read(display, TRANSCONF(display, pipe))
& TRANSCONF_BPC_MASK) >> 5;
intel_reg_t reg = TRANS_DP_CTL(pipe);
enum port port;
temp = intel_de_read(display, reg);
temp &= ~(TRANS_DP_PORT_SEL_MASK |
TRANS_DP_VSYNC_ACTIVE_HIGH |
TRANS_DP_HSYNC_ACTIVE_HIGH |
TRANS_DP_BPC_MASK);
temp |= TRANS_DP_OUTPUT_ENABLE;
temp |= bpc << 9; /* same format but at 11:9 */
if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC)
temp |= TRANS_DP_HSYNC_ACTIVE_HIGH;
if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC)
temp |= TRANS_DP_VSYNC_ACTIVE_HIGH;
port = intel_get_crtc_new_encoder(state, crtc_state)->port;
drm_WARN_ON(display->drm, port < PORT_B || port > PORT_D);
temp |= TRANS_DP_PORT_SEL(port);
intel_de_write(display, reg, temp);
}
ilk_enable_pch_transcoder(crtc_state);
}
void ilk_pch_disable(struct intel_atomic_state *state,
struct intel_crtc *crtc)
{
ilk_fdi_disable(crtc);
}
void ilk_pch_post_disable(struct intel_atomic_state *state,
struct intel_crtc *crtc)
{
struct intel_display *display = to_intel_display(crtc);
const struct intel_crtc_state *old_crtc_state =
intel_atomic_get_old_crtc_state(state, crtc);
enum pipe pipe = crtc->pipe;
ilk_disable_pch_transcoder(crtc);
if (HAS_PCH_CPT(display)) {
/* disable TRANS_DP_CTL */
intel_de_rmw(display, TRANS_DP_CTL(pipe),
TRANS_DP_OUTPUT_ENABLE | TRANS_DP_PORT_SEL_MASK,
TRANS_DP_PORT_SEL_NONE);
/* disable DPLL_SEL */
intel_de_rmw(display, PCH_DPLL_SEL,
TRANS_DPLL_ENABLE(pipe) | TRANS_DPLLB_SEL(pipe), 0);
}
ilk_fdi_pll_disable(crtc);
intel_dpll_disable(old_crtc_state);
}
static void ilk_pch_clock_get(struct intel_crtc_state *crtc_state)
{
struct intel_display *display = to_intel_display(crtc_state);
/* read out port_clock from the DPLL */
i9xx_crtc_clock_get(crtc_state);
/*
* In case there is an active pipe without active ports,
* we may need some idea for the dotclock anyway.
* Calculate one based on the FDI configuration.
*/
crtc_state->hw.adjusted_mode.crtc_clock =
intel_dotclock_calculate(intel_fdi_link_freq(display, crtc_state),
&crtc_state->fdi_m_n);
}
void ilk_pch_get_config(struct intel_crtc_state *crtc_state)
{
struct intel_display *display = to_intel_display(crtc_state);
struct intel_crtc *crtc = to_intel_crtc(crtc_state->uapi.crtc);
struct intel_dpll *pll;
enum pipe pipe = crtc->pipe;
enum intel_dpll_id pll_id;
bool pll_active;
u32 tmp;
Annotation
- Immediate include surface: `drm/drm_print.h`, `g4x_dp.h`, `intel_crt.h`, `intel_crt_regs.h`, `intel_de.h`, `intel_display_regs.h`, `intel_display_types.h`, `intel_dpll.h`.
- Detected declarations: `function intel_has_pch_trancoder`, `function intel_crtc_pch_transcoder`, `function assert_pch_dp_disabled`, `function assert_pch_hdmi_disabled`, `function assert_pch_ports_disabled`, `function assert_pch_transcoder_disabled`, `function ibx_sanitize_pch_hdmi_port`, `function ibx_sanitize_pch_dp_port`, `function ibx_sanitize_pch_ports`, `function intel_pch_transcoder_set_m1_n1`.
- 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.