drm_crtc_vbl...amp_internal(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay so this page lives in the Kernel API Manual under the truncated page name drm_crtc_vbl...amp_internal(9) β€” yes, the header cuts it off like that, iconic πŸ’…. The actual function is drm_crtc_vblank_helper_get_vblank_timestamp_internal, and it's a precise vblank timestamp helper. That's the whole vibe: precise vblank timestamps, no cap.


✨ SYNOPSIS ✨

bestie, here's the signature β€” copy it exactly and don't let autocorrect touch it:

bool drm_crtc_vblank_helper_get_vblank_timestamp_internal (struct
drm_crtc *crtc , int *max_error , ktime_t *vblank_time , bool
in_vblank_irq , drm_vblank_get_scanout_position_func
get_scanout_position );

πŸŽ€ ARGUMENTS πŸŽ€

  • crtc β€” the CRTC whose vblank timestamp you want to retrieve. main character CRTC energy.
  • max_error β€” you tell it the desired maximum allowable error in timestamps, measured in nanosecs. On return, it contains the true maximum error of timestamp. So it's input then output; she's versatile.
  • vblank_time β€” pointer to the time that should receive the timestamp. Basically where the answer gets dropped off. 🎁
  • in_vblank_irq β€” true when called from drm_crtc_handle_vblank. Some drivers need to apply some workarounds for gpu-specific vblank irq quirks if this flag is set. important little flag.
  • get_scanout_position β€” callback function to retrieve the scanout position. See struct drm_crtc_helper_funcs.get_scanout_position. She calls back, she gets position, she slays.

πŸ¦‹ DESCRIPTION πŸ¦‹

so what does she actually do? Implements calculation of exact vblank timestamps from given drm_display_mode timings and the current video scanout position of a CRTC. That's the core. ✨

The current implementation only handles standard video modes. For double scan and interlaced modes, the driver is supposed to adjust the hardware mode (taken from drm_crtc_state.adjusted mode for atomic modeset drivers) to match the scanout position reported. iykyk β€” don't expect her to magically handle every weird mode without the driver doing its part.

Note that atomic drivers must call drm_calc_timestamping_constants before enabling a CRTC. The atomic helpers already take care of that in drm_atomic_helper_calc_timestamping_constants. So like, don't forget the setup, bestie πŸ’….


🌈 RETURN 🌈

Returns true on success, and false on failure, i.e. when no accurate timestamp could be acquired. periodt. If it can't get a clean timestamp, it says false β€” that's the whole story.


πŸ‘‘ SEE ALSO πŸ‘‘


okay that's the page, bestie 🫢 β€” source: ./drivers/gpu/drm, date: October 2026, manual page: drm_crtc_vbl...amp_internal(9). you're welcome, go get those exact vblank timestamps ✨

πŸ“¦ where this page comes from