drivers/gpu/drm/i915/display/intel_hdmi.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_hdmi.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_hdmi.c- Extension
.c- Size
- 101472 bytes
- Lines
- 3400
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/hdmi.hlinux/i2c.hlinux/iopoll.hlinux/slab.hlinux/string_helpers.hdrm/display/drm_hdcp_helper.hdrm/display/drm_hdmi_helper.hdrm/display/drm_scdc_helper.hdrm/drm_atomic_helper.hdrm/drm_crtc.hdrm/drm_edid.hdrm/drm_print.hdrm/drm_probe_helper.hdrm/intel/intel_lpe_audio.hmedia/cec-notifier.hg4x_hdmi.hintel_atomic.hintel_audio.hintel_connector.hintel_cx0_phy.hintel_ddi.hintel_de.hintel_display_driver.hintel_display_regs.hintel_display_types.hintel_display_utils.hintel_dp.hintel_dpll.hintel_gmbus.hintel_hdcp.hintel_hdcp_regs.h
Detected Declarations
struct hdcp2_hdmi_msg_timeoutfunction filesfunction assert_hdmi_port_disabledfunction assert_hdmi_transcoder_func_disabledfunction g4x_infoframe_indexfunction g4x_infoframe_enablefunction hsw_infoframe_enablefunction hsw_dip_data_regfunction hsw_dip_data_sizefunction g4x_write_infoframefunction g4x_read_infoframefunction g4x_infoframes_enabledfunction ibx_write_infoframefunction ibx_read_infoframefunction ibx_infoframes_enabledfunction cpt_write_infoframefunction cpt_read_infoframefunction cpt_infoframes_enabledfunction vlv_write_infoframefunction vlv_read_infoframefunction vlv_infoframes_enabledfunction hsw_write_infoframefunction hsw_read_infoframefunction hsw_infoframes_enabledfunction intel_hdmi_infoframe_enablefunction intel_hdmi_infoframes_enabledfunction packfunction intel_read_infoframefunction intel_hdmi_compute_avi_infoframefunction intel_hdmi_compute_spd_infoframefunction intel_hdmi_compute_hdmi_infoframefunction intel_hdmi_compute_drm_infoframefunction g4x_set_infoframesfunction gcp_default_phase_possiblefunction intel_hdmi_set_gcp_infoframefunction intel_hdmi_read_gcp_infoframefunction intel_hdmi_compute_gcp_infoframefunction ibx_set_infoframesfunction cpt_set_infoframesfunction vlv_set_infoframesfunction intel_hdmi_fastset_infoframesfunction hsw_set_infoframesfunction intel_dp_dual_mode_set_tmds_outputfunction intel_hdmi_hdcp_readfunction intel_hdmi_hdcp_writefunction intel_hdmi_hdcp_write_an_aksvfunction intel_hdmi_hdcp_read_bksvfunction intel_hdmi_hdcp_read_bstatus
Annotated Snippet
struct hdcp2_hdmi_msg_timeout {
u8 msg_id;
u16 timeout;
};
static const struct hdcp2_hdmi_msg_timeout hdcp2_msg_timeout[] = {
{ HDCP_2_2_AKE_SEND_CERT, HDCP_2_2_CERT_TIMEOUT_MS, },
{ HDCP_2_2_AKE_SEND_PAIRING_INFO, HDCP_2_2_PAIRING_TIMEOUT_MS, },
{ HDCP_2_2_LC_SEND_LPRIME, HDCP_2_2_HDMI_LPRIME_TIMEOUT_MS, },
{ HDCP_2_2_REP_SEND_RECVID_LIST, HDCP_2_2_RECVID_LIST_TIMEOUT_MS, },
{ HDCP_2_2_REP_STREAM_READY, HDCP_2_2_STREAM_READY_TIMEOUT_MS, },
};
static
int intel_hdmi_hdcp2_read_rx_status(struct intel_digital_port *dig_port,
u8 *rx_status)
{
return intel_hdmi_hdcp_read(dig_port,
HDCP_2_2_HDMI_REG_RXSTATUS_OFFSET,
rx_status,
HDCP_2_2_HDMI_RXSTATUS_LEN);
}
static int get_hdcp2_msg_timeout(u8 msg_id, bool is_paired)
{
int i;
if (msg_id == HDCP_2_2_AKE_SEND_HPRIME) {
if (is_paired)
return HDCP_2_2_HPRIME_PAIRED_TIMEOUT_MS;
else
return HDCP_2_2_HPRIME_NO_PAIRED_TIMEOUT_MS;
}
for (i = 0; i < ARRAY_SIZE(hdcp2_msg_timeout); i++) {
if (hdcp2_msg_timeout[i].msg_id == msg_id)
return hdcp2_msg_timeout[i].timeout;
}
return -EINVAL;
}
static int
hdcp2_detect_msg_availability(struct intel_digital_port *dig_port,
u8 msg_id, bool *msg_ready,
ssize_t *msg_sz)
{
struct intel_display *display = to_intel_display(dig_port);
u8 rx_status[HDCP_2_2_HDMI_RXSTATUS_LEN];
int ret;
ret = intel_hdmi_hdcp2_read_rx_status(dig_port, rx_status);
if (ret < 0) {
drm_dbg_kms(display->drm, "rx_status read failed. Err %d\n",
ret);
return ret;
}
*msg_sz = ((HDCP_2_2_HDMI_RXSTATUS_MSG_SZ_HI(rx_status[1]) << 8) |
rx_status[0]);
if (msg_id == HDCP_2_2_REP_SEND_RECVID_LIST)
*msg_ready = (HDCP_2_2_HDMI_RXSTATUS_READY(rx_status[1]) &&
*msg_sz);
else
*msg_ready = *msg_sz;
return 0;
}
static ssize_t
intel_hdmi_hdcp2_wait_for_msg(struct intel_digital_port *dig_port,
u8 msg_id, bool paired)
{
struct intel_display *display = to_intel_display(dig_port);
bool msg_ready = false;
int timeout, ret;
ssize_t msg_sz = 0;
timeout = get_hdcp2_msg_timeout(msg_id, paired);
if (timeout < 0)
return timeout;
ret = poll_timeout_us(ret = hdcp2_detect_msg_availability(dig_port, msg_id,
&msg_ready, &msg_sz),
!ret && msg_ready && msg_sz,
4000, timeout * 1000, false);
if (ret)
drm_dbg_kms(display->drm,
"msg_id: %d, ret: %d, timeout: %d\n",
Annotation
- Immediate include surface: `linux/delay.h`, `linux/hdmi.h`, `linux/i2c.h`, `linux/iopoll.h`, `linux/slab.h`, `linux/string_helpers.h`, `drm/display/drm_hdcp_helper.h`, `drm/display/drm_hdmi_helper.h`.
- Detected declarations: `struct hdcp2_hdmi_msg_timeout`, `function files`, `function assert_hdmi_port_disabled`, `function assert_hdmi_transcoder_func_disabled`, `function g4x_infoframe_index`, `function g4x_infoframe_enable`, `function hsw_infoframe_enable`, `function hsw_dip_data_reg`, `function hsw_dip_data_size`, `function g4x_write_infoframe`.
- 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.