VBLANK WORKS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… vblank works πŸ’…

okay so bestie, this page is from the Kernel API Manual, and it's giving β€œhow do we make picky hardware hit its deadlines without the scheduler ruining the vibe” energy ✨

Many DRM drivers need to program hardware in a time-sensitive manner β€” like, many times with a deadline of starting and finishing within a certain region of the scanout 😀 Most of the time, the safest way to accomplish this is to simply do said time-sensitive programming in the driver's IRQ handler, which lets drivers avoid being preempted during these critical regions. Or even better: the hardware may even handle applying such time-critical programming independently of the CPU. iconic behavior, honestly πŸ‘‘

While there's a decent amount of hardware that's designed so that the CPU doesn't need to be concerned with extremely time-sensitive programming, there's a few situations where it can't be helped 😭 Some unforgiving hardware may require that certain time-sensitive programming be handled completely by the CPU, and said programming may even take too long to handle in an IRQ handler. Another such situation would be where the driver needs to perform a task that needs to complete within a specific scanout period, but might possibly block and thus cannot be handled in an IRQ context. Both of these situations can't be solved perfectly in Linux since we're not a realtime kernel β€” and thus the scheduler may cause us to miss our deadline if it decides to preempt us πŸ’€ But for some drivers, it's good enough if we can lower our chance of being preempted to an absolute minimum 🫢

This is where drm_vblank_work comes in. drm_vblank_work provides a simple generic delayed work implementation which delays work execution until a particular vblank has passed, and then executes the work at realtime priority πŸ”₯ This provides the best possible chance at performing time-sensitive hardware programming on time, even when the system is under heavy load. drm_vblank_work also supports rescheduling, so that self re-arming work items can be easily implemented πŸŽ€


🌈 SEE ALSO 🌈

mwah πŸ’‹ β€” source ./drivers/gpu/drm, dated October 2026 πŸ¦‹βœ¨

πŸ“¦ where this page comes from