Struct boot_info::FramebufferInfo
source · pub struct FramebufferInfo {
pub virt_addr: Option<VirtualAddress>,
pub phys_addr: PhysicalAddress,
pub total_size_in_bytes: u64,
pub width: u32,
pub height: u32,
pub bits_per_pixel: u8,
pub stride: u32,
pub format: FramebufferFormat,
}
Expand description
Information about a framebuffer’s layout in memory.
Fields§
§virt_addr: Option<VirtualAddress>
The virtual address of the start of the framebuffer, if it has been mapped for us by the bootloader.
phys_addr: PhysicalAddress
The physical address of the start of the framebuffer.
total_size_in_bytes: u64
The total size of the framebuffer memory in bytes.
width: u32
The width in pixels (number of columns) of the framebuffer. If this is a text framebuffer, this is in units of characters.
height: u32
The height in pixels (number of rows) of the framebuffer. If this is a text framebuffer, this is in units of characters.
bits_per_pixel: u8
The number of bits that each pixel occupies in memory. If this is a text framebuffer, this is the number of bits that each character occupies in memory.
stride: u32
The number of pixels between the start of one line (row) and the start of the next line (row).
This is sometimes referred to as pixels per scan line.
This is required because some framebuffer implementations may have padding (empty space) at the end of each line, i.e., each line is not contiguous in memory. For such framebuffers, you must skip those padding pixels in order to get to the start of the next line in memory.
- If
stride
is equal towidth
, there are no padding pixels. - If
stride
is greater thanwidth
, the number of padding pixels after the end of each line isstride - width
. - The value of
stride
itself is NOT the number of padding pixels.
If this is a text framebuffer, this value represents the number of characters instead of pixels, but it is typically always 0.
format: FramebufferFormat
The format of the framebuffer and its pixels or characters.