drm_panic_lock(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ drm_panic_lock(9) πŸŽ€

okay so bestie, welcome to the Kernel API Manual page for drm_panic_lock(9) β€” the function that keeps your panic printing state from getting absolutely cooked πŸ’…

✨ NAME ✨

drm_panic_lock β€” protect panic printing relevant state πŸ›‘οΈ

🌸 SYNOPSIS 🌸

drm_panic_lock (dev , flags );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev β€” a struct drm_device πŸ–₯️
  • flags β€” unsigned long irq flags you need to pass to the unlock counterpart πŸ”‘

πŸ’– DESCRIPTION πŸ’–

You must call this function to protect the software and hardware state that the panic printing code must be able to rely on. Keep those protected sections as small as possible, no cap. It uses the irqsave/irqrestore variant, and it can be called from an irq handler. Examples include:

  • Access to peek/poke or other similar registers, if that is the way the driver prints the pixels into the scanout buffer at panic time. πŸ‘€
  • Updates to pointers like drm_plane.state, allowing the panic handler to safely deference these. This is done in drm_atomic_helper_swap_state. 🫢
  • An state that isn't invariant and that the driver must be able to access during panic printing. πŸŒ€

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./include/drm/drm_panic.h struct drm_scanout_buffer(9), drm_panic_trylock(9), drm_panic_unlock(9) β€” go read these too, bestie πŸ“š


that's the whole vibe fr fr: from ./include/drm, dated October 2026, all about drm_panic_lock(9) β€” slay and stay safe out there πŸ’œ

πŸ“¦ where this page comes from