drivers/gpu/drm/i915/display/g4x_hdmi.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/g4x_hdmi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/g4x_hdmi.c- Extension
.c- Size
- 23731 bytes
- Lines
- 779
- 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_hdmi.hintel_atomic.hintel_audio.hintel_connector.hintel_crtc.hintel_de.hintel_display_power.hintel_display_regs.hintel_display_types.hintel_dp_aux.hintel_dpio_phy.hintel_encoder.hintel_fifo_underrun.hintel_hdmi.hintel_hotplug.hintel_sdvo.h
Detected Declarations
function intel_hdmi_preparefunction intel_hdmi_get_hw_statefunction connector_is_hdmifunction g4x_compute_has_hdmi_sinkfunction g4x_hdmi_connector_atomic_checkfunction g4x_hdmi_compute_configfunction intel_hdmi_get_configfunction g4x_hdmi_enable_portfunction g4x_hdmi_audio_enablefunction g4x_hdmi_audio_disablefunction g4x_enable_hdmifunction ibx_enable_hdmifunction cpt_enable_hdmifunction vlv_enable_hdmifunction g4x_disable_hdmifunction pch_disable_hdmifunction intel_hdmi_pre_enablefunction vlv_hdmi_pre_enablefunction vlv_hdmi_pre_pll_enablefunction chv_hdmi_pre_pll_enablefunction chv_hdmi_post_pll_disablefunction vlv_hdmi_post_disablefunction chv_hdmi_post_disablefunction chv_hdmi_pre_enablefunction intel_hdmi_hotplugfunction g4x_hdmi_connector_atomic_checkfunction is_hdmi_port_validfunction assert_hdmi_port_validfunction g4x_hdmi_init
Annotated Snippet
if (IS_ERR(conn_state)) {
ret = PTR_ERR(conn_state);
break;
}
crtc = conn_state->crtc;
if (!crtc)
continue;
crtc_state = drm_atomic_get_new_crtc_state(state, crtc);
crtc_state->mode_changed = true;
ret = drm_atomic_add_affected_planes(state, crtc);
if (ret)
break;
}
drm_connector_list_iter_end(&conn_iter);
return ret;
}
static bool is_hdmi_port_valid(struct intel_display *display, enum port port)
{
if (display->platform.g4x || display->platform.valleyview)
return port == PORT_B || port == PORT_C;
else
return port == PORT_B || port == PORT_C || port == PORT_D;
}
static bool assert_hdmi_port_valid(struct intel_display *display, enum port port)
{
return !drm_WARN(display->drm, !is_hdmi_port_valid(display, port),
"Platform does not support HDMI %c\n", port_name(port));
}
bool g4x_hdmi_init(struct intel_display *display,
intel_reg_t hdmi_reg, enum port port)
{
const struct intel_bios_encoder_data *devdata;
struct intel_digital_port *dig_port;
struct intel_encoder *intel_encoder;
struct intel_connector *intel_connector;
if (!assert_port_valid(display, port))
return false;
if (!assert_hdmi_port_valid(display, port))
return false;
devdata = intel_bios_encoder_data_lookup(display, port);
/* FIXME bail? */
if (!devdata)
drm_dbg_kms(display->drm, "No VBT child device for HDMI-%c\n",
port_name(port));
dig_port = intel_dig_port_alloc();
if (!dig_port)
return false;
intel_connector = intel_connector_alloc();
if (!intel_connector)
goto err_connector_alloc;
intel_encoder = &dig_port->base;
intel_encoder->devdata = devdata;
if (drm_encoder_init(display->drm, &intel_encoder->base,
&intel_hdmi_enc_funcs, DRM_MODE_ENCODER_TMDS,
"HDMI %c", port_name(port)))
goto err_encoder_init;
intel_encoder->hotplug = intel_hdmi_hotplug;
intel_encoder->compute_config = g4x_hdmi_compute_config;
if (HAS_PCH_SPLIT(display)) {
intel_encoder->disable = pch_disable_hdmi;
intel_encoder->post_disable = pch_post_disable_hdmi;
} else {
intel_encoder->disable = g4x_disable_hdmi;
}
intel_encoder->get_hw_state = intel_hdmi_get_hw_state;
intel_encoder->get_config = intel_hdmi_get_config;
if (display->platform.cherryview) {
intel_encoder->pre_pll_enable = chv_hdmi_pre_pll_enable;
intel_encoder->pre_enable = chv_hdmi_pre_enable;
intel_encoder->enable = vlv_enable_hdmi;
intel_encoder->post_disable = chv_hdmi_post_disable;
intel_encoder->post_pll_disable = chv_hdmi_post_pll_disable;
} else if (display->platform.valleyview) {
Annotation
- Immediate include surface: `drm/drm_print.h`, `g4x_hdmi.h`, `intel_atomic.h`, `intel_audio.h`, `intel_connector.h`, `intel_crtc.h`, `intel_de.h`, `intel_display_power.h`.
- Detected declarations: `function intel_hdmi_prepare`, `function intel_hdmi_get_hw_state`, `function connector_is_hdmi`, `function g4x_compute_has_hdmi_sink`, `function g4x_hdmi_connector_atomic_check`, `function g4x_hdmi_compute_config`, `function intel_hdmi_get_config`, `function g4x_hdmi_enable_port`, `function g4x_hdmi_audio_enable`, `function g4x_hdmi_audio_disable`.
- 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.