STRUCT DRM_SCANOUT_BUFFER(9)
π 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 usekmap_local_page_try_from_panicto 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 themapandpagesfields β so if it's set, it wins, periodt πprivateβ private pointer that you can use in the callbacksset_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
- 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