drivers/gpu/drm/i915/display/intel_lspcon.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_lspcon.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_lspcon.c- Extension
.c- Size
- 21326 bytes
- Lines
- 757
- 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.hdrm/display/drm_dp_dual_mode_helper.hdrm/display/drm_hdmi_helper.hdrm/drm_atomic_helper.hdrm/drm_edid.hdrm/drm_print.hintel_de.hintel_display_regs.hintel_display_types.hintel_display_utils.hintel_dp.hintel_hdmi.hintel_lspcon.h
Detected Declarations
function filesfunction lspcon_detect_vendorfunction get_hdr_status_regfunction intel_lspcon_detect_hdr_capabilityfunction lspcon_get_current_modefunction lspcon_get_mode_settle_timeoutfunction lspcon_wait_modefunction lspcon_change_modefunction lspcon_wake_native_aux_chfunction lspcon_probefunction lspcon_resume_in_pcon_wafunction lspcon_parade_fw_readyfunction _lspcon_parade_write_infoframe_blocksfunction _lspcon_write_avi_infoframe_paradefunction bytefunction _lspcon_write_avi_infoframe_mcafunction lspcon_write_infoframefunction lspcon_read_infoframefunction lspcon_set_infoframesfunction _lspcon_read_avi_infoframe_enabled_mcafunction _lspcon_read_avi_infoframe_enabled_paradefunction lspcon_infoframes_enabledfunction intel_lspcon_wait_pcon_modefunction intel_lspcon_initfunction intel_lspcon_activefunction intel_lspcon_infoframes_enabledfunction intel_lspcon_resume
Annotated Snippet
if (lspcon_change_mode(lspcon, DRM_LSPCON_MODE_PCON) < 0) {
drm_err(display->drm, "LSPCON mode change to PCON failed\n");
return false;
}
}
return true;
}
static void lspcon_resume_in_pcon_wa(struct intel_lspcon *lspcon)
{
struct intel_dp *intel_dp = lspcon_to_intel_dp(lspcon);
struct intel_display *display = to_intel_display(intel_dp);
struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
unsigned long start = jiffies;
while (1) {
if (intel_digital_port_connected(&dig_port->base)) {
drm_dbg_kms(display->drm, "LSPCON recovering in PCON mode after %u ms\n",
jiffies_to_msecs(jiffies - start));
return;
}
if (time_after(jiffies, start + msecs_to_jiffies(1000)))
break;
usleep_range(10000, 15000);
}
drm_dbg_kms(display->drm, "LSPCON DP descriptor mismatch after resume\n");
}
static bool lspcon_parade_fw_ready(struct drm_dp_aux *aux)
{
u8 avi_if_ctrl;
u8 retry;
ssize_t ret;
/* Check if LSPCON FW is ready for data */
for (retry = 0; retry < 5; retry++) {
if (retry)
usleep_range(200, 300);
ret = drm_dp_dpcd_read(aux, LSPCON_PARADE_AVI_IF_CTRL,
&avi_if_ctrl, 1);
if (ret < 0) {
drm_err(aux->drm_dev, "Failed to read AVI IF control\n");
return false;
}
if ((avi_if_ctrl & LSPCON_PARADE_AVI_IF_KICKOFF) == 0)
return true;
}
drm_err(aux->drm_dev, "Parade FW not ready to accept AVI IF\n");
return false;
}
static bool _lspcon_parade_write_infoframe_blocks(struct drm_dp_aux *aux,
u8 *avi_buf)
{
u8 avi_if_ctrl;
u8 block_count = 0;
u8 *data;
u16 reg;
ssize_t ret;
while (block_count < 4) {
if (!lspcon_parade_fw_ready(aux)) {
drm_dbg_kms(aux->drm_dev, "LSPCON FW not ready, block %d\n",
block_count);
return false;
}
reg = LSPCON_PARADE_AVI_IF_WRITE_OFFSET;
data = avi_buf + block_count * 8;
ret = drm_dp_dpcd_write(aux, reg, data, 8);
if (ret < 0) {
drm_err(aux->drm_dev, "Failed to write AVI IF block %d\n",
block_count);
return false;
}
/*
* Once a block of data is written, we have to inform the FW
* about this by writing into avi infoframe control register:
* - set the kickoff bit[7] to 1
* - write the block no. to bits[1:0]
*/
reg = LSPCON_PARADE_AVI_IF_CTRL;
avi_if_ctrl = LSPCON_PARADE_AVI_IF_KICKOFF | block_count;
Annotation
- Immediate include surface: `linux/iopoll.h`, `drm/display/drm_dp_dual_mode_helper.h`, `drm/display/drm_hdmi_helper.h`, `drm/drm_atomic_helper.h`, `drm/drm_edid.h`, `drm/drm_print.h`, `intel_de.h`, `intel_display_regs.h`.
- Detected declarations: `function files`, `function lspcon_detect_vendor`, `function get_hdr_status_reg`, `function intel_lspcon_detect_hdr_capability`, `function lspcon_get_current_mode`, `function lspcon_get_mode_settle_timeout`, `function lspcon_wait_mode`, `function lspcon_change_mode`, `function lspcon_wake_native_aux_ch`, `function lspcon_probe`.
- 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.