Expand description
Kernel adapter for the fbsurface crate.
fbsurface owns the geometry, the format rules and the clipping. This
module supplies the two pieces that are kernel-specific:
KernelOps, which forwards the 32-bit primitives to the existing SSE2/AVX2/scalar backend inFramebufferOpsand returns anFpuGuardso every drawing call preserves the callerβs SSE state;Presenter, which owns the write-combining framebuffer surface and the refresh policy (PRESENT_MIN_TICKS), and copies damaged rectangles from a back surface.
The intended split is: buffers and damage are fbsurface types, the
refresh policy is Presenter, and the raw pixels stay behind
FramebufferOps.
Β§Example
β
let surface: Canvas<'_, KernelOps> = unsafe {
Canvas::direct(
base,
Dims::new(1920, 1080),
1920 * 4,
Format::XRGB8888,
/* write_combining = */ true,
KernelOps::new(ops()),
)
}
.unwrap();Re-exportsΒ§
use core::ptr::NonNull;πuse fbsurface::Canvas;πuse fbsurface::Dims;πuse fbsurface::Format;πuse fbsurface::OwnedSurface;πuse fbsurface::PixelGuard;πuse fbsurface::PixelOps;πuse fbsurface::Rect;πuse fbsurface::RectSet;πuse fbsurface::Source;πuse crate::framebuffer::FpuGuard;πuse crate::framebuffer::FramebufferOps;πuse crate::framebuffer::MAX_DIRTY_RECTS;πuse crate::framebuffer::PRESENT_MIN_TICKS;π
StructsΒ§
- Kernel
Ops - Pixel backend backed by the kernelβs
FramebufferOpsfunction table. - Presenter
- Frame presentation: owns the scanout surface and rate-limits the flush.
FunctionsΒ§
- surface_
from_ βfb - Create a kernel surface over an HHDM-mapped physical framebuffer.
Type AliasesΒ§
- Surface
- A kernel surface: the crateβs canvas with the kernel pixel backend.