drivers/gpu/drm/msm/msm_atomic.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/msm/msm_atomic.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/msm/msm_atomic.c- Extension
.c- Size
- 8073 bytes
- Lines
- 325
- 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
drm/drm_atomic_uapi.hdrm/drm_vblank.hmsm_atomic_trace.hmsm_drv.hmsm_gem.hmsm_kms.h
Detected Declarations
function Copyrightfunction for_each_crtc_maskfunction vblank_putfunction for_each_crtc_maskfunction lock_crtcsfunction for_each_crtc_maskfunction unlock_crtcsfunction msm_atomic_async_commitfunction msm_atomic_pending_workfunction msm_atomic_init_pending_timerfunction msm_atomic_destroy_pending_timerfunction can_do_asyncfunction for_each_new_crtc_in_statefunction for_each_crtc_maskfunction msm_atomic_checkfunction msm_atomic_commit_tail
Annotated Snippet
if (!(kms->pending_crtc_mask & crtc_mask)) {
ktime_t vsync_time, wakeup_time;
kms->pending_crtc_mask |= crtc_mask;
if (drm_crtc_next_vblank_start(async_crtc, &vsync_time))
goto fallback;
wakeup_time = ktime_sub(vsync_time, ms_to_ktime(1));
msm_hrtimer_queue_work(&timer->work, wakeup_time,
HRTIMER_MODE_ABS);
}
kms->funcs->disable_commit(kms);
unlock_crtcs(kms, crtc_mask);
/*
* At this point, from drm core's perspective, we
* are done with the atomic update, so we can just
* go ahead and signal that it is done:
*/
drm_atomic_helper_commit_hw_done(state);
drm_atomic_helper_cleanup_planes(dev, state);
trace_msm_atomic_commit_tail_finish(async, crtc_mask);
return;
}
fallback:
/*
* If there is any async flush pending on updated crtcs, fold
* them into the current flush.
*/
kms->pending_crtc_mask &= ~crtc_mask;
vblank_get(kms, crtc_mask);
/*
* Flush hardware updates:
*/
trace_msm_atomic_flush_commit(crtc_mask);
kms->funcs->flush_commit(kms, crtc_mask);
unlock_crtcs(kms, crtc_mask);
/*
* Wait for flush to complete:
*/
trace_msm_atomic_wait_flush_start(crtc_mask);
kms->funcs->wait_flush(kms, crtc_mask);
trace_msm_atomic_wait_flush_finish(crtc_mask);
vblank_put(kms, crtc_mask);
lock_crtcs(kms, crtc_mask);
kms->funcs->complete_commit(kms, crtc_mask);
unlock_crtcs(kms, crtc_mask);
kms->funcs->disable_commit(kms);
drm_atomic_helper_commit_hw_done(state);
drm_atomic_helper_cleanup_planes(dev, state);
trace_msm_atomic_commit_tail_finish(async, crtc_mask);
}
Annotation
- Immediate include surface: `drm/drm_atomic_uapi.h`, `drm/drm_vblank.h`, `msm_atomic_trace.h`, `msm_drv.h`, `msm_gem.h`, `msm_kms.h`.
- Detected declarations: `function Copyright`, `function for_each_crtc_mask`, `function vblank_put`, `function for_each_crtc_mask`, `function lock_crtcs`, `function for_each_crtc_mask`, `function unlock_crtcs`, `function msm_atomic_async_commit`, `function msm_atomic_pending_work`, `function msm_atomic_init_pending_timer`.
- 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.