vmw_vkms_modeset_lock(9)
π 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 π
- Kernel file
./drivers/gpu/drm/vmwgfx/vmwgfx_vkms.cβ go read the source bestie, it's all there π vmw_vkms_lock_max_wait_ns(9)vmw_vkms_modeset_lock_relaxed(9)vmw_vkms_vblank_trylock(9)
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
- 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