drm_crtc_vblank_restore(9)
π drm_crtc_vblank_restore(9) β Kernel API Manual, bestie β¨
Okay so real talk, we're in the Kernel API Manual today and the star of the show is drm_crtc_vblank_restore(9). Yes the page header literally says drm_crtc_vblank_restore(9) twice, we love a self-referential queen. π
β¨ NAME β¨
drm_crtc_vblank_restore β literally just estimate the vblanks you missed and update the vblank count. That's it. That's the whole vibe. π¦
πΈ SYNOPSIS πΈ
void drm_crtc_vblank_restore (struct drm_crtc *crtc );
No return value, it just does the thing. Periodt. π
π ARGUMENTS π
crtcβ the CRTC in question. Like, the CRTC. The one we're talking about. π
π§ DESCRIPTION π§
So here's the tea: power management features can cause the frame counter to reset between vblank disable and enable. Rude, honestly. π
Drivers can use this function inside their drm_crtc_funcs.enable_vblank implementation to estimate how many vblanks got missed since the last drm_crtc_funcs.disable_vblank, using timestamps, and then update the vblank counter. Iconic recovery arc fr fr. β¨
β οΈ Okay this part matters so listen up π β drivers must have race-free high-precision timestamping support. That meansdrm_crtc_funcs.get_vblank_timestamphas to be hooked up, anddrm_vblank_crtc_config.disable_immediatemust be set, to indicate that the time-stamping functions are race-free against vblank hardware counter increments. No cap, if that's not set up you're gonna have a bad time. π
π₯ SEE ALSO π₯
Everything is connected, bestie, this is the whole friend group π«Ά:
- 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_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_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)
Okay that's the whole page, mwah π β brought to you by the source at ./drivers/gpu/drm, version October 2026, and yeah the footer really does say drm_crtc_vblank_restore(9) again because the branding is consistent and we respect it. Stay timestamped, stay race-free, ily! ππ
π¦ 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