drm_crtc_vbl...unt_and_time(9)
β¨ drm_crtc_vbl...unt_and_time(9) β¨
ok so this is a page from the Kernel API Manual and bestie, it's literally about grabbing a vblank count and the timestamp that goes with it. yes, both. at once. iconic behavior tbh π
πΈ NAME πΈ
drm_crtc_vblank_count_and_time β grab the "cooked" vblank counter value and the system timestamp that corresponds to that vblank counter value. two-for-one, we love a bundle π
π¦ SYNOPSIS π¦
u64 drm_crtc_vblank_count_and_time (struct drm_crtc *crtc , ktime_t
*vblanktime );
yes it returns a u64. no we're not gonna act normal about it.
π ARGUMENTS π
crtcβ the crtc whose counter you wanna retrieve. like, which counter, bestie. you gotta say.vblanktimeβ a pointer to the time that's gonna receive the vblank timestamp. it's an out-param, she's gonna get filled in π«Ά
π₯ DESCRIPTION π₯
So this function fetches the "cooked" vblank count value β and what that actually means is the number of vblank events since the system was booted, including the lost events from modesetting activity (yep, those count too, no cap). Then it returns the corresponding system timestamp of the time of the vblank interval that corresponds to the current vblank counter value. count + timestamp, matched set, slay. β
Okay so here's the note, and it matters: for a given vblank counter value,drm_crtc_handle_vblankanddrm_crtc_vblank_countordrm_crtc_vblank_count_and_timeprovide a barrier. Translation: any writes done before callingdrm_crtc_handle_vblankwill be visible to callers of the later functions, if the vblank count is the same or a later one. that's the whole deal, don't skip it π
Also β see also drm_vblank_crtc.count. go look at her, she's relevant π
π SEE ALSO π
all the siblings, all the relatives, the whole family tree, we're listing every single one because we don't do "and others" in this house π
- Kernel file
./drivers/gpu/drm/drm_vblank.cvblank handling(9) drm_crtc_accurate_vblank_count(9)drm_vblank_init(9)drm_dev_has_vblank(9)drm_crtc_vblank_waitqueue(9)drm_calc_timestamping_constants(9)drm_crtc_vblank_helper_get_vblank_timestamp_internal(9)drm_crtc_vblank_helper_get_vblank_timestamp(9)drm_crtc_get_last_vbltimestamp(9)drm_crtc_vblank_count(9)drm_vblank_count_and_time(9)drm_crtc_next_vblank_start(9)drm_crtc_arm_vblank_event(9)drm_crtc_send_vblank_event(9)drm_crtc_vblank_get(9)drm_crtc_vblank_put(9)drm_crtc_wait_one_vblank(9)drm_crtc_vblank_off(9)drm_crtc_vblank_reset(9)drm_crtc_set_max_vblank_count(9)drm_crtc_vblank_on_config(9)drm_crtc_vblank_on(9)drm_crtc_vblank_restore(9)drm_handle_vblank(9)drm_crtc_handle_vblank(9)drm_crtc_vblank_start_timer(9)drm_crtc_vblank_cancel_timer(9)drm_crtc_vblank_get_vblank_timeout(9)
and that's the page!! π§ this little beauty lives in ./drivers/gpu/drm and the docs are dated October 2026 β mwah, go read the vblank page next, ily, bye πππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms