Skip to main content

Module display_backend

Module display_backend 

Source
Expand description

Display backend abstraction for DMA-based rendering.

This module provides a platform-agnostic interface for asynchronous framebuffer transfers using DMA (Direct Memory Access). This enables double-buffered rendering where the CPU can render to one buffer while the display hardware transfers another buffer.

§Safety

The key safety property of this API is that start_dma_transfer takes ownership of the framebuffer and returns a DmaTransfer token. The buffer is locked inside the token for the duration of the transfer — the compiler prevents any access to it until DmaTransfer::wait returns it. This eliminates the data race that arises from the previous borrow-based API, where DMA could be reading from memory that the CPU was free to overwrite.

Re-exports§

pub use crate::present::PresentRegion as DisplayRegion;

Structs§

CompletedTransfer
A transfer token that is already complete.
SimulatorBackend
No-op display backend for simulators and testing.
TransferError
Returned when a DMA transfer fails to start.

Enums§

DisplayError
Error types for display backend operations.

Traits§

AsyncDmaTransfer
An asynchronous DMA transfer that can be awaited as a future.
DisplayBackend
Platform-agnostic display backend trait.
DmaTransfer
An in-progress DMA transfer that holds the framebuffer until completion.