drm_crtc_se...vblank_count(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… drm_crtc_set_max_vblank_count(9) πŸ’…

okay so bestie, this is a page straight out of the Kernel API Manual β€” yes, the big serious one β€” and today's main character is drm_crtc_set_max_vblank_count. it's giving "small function, very specific job" and honestly? iconic. πŸŽ€


✨ NAME ✨

drm_crtc_set_max_vblank_count β€” configure the hw max vblank counter value πŸ¦‹


🌸 SYNOPSIS 🌸

void drm_crtc_set_max_vblank_count (struct drm_crtc *crtc , u32
       max_vblank_count );

lowkey just two args, no drama, no return value. we love a void function that minds its own business. πŸ’œ


🫢 ARGUMENTS 🫢

  • crtc β€” the CRTC in question. like, which one are we talking about, bestie? this one. πŸ‘‘
  • max_vblank_count β€” the max hardware vblank counter value. that's the number. that's the whole vibe. ⭐

πŸ”₯ DESCRIPTION πŸ”₯

So here's the tea: this function updates the maximum hardware vblank counter value for crtc at runtime. runtime, bestie β€” not at init, not at probe, at runtime. πŸ™ˆ

It's useful for hardware where how the hardware vblank counter behaves depends on which display configuration is currently active. like, the counter's whole personality changes depending on what's plugged in and turned on. 😭

For example β€” and this is the example, fr fr β€” if the hardware vblank counter does not work when a specific connector is active, the maximum can be set to zero. and when that specific connector isn't active, the maximum can again be set to the appropriate non-zero value. zero when it's broken, non-zero when it's fine, everyone slays in their own lane. ✨

🚨 important, no cap: if you use this, it must be called before drm_vblank_on. that's not a suggestion, that's the law. πŸ’€

🌈 SEE ALSO 🌈

the whole friend group, in order, exactly as listed, no one left behind 🫢:

Kernel file ./drivers/gpu/drm/drm_vblank.c, vblank 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_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, bestie πŸ’– that's it, that's the whole thing β€” short, sweet, and aggressively specific about when you're allowed to call it.

mwah πŸ’…

β€” xoxo, your girl, coming to you from ./drivers/gpu/drm, dated October 2026 πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from