Skip to main content

Module fastfb

Module fastfb 

Source
Expand description

Wide-store helpers for the linear framebuffer.

The early boot console (live debug overlay) and the panic screen draw without the VgaWriter, so they cannot use its SIMD blit path. They used to write one pixel at a time with write_volatile, and to scroll with core::ptr::copy (which lowers to rep movsb).

On real hardware the framebuffer is MMIO behind PCIe: a byte/word store is one bus transaction, so rep movsb to uncached memory runs at a few MB/s and the panel visibly repaints from top to bottom. These helpers emit 8-byte stores, which is the widest portable width without target features (the pinned nightly miscompiles movntdq on x86_64-unknown-none), and keeps the write-combining buffers fed.

Functions§

bytes_per_pixel
Bytes per pixel for a supported GOP format (24 or 32).
copy_backward⚠
Backward copy of bytes bytes with 8-byte granularity.
copy_forward⚠
Forward copy of bytes bytes with 8-byte granularity.
fence
Fence write-combining stores so they become visible on the panel.
fill_pixels⚠
Fill pixels consecutive pixels with color.
store_row⚠
Store a row of colors (one u32 per pixel) into the framebuffer.