drivers/gpu/drm/sti/sti_crtc.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/sti/sti_crtc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/sti/sti_crtc.c- Extension
.c- Size
- 9446 bytes
- Lines
- 369
- 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/clk.hdrm/drm_atomic.hdrm/drm_atomic_helper.hdrm/drm_device.hdrm/drm_print.hdrm/drm_probe_helper.hdrm/drm_vblank.hsti_compositor.hsti_crtc.hsti_drv.hsti_vid.hsti_vtg.h
Detected Declarations
function Copyrightfunction sti_crtc_atomic_disablefunction sti_crtc_mode_setfunction sti_crtc_disablefunction sti_crtc_mode_set_nofbfunction sti_crtc_atomic_flushfunction sti_crtc_destroyfunction sti_crtc_set_propertyfunction sti_crtc_vblank_cbfunction list_for_each_entryfunction sti_crtc_enable_vblankfunction sti_crtc_disable_vblankfunction sti_crtc_late_registerfunction sti_crtc_is_mainfunction sti_crtc_init
Annotated Snippet
switch (plane->status) {
case STI_PLANE_UPDATED:
/* ignore update for other CRTC */
if (p->state->crtc != crtc)
continue;
/* update planes tag as updated */
DRM_DEBUG_DRIVER("update plane %s\n",
sti_plane_to_str(plane));
if (sti_mixer_set_plane_depth(mixer, plane)) {
DRM_ERROR("Cannot set plane %s depth\n",
sti_plane_to_str(plane));
break;
}
if (sti_mixer_set_plane_status(mixer, plane, true)) {
DRM_ERROR("Cannot enable plane %s at mixer\n",
sti_plane_to_str(plane));
break;
}
/* if plane is HQVDP_0 then commit the vid[0] */
if (plane->desc == STI_HQVDP_0)
sti_vid_commit(compo->vid[0], p->state);
plane->status = STI_PLANE_READY;
break;
case STI_PLANE_DISABLING:
/* disabling sequence for planes tag as disabling */
DRM_DEBUG_DRIVER("disable plane %s from mixer\n",
sti_plane_to_str(plane));
if (sti_mixer_set_plane_status(mixer, plane, false)) {
DRM_ERROR("Cannot disable plane %s at mixer\n",
sti_plane_to_str(plane));
continue;
}
if (plane->desc == STI_CURSOR)
/* tag plane status for disabled */
plane->status = STI_PLANE_DISABLED;
else
/* tag plane status for flushing */
plane->status = STI_PLANE_FLUSHING;
/* if plane is HQVDP_0 then disable the vid[0] */
if (plane->desc == STI_HQVDP_0)
sti_vid_disable(compo->vid[0]);
break;
default:
/* Other status case are not handled */
break;
}
}
event = crtc->state->event;
if (event) {
crtc->state->event = NULL;
spin_lock_irqsave(&crtc->dev->event_lock, flags);
if (drm_crtc_vblank_get(crtc) == 0)
drm_crtc_arm_vblank_event(crtc, event);
else
drm_crtc_send_vblank_event(crtc, event);
spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
}
}
static const struct drm_crtc_helper_funcs sti_crtc_helper_funcs = {
.mode_set_nofb = sti_crtc_mode_set_nofb,
.atomic_flush = sti_crtc_atomic_flush,
.atomic_enable = sti_crtc_atomic_enable,
.atomic_disable = sti_crtc_atomic_disable,
};
static void sti_crtc_destroy(struct drm_crtc *crtc)
{
DRM_DEBUG_KMS("\n");
drm_crtc_cleanup(crtc);
}
static int sti_crtc_set_property(struct drm_crtc *crtc,
struct drm_property *property,
uint64_t val)
{
DRM_DEBUG_KMS("\n");
return 0;
Annotation
- Immediate include surface: `linux/clk.h`, `drm/drm_atomic.h`, `drm/drm_atomic_helper.h`, `drm/drm_device.h`, `drm/drm_print.h`, `drm/drm_probe_helper.h`, `drm/drm_vblank.h`, `sti_compositor.h`.
- Detected declarations: `function Copyright`, `function sti_crtc_atomic_disable`, `function sti_crtc_mode_set`, `function sti_crtc_disable`, `function sti_crtc_mode_set_nofb`, `function sti_crtc_atomic_flush`, `function sti_crtc_destroy`, `function sti_crtc_set_property`, `function sti_crtc_vblank_cb`, `function list_for_each_entry`.
- 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.