drivers/gpu/drm/tidss/tidss_crtc.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/tidss/tidss_crtc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/tidss/tidss_crtc.c- Extension
.c- Size
- 12301 bytes
- Lines
- 460
- 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
drm/drm_atomic.hdrm/drm_atomic_helper.hdrm/drm_crtc.hdrm/drm_gem_dma_helper.hdrm/drm_print.hdrm/drm_vblank.htidss_crtc.htidss_dispc.htidss_drv.htidss_irq.htidss_plane.h
Detected Declarations
function Copyrightfunction tidss_crtc_vblank_irqfunction tidss_crtc_framedone_irqfunction tidss_crtc_error_irqfunction tidss_crtc_atomic_checkfunction tidss_atomic_checkfunction for_each_new_plane_in_statefunction tidss_crtc_atomic_flushfunction tidss_crtc_atomic_enablefunction tidss_crtc_atomic_disablefunction tidss_crtc_mode_validfunction tidss_crtc_enable_vblankfunction tidss_crtc_disable_vblankfunction tidss_crtc_destroy_statefunction tidss_crtc_resetfunction tidss_crtc_destroy
Annotated Snippet
for_each_new_plane_in_state(ostate, plane, pstate, i) {
if (pstate->crtc != crtc || !pstate->visible)
continue;
if (pstate->normalized_zpos == layer) {
layer_active = true;
break;
}
}
if (layer_active) {
struct tidss_plane *tplane = to_tidss_plane(plane);
dispc_ovr_set_plane(tidss->dispc, tplane->hw_plane_id,
tcrtc->hw_videoport,
pstate->crtc_x, pstate->crtc_y,
layer);
}
dispc_ovr_enable_layer(tidss->dispc, tcrtc->hw_videoport, layer,
layer_active);
}
}
static void tidss_crtc_atomic_flush(struct drm_crtc *crtc,
struct drm_atomic_commit *state)
{
struct drm_crtc_state *old_crtc_state = drm_atomic_get_old_crtc_state(state,
crtc);
struct tidss_crtc *tcrtc = to_tidss_crtc(crtc);
struct drm_device *ddev = crtc->dev;
struct tidss_device *tidss = to_tidss(ddev);
unsigned long flags;
drm_dbg(ddev, "%s: %s is %sactive, %s modeset, event %p\n",
__func__, crtc->name, crtc->state->active ? "" : "not ",
drm_atomic_crtc_needs_modeset(crtc->state) ? "needs" : "doesn't need",
crtc->state->event);
/*
* Flush CRTC changes with go bit only if new modeset is not
* coming, so CRTC is enabled trough out the commit.
*/
if (drm_atomic_crtc_needs_modeset(crtc->state))
return;
/* If the GO bit is stuck we better quit here. */
if (WARN_ON(dispc_vp_go_busy(tidss->dispc, tcrtc->hw_videoport)))
return;
/* We should have event if CRTC is enabled through out this commit. */
if (WARN_ON(!crtc->state->event))
return;
/* Write vp properties to HW if needed. */
dispc_vp_setup(tidss->dispc, tcrtc->hw_videoport, crtc->state, false);
/* Update plane positions if needed. */
tidss_crtc_position_planes(tidss, crtc, old_crtc_state, false);
WARN_ON(drm_crtc_vblank_get(crtc) != 0);
spin_lock_irqsave(&ddev->event_lock, flags);
dispc_vp_go(tidss->dispc, tcrtc->hw_videoport);
WARN_ON(tcrtc->event);
tcrtc->event = crtc->state->event;
crtc->state->event = NULL;
spin_unlock_irqrestore(&ddev->event_lock, flags);
}
static void tidss_crtc_atomic_enable(struct drm_crtc *crtc,
struct drm_atomic_commit *state)
{
struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state,
crtc);
struct tidss_crtc *tcrtc = to_tidss_crtc(crtc);
struct drm_device *ddev = crtc->dev;
struct tidss_device *tidss = to_tidss(ddev);
const struct drm_display_mode *mode = &crtc->state->adjusted_mode;
unsigned long flags;
int r;
dev_dbg(ddev->dev, "%s, event %p\n", __func__, crtc->state->event);
tidss_runtime_get(tidss);
r = dispc_vp_set_clk_rate(tidss->dispc, tcrtc->hw_videoport,
mode->crtc_clock * 1000);
Annotation
- Immediate include surface: `drm/drm_atomic.h`, `drm/drm_atomic_helper.h`, `drm/drm_crtc.h`, `drm/drm_gem_dma_helper.h`, `drm/drm_print.h`, `drm/drm_vblank.h`, `tidss_crtc.h`, `tidss_dispc.h`.
- Detected declarations: `function Copyright`, `function tidss_crtc_vblank_irq`, `function tidss_crtc_framedone_irq`, `function tidss_crtc_error_irq`, `function tidss_crtc_atomic_check`, `function tidss_atomic_check`, `function for_each_new_plane_in_state`, `function tidss_crtc_atomic_flush`, `function tidss_crtc_atomic_enable`, `function tidss_crtc_atomic_disable`.
- 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.