drivers/gpu/drm/i915/display/intel_pipe_crc.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_pipe_crc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_pipe_crc.c- Extension
.c- Size
- 17694 bytes
- Lines
- 672
- 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/ctype.hlinux/debugfs.hlinux/seq_file.hdrm/drm_print.hintel_atomic.hintel_de.hintel_display_irq.hintel_display_regs.hintel_display_types.hintel_parent.hintel_pipe_crc.hintel_pipe_crc_regs.h
Detected Declarations
function i8xx_pipe_crc_ctl_regfunction i9xx_pipe_crc_auto_sourcefunction vlv_pipe_crc_ctl_regfunction framefunction i9xx_pipe_crc_ctl_regfunction vlv_undo_pipe_scramble_resetfunction ilk_pipe_crc_ctl_regfunction intel_crtc_crc_setup_workaroundsfunction ivb_pipe_crc_ctl_regfunction skl_pipe_crc_ctl_regfunction get_new_crc_ctl_regfunction display_crc_ctl_parse_sourcefunction intel_crtc_crc_initfunction i8xx_crc_source_validfunction i9xx_crc_source_validfunction vlv_crc_source_validfunction ilk_crc_source_validfunction ivb_crc_source_validfunction skl_crc_source_validfunction intel_is_valid_crc_sourcefunction intel_crtc_verify_crc_sourcefunction intel_crtc_set_crc_sourcefunction intel_crtc_enable_pipe_crcfunction intel_crtc_disable_pipe_crc
Annotated Snippet
switch (encoder->type) {
case INTEL_OUTPUT_TVOUT:
*source = INTEL_PIPE_CRC_SOURCE_TV;
break;
case INTEL_OUTPUT_DP:
case INTEL_OUTPUT_EDP:
dig_port = enc_to_dig_port(encoder);
switch (dig_port->base.port) {
case PORT_B:
*source = INTEL_PIPE_CRC_SOURCE_DP_B;
break;
case PORT_C:
*source = INTEL_PIPE_CRC_SOURCE_DP_C;
break;
case PORT_D:
*source = INTEL_PIPE_CRC_SOURCE_DP_D;
break;
default:
drm_WARN(display->drm, 1, "nonexisting DP port %c\n",
port_name(dig_port->base.port));
break;
}
break;
default:
break;
}
}
drm_modeset_unlock_all(display->drm);
}
static int vlv_pipe_crc_ctl_reg(struct intel_display *display,
enum pipe pipe,
enum intel_pipe_crc_source *source,
u32 *val)
{
bool need_stable_symbols = false;
if (*source == INTEL_PIPE_CRC_SOURCE_AUTO)
i9xx_pipe_crc_auto_source(display, pipe, source);
switch (*source) {
case INTEL_PIPE_CRC_SOURCE_PIPE:
*val = PIPE_CRC_ENABLE | PIPE_CRC_SOURCE_PIPE_VLV;
break;
case INTEL_PIPE_CRC_SOURCE_DP_B:
*val = PIPE_CRC_ENABLE | PIPE_CRC_SOURCE_DP_B_VLV;
need_stable_symbols = true;
break;
case INTEL_PIPE_CRC_SOURCE_DP_C:
*val = PIPE_CRC_ENABLE | PIPE_CRC_SOURCE_DP_C_VLV;
need_stable_symbols = true;
break;
case INTEL_PIPE_CRC_SOURCE_DP_D:
if (!display->platform.cherryview)
return -EINVAL;
*val = PIPE_CRC_ENABLE | PIPE_CRC_SOURCE_DP_D_VLV;
need_stable_symbols = true;
break;
case INTEL_PIPE_CRC_SOURCE_NONE:
*val = 0;
break;
default:
return -EINVAL;
}
/*
* When the pipe CRC tap point is after the transcoders we need
* to tweak symbol-level features to produce a deterministic series of
* symbols for a given frame. We need to reset those features only once
* a frame (instead of every nth symbol):
* - DC-balance: used to ensure a better clock recovery from the data
* link (SDVO)
* - DisplayPort scrambling: used for EMI reduction
*/
if (need_stable_symbols) {
u32 tmp = intel_de_read(display, PORT_DFT2_G4X(display));
tmp |= DC_BALANCE_RESET_VLV;
switch (pipe) {
case PIPE_A:
tmp |= PIPE_A_SCRAMBLE_RESET;
break;
case PIPE_B:
tmp |= PIPE_B_SCRAMBLE_RESET;
break;
case PIPE_C:
tmp |= PIPE_C_SCRAMBLE_RESET;
break;
default:
return -EINVAL;
Annotation
- Immediate include surface: `linux/ctype.h`, `linux/debugfs.h`, `linux/seq_file.h`, `drm/drm_print.h`, `intel_atomic.h`, `intel_de.h`, `intel_display_irq.h`, `intel_display_regs.h`.
- Detected declarations: `function i8xx_pipe_crc_ctl_reg`, `function i9xx_pipe_crc_auto_source`, `function vlv_pipe_crc_ctl_reg`, `function frame`, `function i9xx_pipe_crc_ctl_reg`, `function vlv_undo_pipe_scramble_reset`, `function ilk_pipe_crc_ctl_reg`, `function intel_crtc_crc_setup_workarounds`, `function ivb_pipe_crc_ctl_reg`, `function skl_pipe_crc_ctl_reg`.
- 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.