drivers/gpu/drm/i915/display/intel_crtc.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_crtc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_crtc.c- Extension
.c- Size
- 25551 bytes
- Lines
- 905
- 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/kernel.hlinux/pm_qos.hlinux/slab.hdrm/drm_atomic_helper.hdrm/drm_blend.hdrm/drm_fourcc.hdrm/drm_plane.hdrm/drm_print.hdrm/drm_vblank.hdrm/drm_vblank_work.hi9xx_plane.hicl_dsi.hintel_atomic.hintel_color.hintel_crtc.hintel_cursor.hintel_display_debugfs.hintel_display_irq.hintel_display_trace.hintel_display_types.hintel_drrs.hintel_dsi.hintel_fifo_underrun.hintel_parent.hintel_pipe_crc.hintel_plane.hintel_psr.hintel_sprite.hintel_vblank.hintel_vrr.hskl_universal_plane.h
Detected Declarations
function assert_vblank_disabledfunction for_each_intel_crtcfunction intel_crtc_wait_for_next_vblankfunction intel_wait_for_vblank_if_activefunction intel_crtc_get_vblank_counterfunction intel_crtc_max_vblank_countfunction intel_crtc_vblank_onfunction intel_crtc_vblank_offfunction intel_crtc_state_resetfunction intel_crtc_freefunction intel_crtc_destroyfunction intel_crtc_late_registerfunction add_crtc_to_pipe_listfunction list_for_each_entryfunction __intel_crtc_initfunction for_each_spritefunction reorder_pipefunction intel_crtc_initfunction for_each_pipefunction intel_crtc_get_pipe_from_crtc_id_ioctlfunction intel_crtc_needs_vblank_workfunction intel_crtc_vblank_workfunction intel_crtc_vblank_work_initfunction intel_wait_for_vblank_workersfunction for_each_new_intel_crtc_in_statefunction intel_usecs_to_scanlinesfunction intel_scanlines_to_usecsfunction intel_pipe_update_startfunction for_each_oldnew_intel_plane_in_statefunction dbg_vblank_evadefunction dbg_vblank_evadefunction intel_crtc_prepare_vblank_eventfunction intel_pipe_update_endfunction for_each_old_intel_plane_in_statefunction intel_crtc_enable_changedfunction intel_any_crtc_enable_changedfunction for_each_oldnew_intel_crtc_in_statefunction intel_crtc_active_changedfunction intel_any_crtc_active_changedfunction for_each_oldnew_intel_crtc_in_statefunction intel_crtc_bw_num_active_planesfunction intel_crtc_bw_data_ratefunction for_each_plane_id_on_crtcfunction intel_crtc_bw_min_cdclk
Annotated Snippet
if (crtc->pipe < iter->pipe) {
list_add_tail(&crtc->pipe_head, &iter->pipe_head);
return;
}
}
list_add_tail(&crtc->pipe_head, &display->pipe_list);
}
static int __intel_crtc_init(struct intel_display *display, enum pipe pipe)
{
struct intel_plane *primary, *cursor;
const struct drm_crtc_funcs *funcs;
struct intel_crtc *crtc;
int sprite, ret;
crtc = intel_crtc_alloc();
if (IS_ERR(crtc))
return PTR_ERR(crtc);
crtc->pipe = pipe;
crtc->num_scalers = DISPLAY_RUNTIME_INFO(display)->num_scalers[pipe];
if (DISPLAY_VER(display) >= 9)
primary = skl_universal_plane_create(display, pipe, PLANE_1);
else
primary = intel_primary_plane_create(display, pipe);
if (IS_ERR(primary)) {
ret = PTR_ERR(primary);
goto fail;
}
crtc->plane_ids_mask |= BIT(primary->id);
intel_init_fifo_underrun_reporting(display, crtc, false);
for_each_sprite(display, pipe, sprite) {
struct intel_plane *plane;
if (DISPLAY_VER(display) >= 9)
plane = skl_universal_plane_create(display, pipe, PLANE_2 + sprite);
else
plane = intel_sprite_plane_create(display, pipe, sprite);
if (IS_ERR(plane)) {
ret = PTR_ERR(plane);
goto fail;
}
crtc->plane_ids_mask |= BIT(plane->id);
}
cursor = intel_cursor_plane_create(display, pipe);
if (IS_ERR(cursor)) {
ret = PTR_ERR(cursor);
goto fail;
}
crtc->plane_ids_mask |= BIT(cursor->id);
if (HAS_GMCH(display)) {
if (display->platform.cherryview ||
display->platform.valleyview ||
display->platform.g4x)
funcs = &g4x_crtc_funcs;
else if (DISPLAY_VER(display) == 4)
funcs = &i965_crtc_funcs;
else if (display->platform.i945gm ||
display->platform.i915gm)
funcs = &i915gm_crtc_funcs;
else if (DISPLAY_VER(display) == 3)
funcs = &i915_crtc_funcs;
else
funcs = &i8xx_crtc_funcs;
} else {
if (DISPLAY_VER(display) >= 8)
funcs = &bdw_crtc_funcs;
else
funcs = &ilk_crtc_funcs;
}
ret = drm_crtc_init_with_planes(display->drm, &crtc->base,
&primary->base, &cursor->base,
funcs, "pipe %c", pipe_name(pipe));
if (ret)
goto fail;
if (DISPLAY_VER(display) >= 11)
drm_crtc_create_scaling_filter_property(&crtc->base,
BIT(DRM_SCALING_FILTER_DEFAULT) |
BIT(DRM_SCALING_FILTER_NEAREST_NEIGHBOR));
if (DISPLAY_VER(display) >= 9)
drm_crtc_attach_background_color_property(&crtc->base);
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/pm_qos.h`, `linux/slab.h`, `drm/drm_atomic_helper.h`, `drm/drm_blend.h`, `drm/drm_fourcc.h`, `drm/drm_plane.h`, `drm/drm_print.h`.
- Detected declarations: `function assert_vblank_disabled`, `function for_each_intel_crtc`, `function intel_crtc_wait_for_next_vblank`, `function intel_wait_for_vblank_if_active`, `function intel_crtc_get_vblank_counter`, `function intel_crtc_max_vblank_count`, `function intel_crtc_vblank_on`, `function intel_crtc_vblank_off`, `function intel_crtc_state_reset`, `function intel_crtc_free`.
- 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.