vmw_vkms_modeset_lock(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… vmw_vkms_modeset_lock(9) β€” it's giving "kernel API manual" energy ✨

okay so bestie, welcome to the Kernel API Manual page for vmw_vkms_modeset_lock(9). yes the title is the function name, yes that's how manpages work, no we're not gonna fight it. let's GO 🫢


✨ NAME ✨

vmw_vkms_modeset_lock β€” she protects access to the crtc during a modeset, no cap πŸ”’


πŸŽ€ SYNOPSIS πŸŽ€

void vmw_vkms_modeset_lock (struct drm_crtc *crtc );

that's it. that's the whole signature. void return, one arg, iconic behavior πŸ’…


🌸 ARGUMENTS 🌸

  • crtc β€” the crtc you're locking for vkms. that's the one, that's the girl πŸ‘‘

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so real talk: this function's whole job is to stop the VKMS timers/callbacks from getting called while a modeset operation is in process. like, we literally do not want the callbacks β€” for example the vblank simulator β€” trying to touch incomplete state. that's messy. that's not the vibe. so we make sure they only execute once the modeset has finished. periodt ✨

now, normally this would've been done with a spinlock, but locking the entire atomic modeset with vmwgfx is impossible 😭 because kms prepare executes non-atomic ops β€” for example, vmw_validation_prepare holds a mutex to guard various bits of state. so yeah, spinlock is off the table, it's not giving what we need.

which means we need to synchronize atomic context (that's the vblank handler) with the non-atomic entirety of kms. so how do we do it? we use an atomic_t to track which part of vkms has access to the basic vkms state. that's the whole trick. clean, simple, slays 🧚

ngl this is one of those "sounds complicated, is actually just 'keep track of who's holding the state'" situations. you got this πŸ’–

πŸ‘‘ SEE ALSO πŸ‘‘


and that's the page!! tysm for reading, mwah πŸ’‹ this one lives in ./drivers/gpu/drm/vmwgfx and it's dated October 2026 β€” so yeah, she's from the future, main character energy fr fr πŸŒˆβ­πŸ’œ

πŸ“¦ where this page comes from