STRUCT DRM_SCANOUT_BUFFER(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct drm_scanout_buffer(9) πŸ’–

okay so bestie, this is a page straight outta the Kernel API Manual β€” struct drm_scanout_buffer(9) β€” and it's literally the main character of panic-screen rendering. sit down, grab a boba, we're learning πŸ’…


✨ NAME ✨

struct drm_scanout_buffer β€” the DRM scanout buffer, aka the thing that holds all the deets drm_panic needs to draw on your screen when everything else has gone πŸ’€


πŸŽ€ SYNOPSIS πŸŽ€

struct drm_scanout_buffer {
    const struct drm_format_info *format;
    struct iosys_map map[DRM_FORMAT_MAX_PLANES];
    struct page **pages;
    unsigned int width;
    unsigned int height;
    unsigned int pitch[DRM_FORMAT_MAX_PLANES];
    void (*set_pixel)(struct drm_scanout_buffer *sb, unsigned int x,
unsigned int y, u32 color);
    void *private;
 };

πŸ¦‹ Members πŸ¦‹

  • format β€” the drm format of the scanout buffer. like, what is this thing pixel-wise ✨
  • map β€” virtual address of the scanout buffer, either in memory or iomem. this one's important: the scanout buffer should be in linear format, and it can be sent directly to the display hardware. and ngl, tearing is not an issue for the panic screen β€” so don't stress about it πŸ™ˆ
  • pages β€” optional! if the scanout buffer is not mapped, set this field to the array of pages of the scanout buffer. the panic code will use kmap_local_page_try_from_panic to map one page at a time to write all the pixels. 🫢
⚠️ heads up bestie: this array shouldn't be allocated from the get_scanoutbuffer callback. and yeah β€” the scanout buffer should be in linear format.
  • width β€” width of the scanout buffer, in pixels πŸ“
  • height β€” height of the scanout buffer, in pixels πŸ“
  • pitch β€” length in bytes between the start of two consecutive lines. yes, a whole array of them 🌈
  • set_pixel β€” optional function to set a pixel color on the framebuffer. it lets you handle special tiling format inside the driver 😀 and it takes precedence over the map and pages fields β€” so if it's set, it wins, periodt πŸ‘‘
  • private β€” private pointer that you can use in the callbacks set_pixel πŸ”’

🌸 Description 🌸

This structure holds the information necessary for drm_panic to draw the panic screen, and display it. that's it, that's the vibe β€” it's giving "everything you need, nothing you don't" πŸ’œ


⭐ SEE ALSO ⭐

Kernel file ./include/drm/drm_panic.h, drm_panic_trylock(9), drm_panic_lock(9), drm_panic_unlock(9) β€” go read those next, iykyk 🧚


and that's the whole page, bestie!! πŸŽ€ this little cutie lives in ./include/drm, the manual's dated October 2026, and it's brought to you by the Kernel API Manual β€” stream it, don't pirate it πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from