drivers/gpu/drm/imx/dc/dc-crtc.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/imx/dc/dc-crtc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/imx/dc/dc-crtc.c- Extension
.c- Size
- 14406 bytes
- Lines
- 550
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/completion.hlinux/container_of.hlinux/interrupt.hlinux/irqreturn.hlinux/pm_runtime.hlinux/spinlock.hdrm/drm_atomic.hdrm/drm_atomic_helper.hdrm/drm_atomic_state_helper.hdrm/drm_crtc.hdrm/drm_device.hdrm/drm_drv.hdrm/drm_modes.hdrm/drm_modeset_helper_vtables.hdrm/drm_plane.hdrm/drm_print.hdrm/drm_vblank.hdc-de.hdc-drv.hdc-kms.hdc-pe.h
Detected Declarations
function dc_crtc_get_vblank_counterfunction dc_crtc_enable_vblankfunction dc_crtc_disable_vblankfunction dc_crtc_queue_state_eventfunction dc_crtc_check_clockfunction dc_crtc_mode_validfunction dc_crtc_atomic_checkfunction dc_crtc_atomic_beginfunction dc_crtc_atomic_flushfunction dc_crtc_atomic_enablefunction dc_crtc_atomic_disablefunction dc_crtc_get_scanout_positionfunction dc_crtc_irq_handler_dec_framecompletefunction dc_crtc_irq_handler_dec_seqcomplete_donefunction dc_crtc_irq_handler_dec_shdload_donefunction dc_crtc_irq_handler_ed_cont_shdload_donefunction dc_crtc_irq_handler_ed_safe_shdload_donefunction dc_crtc_request_irqsfunction dc_crtc_initfunction dc_crtc_post_init
Annotated Snippet
if (ret) {
dev_err(irqs[i].dev, "failed to request irq(%u): %d\n",
irqs[i].irq, ret);
return ret;
}
irq->dc_crtc = dc_crtc;
irq->irq = irqs[i].irq;
}
return 0;
}
int dc_crtc_init(struct dc_drm_device *dc_drm, int crtc_index)
{
struct dc_crtc *dc_crtc = &dc_drm->dc_crtc[crtc_index];
struct drm_device *drm = &dc_drm->base;
struct dc_de *de = dc_drm->de[crtc_index];
struct dc_pe *pe = dc_drm->pe;
struct dc_plane *dc_primary;
int ret;
dc_crtc->de = de;
init_completion(&dc_crtc->dec_seqcomplete_done);
init_completion(&dc_crtc->dec_shdload_done);
init_completion(&dc_crtc->ed_cont_shdload_done);
init_completion(&dc_crtc->ed_safe_shdload_done);
dc_crtc->cf_cont = pe->cf_cont[crtc_index];
dc_crtc->cf_safe = pe->cf_safe[crtc_index];
dc_crtc->ed_cont = pe->ed_cont[crtc_index];
dc_crtc->ed_safe = pe->ed_safe[crtc_index];
dc_crtc->fg = de->fg;
dc_crtc->irq_dec_framecomplete = de->irq_framecomplete;
dc_crtc->irq_dec_seqcomplete = de->irq_seqcomplete;
dc_crtc->irq_dec_shdload = de->irq_shdload;
dc_crtc->irq_ed_safe_shdload = dc_crtc->ed_safe->irq_shdload;
dc_crtc->irq_ed_cont_shdload = dc_crtc->ed_cont->irq_shdload;
dc_primary = &dc_drm->dc_primary[crtc_index];
ret = dc_plane_init(dc_drm, dc_primary);
if (ret) {
dev_err(de->dev, "failed to initialize primary plane: %d\n",
ret);
return ret;
}
drm_crtc_helper_add(&dc_crtc->base, &dc_helper_funcs);
ret = drm_crtc_init_with_planes(drm, &dc_crtc->base, &dc_primary->base,
NULL, &dc_crtc_funcs, NULL);
if (ret)
dev_err(de->dev, "failed to add CRTC: %d\n", ret);
return ret;
}
int dc_crtc_post_init(struct dc_drm_device *dc_drm, int crtc_index)
{
struct dc_crtc *dc_crtc = &dc_drm->dc_crtc[crtc_index];
struct drm_device *drm = &dc_drm->base;
return dc_crtc_request_irqs(drm, dc_crtc);
}
Annotation
- Immediate include surface: `linux/completion.h`, `linux/container_of.h`, `linux/interrupt.h`, `linux/irqreturn.h`, `linux/pm_runtime.h`, `linux/spinlock.h`, `drm/drm_atomic.h`, `drm/drm_atomic_helper.h`.
- Detected declarations: `function dc_crtc_get_vblank_counter`, `function dc_crtc_enable_vblank`, `function dc_crtc_disable_vblank`, `function dc_crtc_queue_state_event`, `function dc_crtc_check_clock`, `function dc_crtc_mode_valid`, `function dc_crtc_atomic_check`, `function dc_crtc_atomic_begin`, `function dc_crtc_atomic_flush`, `function dc_crtc_atomic_enable`.
- 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.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.