drivers/gpu/drm/sun4i/sun4i_crtc.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/sun4i/sun4i_crtc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/sun4i/sun4i_crtc.c- Extension
.c- Size
- 6886 bytes
- Lines
- 257
- 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/clk-provider.hlinux/ioport.hlinux/of_address.hlinux/of_graph.hlinux/of_irq.hlinux/regmap.hvideo/videomode.hdrm/drm_atomic.hdrm/drm_atomic_helper.hdrm/drm_crtc.hdrm/drm_modes.hdrm/drm_print.hdrm/drm_probe_helper.hdrm/drm_vblank.hsun4i_backend.hsun4i_crtc.hsun4i_drv.hsunxi_engine.hsun4i_tcon.h
Detected Declarations
function Copyrightfunction sun4i_crtc_atomic_checkfunction sun4i_crtc_atomic_beginfunction sun4i_crtc_atomic_flushfunction sun4i_crtc_atomic_disablefunction sun4i_crtc_atomic_enablefunction sun4i_crtc_mode_set_nofbfunction sun4i_crtc_enable_vblankfunction sun4i_crtc_disable_vblank
Annotated Snippet
switch (plane->type) {
case DRM_PLANE_TYPE_PRIMARY:
primary = plane;
break;
case DRM_PLANE_TYPE_CURSOR:
cursor = plane;
break;
default:
break;
}
}
ret = drm_crtc_init_with_planes(drm, &scrtc->crtc,
primary,
cursor,
&sun4i_crtc_funcs,
NULL);
if (ret) {
dev_err(drm->dev, "Couldn't init DRM CRTC\n");
return ERR_PTR(ret);
}
drm_crtc_helper_add(&scrtc->crtc, &sun4i_crtc_helper_funcs);
/* Set crtc.port to output port node of the tcon */
scrtc->crtc.port = of_graph_get_port_by_id(scrtc->tcon->dev->of_node,
1);
/* Set possible_crtcs to this crtc for overlay planes */
for (i = 0; planes[i]; i++) {
uint32_t possible_crtcs = drm_crtc_mask(&scrtc->crtc);
struct drm_plane *plane = planes[i];
if (plane->type == DRM_PLANE_TYPE_OVERLAY)
plane->possible_crtcs = possible_crtcs;
}
return scrtc;
}
Annotation
- Immediate include surface: `linux/clk-provider.h`, `linux/ioport.h`, `linux/of_address.h`, `linux/of_graph.h`, `linux/of_irq.h`, `linux/regmap.h`, `video/videomode.h`, `drm/drm_atomic.h`.
- Detected declarations: `function Copyright`, `function sun4i_crtc_atomic_check`, `function sun4i_crtc_atomic_begin`, `function sun4i_crtc_atomic_flush`, `function sun4i_crtc_atomic_disable`, `function sun4i_crtc_atomic_enable`, `function sun4i_crtc_mode_set_nofb`, `function sun4i_crtc_enable_vblank`, `function sun4i_crtc_disable_vblank`.
- 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.