drm_crtc_vbl...unt_and_time(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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_vblank and drm_crtc_vblank_count or drm_crtc_vblank_count_and_time provide a barrier. Translation: any writes done before calling drm_crtc_handle_vblank will 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 πŸ’œ


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